Add MainOnly Action

This commit is contained in:
Armel FAUVEAU
2024-06-11 04:54:48 +02:00
parent debf2e6d8a
commit f1aab18c5c
5 changed files with 33 additions and 3 deletions

View File

@@ -107,6 +107,7 @@ void (*action_opt_table[])(void) = {
#ifdef ENABLE_FEAT_F4HWN
[ACTION_OPT_RXMODE] = &ACTION_RxMode,
[ACTION_OPT_MAINONLY] = &ACTION_MainOnly,
[ACTION_OPT_PTT] = &ACTION_Ptt,
[ACTION_OPT_WN] = &ACTION_Wn,
[ACTION_OPT_BACKLIGHT] = &ACTION_BackLight,
@@ -470,11 +471,37 @@ void ACTION_RxMode(void)
switch(cycle) {
case 0:
gEeprom.DUAL_WATCH = (gEeprom.DUAL_WATCH == 0) ? 1 : 0;
gEeprom.DUAL_WATCH = !gEeprom.DUAL_WATCH;
cycle = 1;
break;
case 1:
gEeprom.CROSS_BAND_RX_TX = (gEeprom.CROSS_BAND_RX_TX == 0) ? 1 : 0;
gEeprom.CROSS_BAND_RX_TX = !gEeprom.CROSS_BAND_RX_TX;
cycle = 0;
break;
}
gFlagReconfigureVfos = true;
gUpdateStatus = true;
}
void ACTION_MainOnly(void)
{
static bool cycle = 0;
static uint8_t dw = 0;
static uint8_t cb = 0;
switch(cycle) {
case 0:
dw = gEeprom.DUAL_WATCH;
cb = gEeprom.CROSS_BAND_RX_TX;
gEeprom.DUAL_WATCH = 0;
gEeprom.CROSS_BAND_RX_TX = 0;
cycle = 1;
break;
case 1:
gEeprom.DUAL_WATCH = dw;
gEeprom.CROSS_BAND_RX_TX = cb;
cycle = 0;
break;
}

View File

@@ -37,6 +37,7 @@ void ACTION_SwitchDemodul(void);
#ifdef ENABLE_FEAT_F4HWN
void ACTION_RxMode(void);
void ACTION_MainOnly(void);
void ACTION_Ptt(void);
void ACTION_Wn(void);
void ACTION_BackLightOnDemand(void);

2
misc.h
View File

@@ -167,6 +167,7 @@ extern enum BacklightOnRxTx_t gSetting_backlight_on_tx_rx;
extern bool gSetting_set_met;
extern bool gSetting_set_gui;
extern bool gSetting_set_ptt_session;
extern uint8_t gDebug;
#endif
#ifdef ENABLE_AUDIO_BAR
@@ -350,7 +351,6 @@ extern volatile uint8_t boot_counter_10ms;
extern uint8_t gBacklightBrightnessOld;
extern uint8_t gPttOnePushCounter;
extern uint32_t gBlinkCounter;
extern uint8_t gDebug;
#endif
int32_t NUMBER_AddWithWraparound(int32_t Base, int32_t Add, int32_t LowerLimit, int32_t UpperLimit);

View File

@@ -100,6 +100,7 @@ enum ACTION_OPT_t {
ACTION_OPT_BLMIN_TMP_OFF, //BackLight Minimum Temporay OFF
#ifdef ENABLE_FEAT_F4HWN
ACTION_OPT_RXMODE,
ACTION_OPT_MAINONLY,
ACTION_OPT_PTT,
ACTION_OPT_WN,
ACTION_OPT_BACKLIGHT,

View File

@@ -402,6 +402,7 @@ const t_sidefunction gSubMenu_SIDEFUNCTIONS[] =
#endif
#ifdef ENABLE_FEAT_F4HWN
{"RX MODE", ACTION_OPT_RXMODE},
{"MAIN ONLY", ACTION_OPT_MAINONLY},
{"PTT", ACTION_OPT_PTT},
{"WIDE\nNARROW", ACTION_OPT_WN},
#endif