Bsongis/adc rtc temperature (#6537)
RTC voltage + CPU temperature + RTC voltage alarm (thanks @schwabe)
This commit is contained in:
@@ -114,7 +114,7 @@ void insertExpoMix(uint8_t expo, uint8_t idx)
|
||||
memmove(mix+1, mix, (MAX_MIXERS-(idx+1))*sizeof(MixData));
|
||||
memclear(mix, sizeof(MixData));
|
||||
mix->destCh = s_currCh-1;
|
||||
mix->srcRaw = (s_currCh > 4 ? MIXSRC_Rud - 1 + s_currCh : MIXSRC_Rud - 1 + channel_order(s_currCh));
|
||||
mix->srcRaw = (s_currCh > 4 ? MIXSRC_Rud - 1 + s_currCh : MIXSRC_Rud - 1 + channelOrder(s_currCh));
|
||||
mix->weight = 100;
|
||||
}
|
||||
resumeMixerCalculations();
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#if defined(PCBSKY9X)
|
||||
#define HW_SETTINGS_COLUMN (2+(15*FW))
|
||||
enum MenuRadioHardwareItems {
|
||||
enum {
|
||||
ITEM_RADIO_HARDWARE_OPTREX_DISPLAY,
|
||||
ITEM_RADIO_HARDWARE_STICKS_GAINS_LABELS,
|
||||
ITEM_RADIO_HARDWARE_STICK_LV_GAIN,
|
||||
@@ -88,7 +88,7 @@ void menuRadioHardware(event_t event)
|
||||
#endif // PCBSKY9X
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
enum MenuRadioHardwareItems {
|
||||
enum {
|
||||
ITEM_RADIO_HARDWARE_LABEL_STICKS,
|
||||
ITEM_RADIO_HARDWARE_STICK1,
|
||||
ITEM_RADIO_HARDWARE_STICK2,
|
||||
@@ -115,9 +115,6 @@ enum MenuRadioHardwareItems {
|
||||
ITEM_RADIO_HARDWARE_SJ,
|
||||
#endif
|
||||
ITEM_RADIO_HARDWARE_BATTERY_CALIB,
|
||||
#if defined(STM32)
|
||||
ITEM_RADIO_HARDWARE_RTC_BATTERY,
|
||||
#endif
|
||||
#if defined(TX_CAPACITY_MEASUREMENT)
|
||||
ITEM_RADIO_HARDWARE_CAPACITY_CALIB,
|
||||
#endif
|
||||
@@ -180,12 +177,6 @@ enum MenuRadioHardwareItems {
|
||||
#define SWITCH_TYPE_MAX(sw) ((MIXSRC_SF-MIXSRC_FIRST_SWITCH == sw || MIXSRC_SH-MIXSRC_FIRST_SWITCH == sw || MIXSRC_SI-MIXSRC_FIRST_SWITCH == sw || MIXSRC_SJ-MIXSRC_FIRST_SWITCH == sw) ? SWITCH_2POS : SWITCH_3POS)
|
||||
#endif
|
||||
|
||||
#if defined(STM32)
|
||||
#define RTC_BATT_ROWS READONLY_ROW,
|
||||
#else
|
||||
#define RTC_BATT_ROWS
|
||||
#endif
|
||||
|
||||
#if defined(TX_CAPACITY_MEASUREMENT)
|
||||
#define TX_CAPACITY_MEASUREMENT_ROWS 0,
|
||||
#else
|
||||
@@ -222,8 +213,6 @@ void menuRadioHardware(event_t event)
|
||||
SWITCHES_ROWS,
|
||||
0 /* battery calib */,
|
||||
|
||||
RTC_BATT_ROWS
|
||||
|
||||
TX_CAPACITY_MEASUREMENT_ROWS
|
||||
|
||||
TEMPERATURE_CALIB_ROWS
|
||||
@@ -349,13 +338,6 @@ void menuRadioHardware(event_t event)
|
||||
}
|
||||
break;
|
||||
|
||||
#if defined(STM32)
|
||||
case ITEM_RADIO_HARDWARE_RTC_BATTERY:
|
||||
lcdDrawTextAlignedLeft(y, STR_RTC_BATT);
|
||||
putsVolts(HW_SETTINGS_COLUMN2, y, vbattRTC, PREC2|LEFT);
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(TX_CAPACITY_MEASUREMENT)
|
||||
case ITEM_RADIO_HARDWARE_CAPACITY_CALIB:
|
||||
lcdDrawTextAlignedLeft(y, STR_CURRENT_CALIB);
|
||||
|
||||
@@ -597,7 +597,7 @@ void menuRadioSetup(event_t event)
|
||||
case ITEM_SETUP_RX_CHANNEL_ORD:
|
||||
lcdDrawTextAlignedLeft(y, STR_RXCHANNELORD); // RAET->AETR
|
||||
for (uint8_t i=1; i<=4; i++) {
|
||||
putsChnLetter(RADIO_SETUP_2ND_COLUMN - FW + i*FW, y, channel_order(i), attr);
|
||||
putsChnLetter(RADIO_SETUP_2ND_COLUMN - FW + i*FW, y, channelOrder(i), attr);
|
||||
}
|
||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.templateSetup, 0, 23);
|
||||
break;
|
||||
|
||||
@@ -39,7 +39,7 @@ void menuRadioTrainer(event_t event)
|
||||
y = MENU_HEADER_HEIGHT + 1 + FH;
|
||||
|
||||
for (uint8_t i=HEADER_LINE; i<HEADER_LINE+NUM_STICKS; i++) {
|
||||
uint8_t chan = channel_order(i+1-HEADER_LINE);
|
||||
uint8_t chan = channelOrder(i+1-HEADER_LINE);
|
||||
volatile TrainerMix * td = &g_eeGeneral.trainer.mix[chan-1];
|
||||
|
||||
drawSource(0, y, MIXSRC_Rud-1+chan, (menuVerticalPosition==i && CURSOR_ON_LINE()) ? INVERS : 0);
|
||||
|
||||
@@ -57,6 +57,7 @@ void menuStatisticsView(event_t event)
|
||||
storageDirty(EE_GENERAL);
|
||||
sessionTimer = 0;
|
||||
break;
|
||||
|
||||
case EVT_KEY_FIRST(KEY_EXIT):
|
||||
chainMenu(menuMainView);
|
||||
break;
|
||||
@@ -108,6 +109,11 @@ void menuStatisticsDebug(event_t event)
|
||||
title(STR_MENUDEBUG);
|
||||
|
||||
switch (event) {
|
||||
case EVT_ENTRY:
|
||||
case EVT_ENTRY_UP:
|
||||
enableVBatBridge();
|
||||
break;
|
||||
|
||||
case EVT_KEY_LONG(KEY_ENTER):
|
||||
#if defined(PCBSKY9X)
|
||||
g_eeGeneral.mAhUsed = 0;
|
||||
@@ -120,14 +126,19 @@ void menuStatisticsDebug(event_t event)
|
||||
break;
|
||||
|
||||
case EVT_KEY_FIRST(KEY_ENTER):
|
||||
#if defined(LUA)
|
||||
maxLuaInterval = 0;
|
||||
maxLuaDuration = 0;
|
||||
#endif
|
||||
maxMixerDuration = 0;
|
||||
break;
|
||||
|
||||
case EVT_KEY_FIRST(KEY_UP):
|
||||
#if defined(NAVIGATION_X7)
|
||||
case EVT_KEY_BREAK(KEY_PAGE):
|
||||
disableVBatBridge();
|
||||
chainMenu(menuStatisticsDebug2);
|
||||
return;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case EVT_KEY_FIRST(KEY_DOWN):
|
||||
@@ -135,10 +146,12 @@ void menuStatisticsDebug(event_t event)
|
||||
case EVT_KEY_LONG(KEY_PAGE):
|
||||
#endif
|
||||
killEvents(event);
|
||||
disableVBatBridge();
|
||||
chainMenu(menuStatisticsView);
|
||||
break;
|
||||
|
||||
case EVT_KEY_FIRST(KEY_EXIT):
|
||||
disableVBatBridge();
|
||||
chainMenu(menuMainView);
|
||||
break;
|
||||
}
|
||||
@@ -169,14 +182,6 @@ void menuStatisticsDebug(event_t event)
|
||||
y += FH;
|
||||
#endif
|
||||
|
||||
#if defined(PCBSKY9X)
|
||||
lcdDrawTextAlignedLeft(y, STR_CPU_TEMP);
|
||||
drawValueWithUnit(MENU_DEBUG_COL1_OFS, y, getTemperature(), UNIT_TEMPERATURE, LEFT);
|
||||
lcdDrawChar(MENU_DEBUG_COL2_OFS, y, '>');
|
||||
drawValueWithUnit(MENU_DEBUG_COL2_OFS+FW+1, y, maxTemperature+g_eeGeneral.temperatureCalib, UNIT_TEMPERATURE, LEFT);
|
||||
y += FH;
|
||||
#endif
|
||||
|
||||
#if defined(COPROCESSOR)
|
||||
lcdDrawTextAlignedLeft(y, STR_COPROC_TEMP);
|
||||
if (Coproc_read==0) {
|
||||
@@ -245,7 +250,23 @@ void menuStatisticsDebug(event_t event)
|
||||
y += FH;
|
||||
#endif
|
||||
|
||||
lcdDrawText(4*FW, 7*FH+1, STR_MENUTORESET);
|
||||
#if defined(STM32)
|
||||
lcdDrawTextAlignedLeft(y, STR_RTC_BATT);
|
||||
putsVolts(MENU_DEBUG_COL1_OFS, y, getRTCBatteryVoltage(), PREC2|LEFT);
|
||||
y += FH;
|
||||
#endif
|
||||
|
||||
#if defined(PCBSKY9X)
|
||||
lcdDrawTextAlignedLeft(y, STR_CPU_TEMP);
|
||||
drawValueWithUnit(MENU_DEBUG_COL1_OFS, y, getTemperature(), UNIT_TEMPERATURE, LEFT);
|
||||
lcdDrawChar(MENU_DEBUG_COL2_OFS, y, '>');
|
||||
drawValueWithUnit(MENU_DEBUG_COL2_OFS+FW+1, y, maxTemperature+g_eeGeneral.temperatureCalib, UNIT_TEMPERATURE, LEFT);
|
||||
#else
|
||||
lcdDrawTextAlignedLeft(y, STR_CPU_TEMP);
|
||||
drawValueWithUnit(MENU_DEBUG_COL1_OFS, y, getTemperature(), UNIT_TEMPERATURE, PREC1|LEFT);
|
||||
#endif
|
||||
|
||||
lcdDrawText(LCD_W/2, 7*FH+1, STR_MENUTORESET, CENTERED);
|
||||
lcdInvertLastLine();
|
||||
}
|
||||
|
||||
@@ -254,7 +275,7 @@ void menuStatisticsDebug2(event_t event)
|
||||
{
|
||||
title(STR_MENUDEBUG);
|
||||
|
||||
switch (event) {
|
||||
switch(event) {
|
||||
case EVT_KEY_FIRST(KEY_ENTER):
|
||||
telemetryErrors = 0;
|
||||
break;
|
||||
@@ -291,7 +312,7 @@ void menuStatisticsDebug2(event_t event)
|
||||
y += FH;
|
||||
#endif
|
||||
|
||||
lcdDrawText(4*FW, 7*FH+1, STR_MENUTORESET);
|
||||
lcdDrawText(LCD_W/2, 7*FH+1, STR_MENUTORESET, CENTERED);
|
||||
lcdInvertLastLine();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
enum menuRadioHwItems {
|
||||
enum {
|
||||
ITEM_RADIO_HARDWARE_LABEL_STICKS,
|
||||
ITEM_RADIO_HARDWARE_STICK1,
|
||||
ITEM_RADIO_HARDWARE_STICK2,
|
||||
|
||||
@@ -477,7 +477,7 @@ void menuRadioSetup(event_t event)
|
||||
case ITEM_SETUP_RX_CHANNEL_ORD:
|
||||
lcdDrawTextAlignedLeft(y, STR_RXCHANNELORD); // RAET->AETR
|
||||
for (uint8_t i=1; i<=4; i++) {
|
||||
putsChnLetter(RADIO_SETUP_2ND_COLUMN - FW + i*FW, y, channel_order(i), attr);
|
||||
putsChnLetter(RADIO_SETUP_2ND_COLUMN - FW + i*FW, y, channelOrder(i), attr);
|
||||
}
|
||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.templateSetup, 0, 23);
|
||||
break;
|
||||
|
||||
@@ -42,7 +42,7 @@ void menuRadioTrainer(event_t event)
|
||||
y = MENU_HEADER_HEIGHT + 1 + FH;
|
||||
|
||||
for (int i=0; i<NUM_STICKS; i++) {
|
||||
uint8_t chan = channel_order(i+1);
|
||||
uint8_t chan = channelOrder(i+1);
|
||||
TrainerMix * td = &g_eeGeneral.trainer.mix[chan-1];
|
||||
|
||||
putsStickName(0, y, chan-1, (menuVerticalPosition==i && CURSOR_ON_LINE()) ? INVERS : 0);
|
||||
|
||||
@@ -29,8 +29,7 @@ void menuStatisticsView(event_t event)
|
||||
{
|
||||
title(STR_MENUSTAT);
|
||||
|
||||
switch(event)
|
||||
{
|
||||
switch(event) {
|
||||
case EVT_KEY_FIRST(KEY_UP):
|
||||
case EVT_KEY_BREAK(KEY_PAGE):
|
||||
chainMenu(menuStatisticsDebug);
|
||||
@@ -46,7 +45,7 @@ void menuStatisticsView(event_t event)
|
||||
#endif
|
||||
break;
|
||||
|
||||
case EVT_KEY_LONG(KEY_MENU): // historical
|
||||
case EVT_KEY_LONG(KEY_MENU): // historical
|
||||
case EVT_KEY_LONG(KEY_ENTER):
|
||||
g_eeGeneral.globalTimer = 0;
|
||||
storageDirty(EE_GENERAL);
|
||||
@@ -116,14 +115,19 @@ void menuStatisticsDebug(event_t event)
|
||||
}
|
||||
#endif
|
||||
|
||||
switch(event)
|
||||
{
|
||||
switch(event) {
|
||||
case EVT_ENTRY:
|
||||
case EVT_ENTRY_UP:
|
||||
enableVBatBridge();
|
||||
break;
|
||||
|
||||
case EVT_KEY_LONG(KEY_ENTER):
|
||||
g_eeGeneral.globalTimer = 0;
|
||||
storageDirty(EE_GENERAL);
|
||||
sessionTimer = 0;
|
||||
storageDirty(EE_GENERAL);
|
||||
killEvents(event);
|
||||
break;
|
||||
|
||||
case EVT_KEY_FIRST(KEY_ENTER):
|
||||
#if defined(LUA)
|
||||
maxLuaInterval = 0;
|
||||
@@ -132,20 +136,24 @@ void menuStatisticsDebug(event_t event)
|
||||
maxMixerDuration = 0;
|
||||
break;
|
||||
|
||||
case EVT_KEY_FIRST(KEY_DOWN):
|
||||
case EVT_KEY_LONG(KEY_PAGE):
|
||||
killEvents(event);
|
||||
chainMenu(menuStatisticsView);
|
||||
break;
|
||||
|
||||
case EVT_KEY_FIRST(KEY_UP):
|
||||
case EVT_KEY_BREAK(KEY_PAGE):
|
||||
disableVBatBridge();
|
||||
chainMenu(menuStatisticsDebug2);
|
||||
break;
|
||||
|
||||
case EVT_KEY_FIRST(KEY_DOWN):
|
||||
case EVT_KEY_LONG(KEY_PAGE):
|
||||
killEvents(event);
|
||||
disableVBatBridge();
|
||||
chainMenu(menuStatisticsView);
|
||||
break;
|
||||
|
||||
case EVT_KEY_FIRST(KEY_EXIT):
|
||||
disableVBatBridge();
|
||||
chainMenu(menuMainView);
|
||||
break;
|
||||
|
||||
#if defined(WATCHDOG_TEST)
|
||||
case EVT_KEY_LONG(KEY_MENU):
|
||||
{
|
||||
@@ -157,44 +165,73 @@ void menuStatisticsDebug(event_t event)
|
||||
#endif
|
||||
}
|
||||
|
||||
lcdDrawTextAlignedLeft(MENU_DEBUG_ROW3, "Free Mem");
|
||||
lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_ROW3, availableMemory(), LEFT);
|
||||
lcdDrawText(lcdLastRightPos, MENU_DEBUG_ROW3, "b");
|
||||
uint8_t y = FH + 1;
|
||||
|
||||
#if defined(STM32) && !defined(SIMU) && defined(DEBUG)
|
||||
lcdDrawTextAlignedLeft(y, "Usb");
|
||||
lcdDrawNumber(MENU_DEBUG_COL1_OFS, y, charsWritten, LEFT);
|
||||
lcdDrawText(lcdLastRightPos, y, " ");
|
||||
lcdDrawNumber(lcdLastRightPos, y, APP_Rx_ptr_in, LEFT);
|
||||
lcdDrawText(lcdLastRightPos, y, " ");
|
||||
lcdDrawNumber(lcdLastRightPos, y, APP_Rx_ptr_out, LEFT);
|
||||
lcdDrawText(lcdLastRightPos, y, " ");
|
||||
lcdDrawNumber(lcdLastRightPos, y, usbWraps, LEFT);
|
||||
y += FH;
|
||||
#endif
|
||||
|
||||
#if defined(STM32)
|
||||
lcdDrawTextAlignedLeft(y, "Free Mem");
|
||||
lcdDrawNumber(MENU_DEBUG_COL1_OFS, y, availableMemory(), LEFT);
|
||||
lcdDrawText(lcdLastRightPos, y, "b");
|
||||
y += FH;
|
||||
#endif
|
||||
|
||||
#if defined(LUA)
|
||||
lcdDrawTextAlignedLeft(MENU_DEBUG_ROW2, "Lua scripts");
|
||||
lcdDrawText(MENU_DEBUG_COL1_OFS, MENU_DEBUG_ROW2+1, "[Duration]", SMLSIZE);
|
||||
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_ROW2, 10*maxLuaDuration, LEFT);
|
||||
lcdDrawText(lcdLastRightPos+2, MENU_DEBUG_ROW2+1, "[Interval]", SMLSIZE);
|
||||
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_ROW2, 10*maxLuaInterval, LEFT);
|
||||
lcdDrawTextAlignedLeft(y, "Lua scripts");
|
||||
lcdDrawText(MENU_DEBUG_COL1_OFS, y+1, "[Duration]", SMLSIZE);
|
||||
lcdDrawNumber(lcdLastRightPos, y, 10*maxLuaDuration, LEFT);
|
||||
lcdDrawText(lcdLastRightPos+2, y+1, "[Interval]", SMLSIZE);
|
||||
lcdDrawNumber(lcdLastRightPos, y, 10*maxLuaInterval, LEFT);
|
||||
y += FH;
|
||||
#endif
|
||||
|
||||
lcdDrawTextAlignedLeft(MENU_DEBUG_ROW1, STR_TMIXMAXMS);
|
||||
lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_ROW1, DURATION_MS_PREC2(maxMixerDuration), PREC2|LEFT);
|
||||
lcdDrawText(lcdLastRightPos, MENU_DEBUG_ROW1, "ms");
|
||||
lcdDrawTextAlignedLeft(y, STR_TMIXMAXMS);
|
||||
lcdDrawNumber(MENU_DEBUG_COL1_OFS, y, DURATION_MS_PREC2(maxMixerDuration), PREC2|LEFT);
|
||||
lcdDrawText(lcdLastRightPos, y, "ms");
|
||||
y += FH;
|
||||
|
||||
#if !defined(SIMU) && defined(DEBUG)
|
||||
lcdDrawTextAlignedLeft(MENU_DEBUG_ROW4, "Usb");
|
||||
lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_ROW4, charsWritten, LEFT);
|
||||
lcdDrawText(lcdLastRightPos, MENU_DEBUG_ROW4, " ");
|
||||
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_ROW4, APP_Rx_ptr_in, LEFT);
|
||||
lcdDrawText(lcdLastRightPos, MENU_DEBUG_ROW4, " ");
|
||||
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_ROW4, APP_Rx_ptr_out, LEFT);
|
||||
lcdDrawText(lcdLastRightPos, MENU_DEBUG_ROW4, " ");
|
||||
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_ROW4, usbWraps, LEFT);
|
||||
lcdDrawTextAlignedLeft(y, STR_FREE_STACK);
|
||||
lcdDrawText(MENU_DEBUG_COL1_OFS, y+1, "[M]", SMLSIZE);
|
||||
lcdDrawNumber(lcdLastRightPos, y, menusStack.available(), LEFT);
|
||||
lcdDrawText(lcdLastRightPos+2, y+1, "[X]", SMLSIZE);
|
||||
lcdDrawNumber(lcdLastRightPos, y, mixerStack.available(), LEFT);
|
||||
lcdDrawText(lcdLastRightPos+2, y+1, "[A]", SMLSIZE);
|
||||
lcdDrawNumber(lcdLastRightPos, y, audioStack.available(), LEFT);
|
||||
lcdDrawText(lcdLastRightPos+2, y+1, "[I]", SMLSIZE);
|
||||
lcdDrawNumber(lcdLastRightPos, y, stackAvailable(), LEFT);
|
||||
y += FH;
|
||||
|
||||
#if defined(DEBUG_LATENCY)
|
||||
lcdDrawTextAlignedLeft(y, "Hearbeat");
|
||||
if (heartbeatCapture.valid)
|
||||
lcdDrawNumber(MENU_DEBUG_COL1_OFS, y, heartbeatCapture.count, LEFT);
|
||||
else
|
||||
lcdDrawText(MENU_DEBUG_COL1_OFS, y, "---");
|
||||
y += FH;
|
||||
#endif
|
||||
|
||||
lcdDrawTextAlignedLeft(MENU_DEBUG_ROW5, STR_FREE_STACK);
|
||||
lcdDrawText(MENU_DEBUG_COL1_OFS, MENU_DEBUG_ROW5+1, "[M]", SMLSIZE);
|
||||
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_ROW5, menusStack.available(), LEFT);
|
||||
lcdDrawText(lcdLastRightPos+2, MENU_DEBUG_ROW5+1, "[X]", SMLSIZE);
|
||||
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_ROW5, mixerStack.available(), LEFT);
|
||||
lcdDrawText(lcdLastRightPos+2, MENU_DEBUG_ROW5+1, "[A]", SMLSIZE);
|
||||
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_ROW5, audioStack.available(), LEFT);
|
||||
lcdDrawText(lcdLastRightPos+2, MENU_DEBUG_ROW5+1, "[I]", SMLSIZE);
|
||||
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_ROW5, stackAvailable(), LEFT);
|
||||
#if defined(STM32)
|
||||
lcdDrawTextAlignedLeft(y, STR_RTC_BATT);
|
||||
putsVolts(MENU_DEBUG_COL1_OFS, y, getRTCBatteryVoltage(), PREC2|LEFT);
|
||||
y += FH;
|
||||
#endif
|
||||
|
||||
lcdDrawText(3*FW, 7*FH+1, STR_MENUTORESET);
|
||||
#if defined(STM32)
|
||||
lcdDrawTextAlignedLeft(y, STR_CPU_TEMP);
|
||||
drawValueWithUnit(MENU_DEBUG_COL1_OFS, y, getTemperature(), UNIT_TEMPERATURE, PREC1|LEFT);
|
||||
#endif
|
||||
|
||||
lcdDrawText(LCD_W/2, 7*FH+1, STR_MENUTORESET, CENTERED);
|
||||
lcdInvertLastLine();
|
||||
}
|
||||
|
||||
@@ -202,11 +239,7 @@ void menuStatisticsDebug2(event_t event)
|
||||
{
|
||||
title(STR_MENUDEBUG);
|
||||
|
||||
switch(event)
|
||||
{
|
||||
|
||||
|
||||
|
||||
switch(event) {
|
||||
case EVT_KEY_FIRST(KEY_UP):
|
||||
case EVT_KEY_BREAK(KEY_PAGE):
|
||||
#if defined(DEBUG_TRACE_BUFFER)
|
||||
@@ -222,7 +255,6 @@ void menuStatisticsDebug2(event_t event)
|
||||
chainMenu(menuStatisticsDebug);
|
||||
break;
|
||||
|
||||
|
||||
case EVT_KEY_FIRST(KEY_EXIT):
|
||||
chainMenu(menuMainView);
|
||||
break;
|
||||
@@ -237,7 +269,7 @@ void menuStatisticsDebug2(event_t event)
|
||||
lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_ROW1, telemetryErrors, RIGHT);
|
||||
|
||||
|
||||
lcdDrawText(3*FW, 7*FH+1, STR_MENUTORESET);
|
||||
lcdDrawText(LCD_W/2, 7*FH+1, STR_MENUTORESET, CENTERED);
|
||||
lcdInvertLastLine();
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ void insertExpo(uint8_t idx)
|
||||
ExpoData * expo = expoAddress(idx);
|
||||
memmove(expo+1, expo, (MAX_EXPOS-(idx+1))*sizeof(ExpoData));
|
||||
memclear(expo, sizeof(ExpoData));
|
||||
expo->srcRaw = (s_currCh > 4 ? MIXSRC_Rud - 1 + s_currCh : MIXSRC_Rud - 1 + channel_order(s_currCh));
|
||||
expo->srcRaw = (s_currCh > 4 ? MIXSRC_Rud - 1 + s_currCh : MIXSRC_Rud - 1 + channelOrder(s_currCh));
|
||||
expo->curve.type = CURVE_REF_EXPO;
|
||||
expo->mode = 3; // pos+neg
|
||||
expo->chn = s_currCh - 1;
|
||||
|
||||
@@ -84,7 +84,7 @@ void insertMix(uint8_t idx)
|
||||
mix->destCh = s_currCh-1;
|
||||
mix->srcRaw = s_currCh;
|
||||
if (!isSourceAvailable(mix->srcRaw)) {
|
||||
mix->srcRaw = (s_currCh > 4 ? MIXSRC_Rud - 1 + s_currCh : MIXSRC_Rud - 1 + channel_order(s_currCh));
|
||||
mix->srcRaw = (s_currCh > 4 ? MIXSRC_Rud - 1 + s_currCh : MIXSRC_Rud - 1 + channelOrder(s_currCh));
|
||||
while (!isSourceAvailable(mix->srcRaw)) {
|
||||
mix->srcRaw += 1;
|
||||
}
|
||||
|
||||
@@ -457,7 +457,7 @@ bool menuRadioSetup(event_t event)
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_RXCHANNELORD); // RAET->AETR
|
||||
char s[5];
|
||||
for (uint8_t i=0; i<4; i++) {
|
||||
s[i] = STR_RETA123[channel_order(i+1)];
|
||||
s[i] = STR_RETA123[channelOrder(i+1)];
|
||||
}
|
||||
s[4] = '\0';
|
||||
lcdDrawText(RADIO_SETUP_2ND_COLUMN, y, s, attr);
|
||||
|
||||
@@ -45,10 +45,10 @@ bool menuRadioTrainer(event_t event)
|
||||
lcdDrawText(TRAINER_COLUMN_3, MENU_HEADER_HEIGHT+1, "Source", HEADER_COLOR);
|
||||
*/
|
||||
|
||||
y = MENU_CONTENT_TOP + FH;
|
||||
y = MENU_CONTENT_TOP;
|
||||
|
||||
for (uint8_t i=0; i<NUM_STICKS; i++) {
|
||||
uint8_t chan = channel_order(i+1);
|
||||
uint8_t chan = channelOrder(i+1);
|
||||
TrainerMix * td = &g_eeGeneral.trainer.mix[chan-1];
|
||||
|
||||
drawSource(MENUS_MARGIN_LEFT, y, MIXSRC_Rud-1+chan, ((menuVerticalPosition==i && CURSOR_ON_LINE()) ? INVERS : 0));
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
bool menuRadioVersion(event_t event)
|
||||
{
|
||||
char id[27];
|
||||
|
||||
#if 0
|
||||
if (warningResult) {
|
||||
warningResult = 0;
|
||||
@@ -36,12 +37,12 @@ bool menuRadioVersion(event_t event)
|
||||
|
||||
SIMPLE_MENU(STR_MENUVERSION, RADIO_ICONS, menuTabGeneral, MENU_RADIO_VERSION, 0);
|
||||
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP + FH, vers_stamp);
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP + 2*FH, date_stamp);
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP + 3*FH, time_stamp);
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP + 4*FH, eeprom_stamp);
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP + 5*FH, "UID:");
|
||||
lcdDrawText(MENUS_MARGIN_LEFT + 64, MENU_CONTENT_TOP + 5*FH, id);
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP, vers_stamp);
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP + FH, date_stamp);
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP + 2*FH, time_stamp);
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP + 3*FH, eeprom_stamp);
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP + 4*FH, "UID:");
|
||||
lcdDrawText(MENUS_MARGIN_LEFT + 64, MENU_CONTENT_TOP + 4*FH, id);
|
||||
|
||||
#if 0
|
||||
if (event == EVT_KEY_LONG(KEY_ENTER)) {
|
||||
|
||||
@@ -95,8 +95,12 @@ bool menuStatsGraph(event_t event)
|
||||
|
||||
bool menuStatsDebug(event_t event)
|
||||
{
|
||||
switch(event)
|
||||
{
|
||||
switch(event) {
|
||||
case EVT_ENTRY:
|
||||
case EVT_ENTRY_UP:
|
||||
enableVBatBridge();
|
||||
break;
|
||||
|
||||
case EVT_KEY_FIRST(KEY_ENTER):
|
||||
maxMixerDuration = 0;
|
||||
#if defined(LUA)
|
||||
@@ -106,51 +110,71 @@ bool menuStatsDebug(event_t event)
|
||||
break;
|
||||
}
|
||||
|
||||
SIMPLE_MENU("Debug", STATS_ICONS, menuTabStats, e_StatsDebug, 1);
|
||||
if (!check_simple(event, e_StatsDebug, menuTabStats, DIM(menuTabStats), 1)) {
|
||||
disableVBatBridge();
|
||||
return false;
|
||||
}
|
||||
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP, "Free Mem");
|
||||
lcdDrawNumber(MENU_STATS_COLUMN1, MENU_CONTENT_TOP, availableMemory(), LEFT, 0, NULL, "b");
|
||||
drawMenuTemplate("Debug", 0, STATS_ICONS, OPTION_MENU_TITLE_BAR);
|
||||
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP+FH, STR_TMIXMAXMS);
|
||||
lcdDrawNumber(MENU_STATS_COLUMN1, MENU_CONTENT_TOP+FH, DURATION_MS_PREC2(maxMixerDuration), PREC2|LEFT, 0, NULL, "ms");
|
||||
coord_t y = MENU_CONTENT_TOP;
|
||||
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP+2*FH, STR_FREE_STACK);
|
||||
lcdDrawText(MENU_STATS_COLUMN1, MENU_CONTENT_TOP+2*FH+1, "[Menus]", HEADER_COLOR|SMLSIZE);
|
||||
lcdDrawNumber(lcdNextPos+5, MENU_CONTENT_TOP+2*FH, menusStack.available(), LEFT);
|
||||
lcdDrawText(lcdNextPos+20, MENU_CONTENT_TOP+2*FH+1, "[Mix]", HEADER_COLOR|SMLSIZE);
|
||||
lcdDrawNumber(lcdNextPos+5, MENU_CONTENT_TOP+2*FH, mixerStack.available(), LEFT);
|
||||
lcdDrawText(lcdNextPos+20, MENU_CONTENT_TOP+2*FH+1, "[Audio]", HEADER_COLOR|SMLSIZE);
|
||||
lcdDrawNumber(lcdNextPos+5, MENU_CONTENT_TOP+2*FH, audioStack.available(), LEFT);
|
||||
|
||||
int line = 3;
|
||||
|
||||
#if defined(DISK_CACHE)
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP+line*FH, "SD cache hits");
|
||||
lcdDrawNumber(MENU_STATS_COLUMN1, MENU_CONTENT_TOP+line*FH, diskCache.getHitRate(), PREC1|LEFT, 0, NULL, "%");
|
||||
++line;
|
||||
#endif
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, y, "Free Mem");
|
||||
lcdDrawNumber(MENU_STATS_COLUMN1, y, availableMemory(), LEFT, 0, NULL, "b");
|
||||
y += FH;
|
||||
|
||||
#if defined(LUA)
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP+line*FH, "Lua duration");
|
||||
lcdDrawNumber(MENU_STATS_COLUMN1, MENU_CONTENT_TOP+line*FH, 10*maxLuaDuration, LEFT, 0, NULL, "ms");
|
||||
++line;
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, y, "Lua scripts");
|
||||
lcdDrawText(MENU_STATS_COLUMN1, y+1, "[Duration]", HEADER_COLOR|SMLSIZE);
|
||||
lcdDrawNumber(lcdNextPos+5, y, 10*maxLuaDuration, LEFT, 0, NULL, "ms");
|
||||
lcdDrawText(lcdNextPos+20, y+1, "[Interval]", HEADER_COLOR|SMLSIZE);
|
||||
lcdDrawNumber(lcdNextPos+5, y, 10*maxLuaDuration, LEFT, 0, NULL, "ms");
|
||||
y += FH;
|
||||
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP+line*FH, "Lua interval");
|
||||
lcdDrawNumber(MENU_STATS_COLUMN1, MENU_CONTENT_TOP+line*FH, 10*maxLuaInterval, LEFT, 0, NULL, "ms");
|
||||
++line;
|
||||
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP+line*FH, "Lua memory");
|
||||
lcdDrawText(MENU_STATS_COLUMN1, MENU_CONTENT_TOP+line*FH+1, "[S]", HEADER_COLOR|SMLSIZE);
|
||||
lcdDrawNumber(lcdNextPos+5, MENU_CONTENT_TOP+line*FH, luaGetMemUsed(lsScripts), LEFT);
|
||||
lcdDrawText(lcdNextPos+20, MENU_CONTENT_TOP+line*FH+1, "[W]", HEADER_COLOR|SMLSIZE);
|
||||
lcdDrawNumber(lcdNextPos+5, MENU_CONTENT_TOP+line*FH, luaGetMemUsed(lsWidgets), LEFT);
|
||||
lcdDrawText(lcdNextPos+20, MENU_CONTENT_TOP+line*FH+1, "[B]", HEADER_COLOR|SMLSIZE);
|
||||
lcdDrawNumber(lcdNextPos+5, MENU_CONTENT_TOP+line*FH, luaExtraMemoryUsage, LEFT);
|
||||
++line;
|
||||
// lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP+line*FH, "Lua memory");
|
||||
lcdDrawText(MENU_STATS_COLUMN1, y+1, "[S]", HEADER_COLOR|SMLSIZE);
|
||||
lcdDrawNumber(lcdNextPos+5, y, luaGetMemUsed(lsScripts), LEFT);
|
||||
lcdDrawText(lcdNextPos+20, y+1, "[W]", HEADER_COLOR|SMLSIZE);
|
||||
lcdDrawNumber(lcdNextPos+5, y, luaGetMemUsed(lsWidgets), LEFT);
|
||||
lcdDrawText(lcdNextPos+20, y+1, "[B]", HEADER_COLOR|SMLSIZE);
|
||||
lcdDrawNumber(lcdNextPos+5, y, luaExtraMemoryUsage, LEFT);
|
||||
y += FH;
|
||||
#endif
|
||||
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP+line*FH, "Tlm RX Errs");
|
||||
lcdDrawNumber(MENU_STATS_COLUMN1, MENU_CONTENT_TOP+line*FH, telemetryErrors, LEFT);
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_TMIXMAXMS);
|
||||
lcdDrawNumber(MENU_STATS_COLUMN1, y, DURATION_MS_PREC2(maxMixerDuration), PREC2|LEFT, 0, NULL, "ms");
|
||||
y += FH;
|
||||
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_FREE_STACK);
|
||||
lcdDrawText(MENU_STATS_COLUMN1, y+1, "[Menus]", HEADER_COLOR|SMLSIZE);
|
||||
lcdDrawNumber(lcdNextPos+5, y, menusStack.available(), LEFT);
|
||||
lcdDrawText(lcdNextPos+20, y+1, "[Mix]", HEADER_COLOR|SMLSIZE);
|
||||
lcdDrawNumber(lcdNextPos+5, y, mixerStack.available(), LEFT);
|
||||
lcdDrawText(lcdNextPos+20, y+1, "[Audio]", HEADER_COLOR|SMLSIZE);
|
||||
lcdDrawNumber(lcdNextPos+5, y, audioStack.available(), LEFT);
|
||||
y += FH;
|
||||
|
||||
#if defined(STM32)
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_RTC_BATT);
|
||||
drawValueWithUnit(MENU_STATS_COLUMN1, y, getRTCBatteryVoltage(), UNIT_VOLTS, PREC2|LEFT);
|
||||
y += FH;
|
||||
#endif
|
||||
|
||||
//#if defined(STM32)
|
||||
// lcdDrawText(MENUS_MARGIN_LEFT, y, STR_CPU_TEMP);
|
||||
// drawValueWithUnit(MENU_STATS_COLUMN1, y, getTemperature(), UNIT_TEMPERATURE, PREC1|LEFT);
|
||||
// y += FH;
|
||||
//#endif
|
||||
|
||||
#if defined(DISK_CACHE)
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, y, "SD cache hits");
|
||||
lcdDrawNumber(MENU_STATS_COLUMN1, y, diskCache.getHitRate(), PREC1|LEFT, 0, NULL, "%");
|
||||
y += FH;
|
||||
#endif
|
||||
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, y, "Telem RX Errs");
|
||||
lcdDrawNumber(MENU_STATS_COLUMN1, y, telemetryErrors, LEFT);
|
||||
// y += FH;
|
||||
|
||||
lcdDrawText(LCD_W/2, MENU_FOOTER_TOP, STR_MENUTORESET, MENU_TITLE_COLOR | CENTERED);
|
||||
return true;
|
||||
|
||||
@@ -54,7 +54,7 @@ void insertExpo(uint8_t idx)
|
||||
ExpoData * expo = expoAddress(idx);
|
||||
memmove(expo+1, expo, (MAX_EXPOS-(idx+1))*sizeof(ExpoData));
|
||||
memclear(expo, sizeof(ExpoData));
|
||||
expo->srcRaw = (s_currCh > 4 ? MIXSRC_Rud - 1 + s_currCh : MIXSRC_Rud - 1 + channel_order(s_currCh));
|
||||
expo->srcRaw = (s_currCh > 4 ? MIXSRC_Rud - 1 + s_currCh : MIXSRC_Rud - 1 + channelOrder(s_currCh));
|
||||
expo->curve.type = CURVE_REF_EXPO;
|
||||
expo->mode = 3; // pos+neg
|
||||
expo->chn = s_currCh - 1;
|
||||
|
||||
@@ -65,7 +65,7 @@ void insertMix(uint8_t idx)
|
||||
mix->destCh = s_currCh-1;
|
||||
mix->srcRaw = s_currCh;
|
||||
if (!isSourceAvailable(mix->srcRaw)) {
|
||||
mix->srcRaw = (s_currCh > 4 ? MIXSRC_Rud - 1 + s_currCh : MIXSRC_Rud - 1 + channel_order(s_currCh));
|
||||
mix->srcRaw = (s_currCh > 4 ? MIXSRC_Rud - 1 + s_currCh : MIXSRC_Rud - 1 + channelOrder(s_currCh));
|
||||
while (!isSourceAvailable(mix->srcRaw)) {
|
||||
mix->srcRaw += 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user