diff --git a/ui/main.c b/ui/main.c index 6c20ec30c..5cfbd129d 100644 --- a/ui/main.c +++ b/ui/main.c @@ -341,10 +341,10 @@ void UI_DisplayMain(void) const unsigned int line0 = 0; // text screen line const unsigned int line1 = 4; const unsigned int line = (vfo_num == 0) ? line0 : line1; - const bool isMainVFO = (vfo_num == gEeprom.TX_VFO); + const bool isMainVFO = (vfo_num == gEeprom.TX_VFO); uint8_t *p_line0 = gFrameBuffer[line + 0]; uint8_t *p_line1 = gFrameBuffer[line + 1]; - unsigned int mode = 0; + enum Vfo_txtr_mode mode = VFO_MODE_NONE; if (activeTxVFO != vfo_num) // this is not active TX VFO { @@ -426,13 +426,13 @@ void UI_DisplayMain(void) #ifdef ENABLE_ALARM if (gAlarmState == ALARM_STATE_SITE_ALARM) - mode = 2; + mode = VFO_MODE_RX; else #endif { if (activeTxVFO == vfo_num) { // show the TX symbol - mode = 1; + mode = VFO_MODE_TX; #ifdef ENABLE_SMALL_BOLD UI_PrintStringSmallBold("TX", 14, 0, line); #else @@ -443,7 +443,7 @@ void UI_DisplayMain(void) } else { // receiving .. show the RX symbol - mode = 2; + mode = VFO_MODE_RX; if ((gCurrentFunction == FUNCTION_RECEIVE || gCurrentFunction == FUNCTION_MONITOR || gCurrentFunction == FUNCTION_INCOMING) && @@ -643,7 +643,7 @@ void UI_DisplayMain(void) { // show the TX/RX level uint8_t Level = 0; - if (mode == 1) + if (mode == VFO_MODE_TX) { // TX power level switch (gRxVfo->OUTPUT_POWER) { @@ -653,7 +653,7 @@ void UI_DisplayMain(void) } } else - if (mode == 2) + if (mode == VFO_MODE_RX) { // RX signal level #ifndef ENABLE_RSSI_BAR // bar graph @@ -674,7 +674,7 @@ void UI_DisplayMain(void) const ModulationMode_t mod = gEeprom.VfoInfo[vfo_num].Modulation; switch (mod){ case MODULATION_FM: { - const FREQ_Config_t *pConfig = (mode == 1) ? gEeprom.VfoInfo[vfo_num].pTX : gEeprom.VfoInfo[vfo_num].pRX; + const FREQ_Config_t *pConfig = (mode == VFO_MODE_TX) ? gEeprom.VfoInfo[vfo_num].pTX : gEeprom.VfoInfo[vfo_num].pRX; const unsigned int code_type = pConfig->CodeType; const char *code_list[] = {"", "CT", "DCS", "DCR"}; if (code_type < ARRAY_SIZE(code_list)) diff --git a/ui/main.h b/ui/main.h index 4538c51ef..f651ec6b9 100644 --- a/ui/main.h +++ b/ui/main.h @@ -26,6 +26,13 @@ enum center_line_t { CENTER_LINE_DTMF_DEC, CENTER_LINE_CHARGE_DATA }; + +enum Vfo_txtr_mode{ + VFO_MODE_NONE = 0, + VFO_MODE_TX = 1, + VFO_MODE_RX = 2, +}; + typedef enum center_line_t center_line_t; extern center_line_t center_line; @@ -36,4 +43,3 @@ void UI_MAIN_TimeSlice500ms(void); void UI_DisplayMain(void); #endif -