diff --git a/radio/src/gui/menu_model.cpp b/radio/src/gui/menu_model.cpp index 8b04d7218..06bb8a6a7 100644 --- a/radio/src/gui/menu_model.cpp +++ b/radio/src/gui/menu_model.cpp @@ -953,7 +953,7 @@ void menuModelSetup(uint8_t event) #define PORT_CHANNELS_ROWS(x) (x==0 ? PORT1_CHANNELS_ROWS() : (x==1 ? PORT2_CHANNELS_ROWS() : TRAINER_CHANNELS_ROWS())) #define FAILSAFE_ROWS(x) ((g_model.moduleData[x].rfProtocol==RF_PROTO_X16 || g_model.moduleData[x].rfProtocol==RF_PROTO_LR12) ? (g_model.moduleData[x].failsafeMode==FAILSAFE_CUSTOM ? (uint8_t)1 : (uint8_t)0) : HIDDEN_ROW) #define MODEL_SETUP_MAX_LINES (1+ITEM_MODEL_SETUP_MAX) - #define POT_WARN_ITEMS() (((g_model.nPotsToWarn >> 6) == 2) ? NUM_POTS+1 : ((g_model.nPotsToWarn >> 6) == 1) ? NUM_POTS : 0) + #define POT_WARN_ITEMS() (g_model.nPotsToWarn ? NUM_POTS : 0) bool CURSOR_ON_CELL = (m_posHorz >= 0); MENU_TAB({ 0, 0, CASE_PCBTARANIS(0) 2, IF_PERSISTENT_TIMERS(0) 0, 0, 2, IF_PERSISTENT_TIMERS(0) 0, 0, 0, 1, 0, 0, 0, 0, 0, 7, POT_WARN_ITEMS(), NAVIGATION_LINE_BY_LINE|(NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS-1), LABEL(InternalModule), 0, IF_PORT1_ON(1), IF_PORT1_ON(IS_D8_RX(0) ? (uint8_t)1 : (uint8_t)2), IF_PORT1_ON(FAILSAFE_ROWS(0)), LABEL(ExternalModule), (g_model.externalModule==MODULE_TYPE_XJT || IS_MODULE_DSM2(EXTERNAL_MODULE)) ? (uint8_t)1 : (uint8_t)0, PORT2_CHANNELS_ROWS(), (IS_MODULE_XJT(1) && IS_D8_RX(1)) ? (uint8_t)1 : (IS_MODULE_PPM(1) || IS_MODULE_XJT(1) || IS_MODULE_DSM2(1)) ? (uint8_t)2 : HIDDEN_ROW, IF_PORT2_XJT(FAILSAFE_ROWS(1)), LABEL(Trainer), 0, TRAINER_CHANNELS_ROWS(), IF_TRAINER_ON(2)}); @@ -1219,33 +1219,37 @@ void menuModelSetup(uint8_t event) { lcd_putsLeft(y, "Pot Warning"); uint8_t potMode = g_model.nPotsToWarn >> 6; + if(attr) { + if (m_posHorz) s_editMode = 0; + if (!READ_ONLY() && m_posHorz) { + switch(event) { + case EVT_KEY_LONG(KEY_ENTER): + killEvents(event); + g_model.potPosition[m_posHorz-1] = getValue(MIXSRC_FIRST_POT+m_posHorz-1) >> 3; + AUDIO_WARNING1(); + eeDirty(EE_MODEL); + break; + case EVT_KEY_BREAK(KEY_ENTER): + g_model.nPotsToWarn ^= (1 << (m_posHorz-1)); + eeDirty(EE_MODEL); + break; + } + } + } + lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN, y, PSTR("\004""Off\0""Auto""Man\0"), potMode, attr & ((m_posHorz == 0) ? attr : !INVERS)); if (potMode) for (uint8_t i=0; i> 3; - AUDIO_WARNING1(); - } - } - else if (attr) { - s_editMode = 0; - if (event == EVT_KEY_BREAK(KEY_ENTER)) - g_model.nPotsToWarn ^= (1 << (m_posHorz-1)); - } break; } #endif diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 267f2919b..853c7d7b8 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -2193,6 +2193,13 @@ void checkSwitches() warn = true; } } + + perOut(e_perout_mode_inactive_phase, 0); + uint8_t potMode = g_model.nPotsToWarn >> 6; + if(potMode) + for (uint8_t i=0; i> 3)) > 2)) + warn = true; #else for (uint8_t i=0; i> (i*2)]; - lcd_putcAtt(60+i*(2*FW+FW/2), 5*FH, 'A'+i, attr); - lcd_putcAtt(60+i*(2*FW+FW/2)+FW, 5*FH, c, attr); + lcd_putcAtt(60+i*(2*FW+FW/2), 4*FH+3, 'A'+i, attr); + lcd_putcAtt(60+i*(2*FW+FW/2)+FW, 4*FH+3, c, attr); } } + for (uint8_t i=0; i> 3)) > 2) { + lcd_putc(60+i*(5*FW)+2*FW+2, 6*FH-2, g_model.potPosition[i] > (getValue(MIXSRC_FIRST_POT+i) >> 3) ? 127 : 126); + flags = INVERS; + } + lcd_putsiAtt(60+i*(5*FW), 6*FH-2, STR_VSRCRAW, NUM_STICKS+1+i, flags); + } + } #else uint8_t x = 2; for (uint8_t i=1; i> 6) == 1) { + for (uint8_t i=0; i> 3; + eeDirty(EE_MODEL); + } +#endif + saveTimers(); #if defined(PCBSKY9X)