Revert fix bug on SWITCH MAIN ONLY

This commit is contained in:
Armel FAUVEAU
2024-02-08 01:48:18 +01:00
parent 1b6528fe05
commit 186ea416bf
6 changed files with 29 additions and 48 deletions

View File

@@ -458,7 +458,7 @@ void ACTION_Main(void)
static uint8_t b; static uint8_t b;
if(gSetting_set_dual_watch_session == 0 && gSetting_set_cross_band_RX_TX_session == 0 && cycle != 1) if(gEeprom.DUAL_WATCH == 0 && gEeprom.CROSS_BAND_RX_TX == 0 && cycle != 1)
{ {
return; return;
} }
@@ -466,11 +466,11 @@ void ACTION_Main(void)
{ {
if(cycle == 0) if(cycle == 0)
{ {
a = gSetting_set_dual_watch_session; a = gEeprom.DUAL_WATCH;
b = gSetting_set_cross_band_RX_TX_session; b = gEeprom.CROSS_BAND_RX_TX;
gSetting_set_dual_watch_session = 0; gEeprom.DUAL_WATCH = 0;
gSetting_set_cross_band_RX_TX_session = 0; gEeprom.CROSS_BAND_RX_TX = 0;
gFlagReconfigureVfos = true; gFlagReconfigureVfos = true;
gUpdateStatus = true; gUpdateStatus = true;
@@ -479,8 +479,8 @@ void ACTION_Main(void)
} }
else else
{ {
gSetting_set_dual_watch_session = a; gEeprom.DUAL_WATCH = a;
gSetting_set_cross_band_RX_TX_session = b; gEeprom.CROSS_BAND_RX_TX = b;
gFlagReconfigureVfos = true; gFlagReconfigureVfos = true;
gUpdateStatus = true; gUpdateStatus = true;

View File

@@ -568,12 +568,6 @@ void MENU_AcceptSetting(void)
case MENU_TDR: case MENU_TDR:
gEeprom.DUAL_WATCH = (gEeprom.TX_VFO + 1) * (gSubMenuSelection & 1); gEeprom.DUAL_WATCH = (gEeprom.TX_VFO + 1) * (gSubMenuSelection & 1);
gEeprom.CROSS_BAND_RX_TX = (gEeprom.TX_VFO + 1) * ((gSubMenuSelection & 2) > 0); gEeprom.CROSS_BAND_RX_TX = (gEeprom.TX_VFO + 1) * ((gSubMenuSelection & 2) > 0);
#ifdef ENABLE_FEAT_F4HWN
// Special for actions
gSetting_set_dual_watch_session = gEeprom.DUAL_WATCH;
gSetting_set_cross_band_RX_TX_session = gEeprom.CROSS_BAND_RX_TX;
#endif
gFlagReconfigureVfos = true; gFlagReconfigureVfos = true;
gUpdateStatus = true; gUpdateStatus = true;
break; break;
@@ -1007,11 +1001,7 @@ void MENU_ShowCurrentSetting(void)
break; break;
case MENU_TDR: case MENU_TDR:
#ifdef ENABLE_FEAT_F4HWN
gSubMenuSelection = (gSetting_set_dual_watch_session != DUAL_WATCH_OFF) + (gSetting_set_cross_band_RX_TX_session != CROSS_BAND_OFF) * 2;
#else
gSubMenuSelection = (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) + (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF) * 2; gSubMenuSelection = (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) + (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF) * 2;
#endif
break; break;
case MENU_BEEP: case MENU_BEEP:

2
misc.c
View File

@@ -102,8 +102,6 @@ enum BacklightOnRxTx_t gSetting_backlight_on_tx_rx;
uint8_t gSetting_set_ctr = 11; uint8_t gSetting_set_ctr = 11;
bool gSetting_set_inv = false; bool gSetting_set_inv = false;
bool gSetting_set_ptt_session; bool gSetting_set_ptt_session;
uint8_t gSetting_set_dual_watch_session;
uint8_t gSetting_set_cross_band_RX_TX_session;
#endif #endif
#ifdef ENABLE_AUDIO_BAR #ifdef ENABLE_AUDIO_BAR

2
misc.h
View File

@@ -163,8 +163,6 @@ extern enum BacklightOnRxTx_t gSetting_backlight_on_tx_rx;
extern uint8_t gSetting_set_ctr; extern uint8_t gSetting_set_ctr;
extern bool gSetting_set_inv; extern bool gSetting_set_inv;
extern bool gSetting_set_ptt_session; extern bool gSetting_set_ptt_session;
extern uint8_t gSetting_set_dual_watch_session;
extern uint8_t gSetting_set_cross_band_RX_TX_session;
#endif #endif
#ifdef ENABLE_AUDIO_BAR #ifdef ENABLE_AUDIO_BAR

View File

@@ -304,8 +304,6 @@ void SETTINGS_InitEEPROM(void)
// And set special session settings for actions // And set special session settings for actions
gSetting_set_ptt_session = gSetting_set_ptt; gSetting_set_ptt_session = gSetting_set_ptt;
gSetting_set_dual_watch_session = gEeprom.DUAL_WATCH;
gSetting_set_cross_band_RX_TX_session = gEeprom.CROSS_BAND_RX_TX;
#endif #endif
} }

View File

@@ -159,7 +159,7 @@ void UI_DisplayAudioBar(void)
#ifdef ENABLE_FEAT_F4HWN #ifdef ENABLE_FEAT_F4HWN
unsigned int line; unsigned int line;
if ((gSetting_set_dual_watch_session != DUAL_WATCH_OFF) + (gSetting_set_cross_band_RX_TX_session != CROSS_BAND_OFF) * 2 == 0) if ((gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) + (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF) * 2 == 0)
{ {
line = 5; line = 5;
} }
@@ -228,7 +228,7 @@ void DisplayRSSIBar(const bool now)
}; };
unsigned int line; unsigned int line;
if ((gSetting_set_dual_watch_session != DUAL_WATCH_OFF) + (gSetting_set_cross_band_RX_TX_session != CROSS_BAND_OFF) * 2 == 0) if ((gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) + (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF) * 2 == 0)
{ {
line = 5; line = 5;
} }
@@ -472,7 +472,7 @@ void UI_DisplayMain(void)
const unsigned int line0 = 0; // text screen line const unsigned int line0 = 0; // text screen line
const unsigned int line1 = 4; const unsigned int line1 = 4;
unsigned int line; unsigned int line;
if ((gSetting_set_dual_watch_session != DUAL_WATCH_OFF) + (gSetting_set_cross_band_RX_TX_session != CROSS_BAND_OFF) * 2 == 0) if ((gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) + (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF) * 2 == 0)
{ {
line = 0; line = 0;
} }
@@ -495,7 +495,7 @@ void UI_DisplayMain(void)
#endif #endif
#ifdef ENABLE_FEAT_F4HWN #ifdef ENABLE_FEAT_F4HWN
if ((gSetting_set_dual_watch_session != DUAL_WATCH_OFF) + (gSetting_set_cross_band_RX_TX_session != CROSS_BAND_OFF) * 2 == 0) if ((gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) + (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF) * 2 == 0)
{ {
if (activeTxVFO != vfo_num) if (activeTxVFO != vfo_num)
{ {
@@ -505,7 +505,7 @@ void UI_DisplayMain(void)
#endif #endif
#ifdef ENABLE_FEAT_F4HWN #ifdef ENABLE_FEAT_F4HWN
if (activeTxVFO != vfo_num || ((gSetting_set_dual_watch_session != DUAL_WATCH_OFF) + (gSetting_set_cross_band_RX_TX_session != CROSS_BAND_OFF) * 2 == 0)) if (activeTxVFO != vfo_num || ((gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) + (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF) * 2 == 0))
#else #else
if (activeTxVFO != vfo_num) // this is not active TX VFO if (activeTxVFO != vfo_num) // this is not active TX VFO
#endif #endif
@@ -562,7 +562,7 @@ void UI_DisplayMain(void)
} }
#ifdef ENABLE_FEAT_F4HWN #ifdef ENABLE_FEAT_F4HWN
if ((gSetting_set_dual_watch_session != DUAL_WATCH_OFF) + (gSetting_set_cross_band_RX_TX_session != CROSS_BAND_OFF) * 2 == 0) if ((gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) + (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF) * 2 == 0)
{ {
UI_PrintString(pPrintStr, 2, 0, 5, 8); UI_PrintString(pPrintStr, 2, 0, 5, 8);
isMainOnlyInputDTMF = true; isMainOnlyInputDTMF = true;
@@ -767,7 +767,7 @@ void UI_DisplayMain(void)
} }
else { else {
#ifdef ENABLE_FEAT_F4HWN #ifdef ENABLE_FEAT_F4HWN
if ((gSetting_set_dual_watch_session != DUAL_WATCH_OFF) + (gSetting_set_cross_band_RX_TX_session != CROSS_BAND_OFF) * 2 == 0) if ((gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) + (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF) * 2 == 0)
{ {
UI_PrintString(String, 32, 0, line, 8); UI_PrintString(String, 32, 0, line, 8);
} }
@@ -786,7 +786,7 @@ void UI_DisplayMain(void)
#endif #endif
#ifdef ENABLE_FEAT_F4HWN #ifdef ENABLE_FEAT_F4HWN
if ((gSetting_set_dual_watch_session != DUAL_WATCH_OFF) + (gSetting_set_cross_band_RX_TX_session != CROSS_BAND_OFF) * 2 == 0) if ((gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) + (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF) * 2 == 0)
{ {
sprintf(String, "%3u.%05u", frequency / 100000, frequency % 100000); sprintf(String, "%3u.%05u", frequency / 100000, frequency % 100000);
if(frequency < _1GHz_in_KHz) { if(frequency < _1GHz_in_KHz) {
@@ -801,8 +801,6 @@ void UI_DisplayMain(void)
// show the frequency in the main font // show the frequency in the main font
UI_PrintString(String, 32, 0, line + 3, 8); UI_PrintString(String, 32, 0, line + 3, 8);
} }
//sprintf(String, "SQL %d", gEeprom.SQUELCH_LEVEL);
//UI_PrintStringSmallNormal(String, 46, 0, 6);
} }
else else
{ {
@@ -925,25 +923,23 @@ void UI_DisplayMain(void)
UI_PrintStringSmallNormal("DTMF", LCD_WIDTH + 78, 0, line + 1); UI_PrintStringSmallNormal("DTMF", LCD_WIDTH + 78, 0, line + 1);
#endif #endif
#ifndef ENABLE_FEAT_F4HWN
// show the audio scramble symbol // show the audio scramble symbol
if (vfoInfo->SCRAMBLING_TYPE > 0 && gSetting_ScrambleEnable) if (vfoInfo->SCRAMBLING_TYPE > 0 && gSetting_ScrambleEnable)
UI_PrintStringSmallNormal("SCR", LCD_WIDTH + 106, 0, line + 1); UI_PrintStringSmallNormal("SCR", LCD_WIDTH + 106, 0, line + 1);
#endif
#ifdef ENABLE_FEAT_F4HWN #ifdef ENABLE_FEAT_F4HWN
if(isMainVFO) if(isMainVFO)
{ {
sprintf(String, "SQL %d", gEeprom.SQUELCH_LEVEL); sprintf(String, "SQL %d", gEeprom.SQUELCH_LEVEL);
if ((gSetting_set_dual_watch_session != DUAL_WATCH_OFF) + (gSetting_set_cross_band_RX_TX_session != CROSS_BAND_OFF) * 2 == 0) if ((gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) + (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF) * 2 == 0)
{ {
UI_PrintStringSmallNormal(String, 90, 0, 2); UI_PrintStringSmallNormal(String, 90, 0, 2);
} }
else else
{ {
UI_PrintStringSmallNormal(String, 90, 0, line + 2); UI_PrintStringSmallNormal(String, 90, 0, line + 2);
} }
} }
#endif #endif
} }
@@ -1008,7 +1004,7 @@ void UI_DisplayMain(void)
sprintf(String, "DTMF %s", gDTMF_RX_live + idx); sprintf(String, "DTMF %s", gDTMF_RX_live + idx);
#ifdef ENABLE_FEAT_F4HWN #ifdef ENABLE_FEAT_F4HWN
if ((gSetting_set_dual_watch_session != DUAL_WATCH_OFF) + (gSetting_set_cross_band_RX_TX_session != CROSS_BAND_OFF) * 2 == 0) if ((gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) + (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF) * 2 == 0)
{ {
UI_PrintStringSmallNormal(String, 2, 0, 5); UI_PrintStringSmallNormal(String, 2, 0, 5);
} }
@@ -1058,6 +1054,7 @@ void UI_DisplayMain(void)
#endif #endif
} }
} }
ST7565_BlitFullScreen(); ST7565_BlitFullScreen();
} }