Improve RxMode and MainOnly action
This commit is contained in:
13
app/action.c
13
app/action.c
@@ -465,6 +465,13 @@ void ACTION_BlminTmpOff(void)
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
void ACTION_Update(void)
|
||||
{
|
||||
gSaveRxMode = false;
|
||||
gFlagReconfigureVfos = true;
|
||||
gUpdateStatus = true;
|
||||
}
|
||||
|
||||
void ACTION_RxMode(void)
|
||||
{
|
||||
static bool cycle = 0;
|
||||
@@ -480,8 +487,7 @@ void ACTION_RxMode(void)
|
||||
break;
|
||||
}
|
||||
|
||||
gFlagReconfigureVfos = true;
|
||||
gUpdateStatus = true;
|
||||
ACTION_Update();
|
||||
}
|
||||
|
||||
void ACTION_MainOnly(void)
|
||||
@@ -506,8 +512,7 @@ void ACTION_MainOnly(void)
|
||||
break;
|
||||
}
|
||||
|
||||
gFlagReconfigureVfos = true;
|
||||
gUpdateStatus = true;
|
||||
ACTION_Update();
|
||||
}
|
||||
|
||||
void ACTION_Ptt(void)
|
||||
|
@@ -583,6 +583,13 @@ void MENU_AcceptSetting(void)
|
||||
case MENU_TDR:
|
||||
gEeprom.DUAL_WATCH = (gEeprom.TX_VFO + 1) * (gSubMenuSelection & 1);
|
||||
gEeprom.CROSS_BAND_RX_TX = (gEeprom.TX_VFO + 1) * ((gSubMenuSelection & 2) > 0);
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
gDW = gEeprom.DUAL_WATCH;
|
||||
gCB = gEeprom.CROSS_BAND_RX_TX;
|
||||
gSaveRxMode = true;
|
||||
#endif
|
||||
|
||||
gFlagReconfigureVfos = true;
|
||||
gUpdateStatus = true;
|
||||
break;
|
||||
|
6
main.c
6
main.c
@@ -94,6 +94,12 @@ void Main(void)
|
||||
BOARD_ADC_GetBatteryInfo(&gBatteryCurrentVoltage, &gBatteryCurrent);
|
||||
|
||||
SETTINGS_InitEEPROM();
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
gDW = gEeprom.DUAL_WATCH;
|
||||
gCB = gEeprom.CROSS_BAND_RX_TX;
|
||||
#endif
|
||||
|
||||
SETTINGS_WriteBuildOptions();
|
||||
SETTINGS_LoadCalibration();
|
||||
|
||||
|
3
misc.c
3
misc.c
@@ -116,6 +116,9 @@ enum BacklightOnRxTx_t gSetting_backlight_on_tx_rx;
|
||||
bool gSetting_set_gui = 0;
|
||||
bool gSetting_set_ptt_session;
|
||||
uint8_t gDebug;
|
||||
uint8_t gDW = 0;
|
||||
uint8_t gCB = 0;
|
||||
bool gSaveRxMode = false;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_AUDIO_BAR
|
||||
|
3
misc.h
3
misc.h
@@ -168,6 +168,9 @@ extern enum BacklightOnRxTx_t gSetting_backlight_on_tx_rx;
|
||||
extern bool gSetting_set_gui;
|
||||
extern bool gSetting_set_ptt_session;
|
||||
extern uint8_t gDebug;
|
||||
extern uint8_t gDW;
|
||||
extern uint8_t gCB;
|
||||
extern bool gSaveRxMode;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_AUDIO_BAR
|
||||
|
19
settings.c
19
settings.c
@@ -128,8 +128,10 @@ void SETTINGS_InitEEPROM(void)
|
||||
#endif
|
||||
|
||||
// 0E98..0E9F
|
||||
EEPROM_ReadBuffer(0x0E98, Data, 8);
|
||||
memcpy(&gEeprom.POWER_ON_PASSWORD, Data, 4);
|
||||
#ifdef ENABLE_PWRON_PASSWORD
|
||||
EEPROM_ReadBuffer(0x0E98, Data, 8);
|
||||
memcpy(&gEeprom.POWER_ON_PASSWORD, Data, 4);
|
||||
#endif
|
||||
|
||||
// 0EA0..0EA7
|
||||
EEPROM_ReadBuffer(0x0EA0, Data, 8);
|
||||
@@ -502,7 +504,9 @@ void SETTINGS_SaveVfoIndices(void)
|
||||
void SETTINGS_SaveSettings(void)
|
||||
{
|
||||
uint8_t State[8];
|
||||
uint32_t Password[2];
|
||||
#ifdef ENABLE_PWRON_PASSWORD
|
||||
uint32_t Password[2];
|
||||
#endif
|
||||
|
||||
State[0] = gEeprom.CHAN_1_CALL;
|
||||
State[1] = gEeprom.SQUELCH_LEVEL;
|
||||
@@ -530,6 +534,11 @@ void SETTINGS_SaveSettings(void)
|
||||
State[4] = gEeprom.DUAL_WATCH;
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
if(!gSaveRxMode)
|
||||
{
|
||||
State[2] = gCB;
|
||||
State[4] = gDW;
|
||||
}
|
||||
if(gBackLight)
|
||||
{
|
||||
State[5] = gBacklightTimeOriginal;
|
||||
@@ -557,11 +566,11 @@ void SETTINGS_SaveSettings(void)
|
||||
State[7] = gEeprom.POWER_ON_DISPLAY_MODE;
|
||||
EEPROM_WriteBuffer(0x0E90, State);
|
||||
|
||||
memset(Password, 0xFF, sizeof(Password));
|
||||
#ifdef ENABLE_PWRON_PASSWORD
|
||||
memset(Password, 0xFF, sizeof(Password));
|
||||
Password[0] = gEeprom.POWER_ON_PASSWORD;
|
||||
EEPROM_WriteBuffer(0x0E98, Password);
|
||||
#endif
|
||||
EEPROM_WriteBuffer(0x0E98, Password);
|
||||
|
||||
memset(State, 0xFF, sizeof(State));
|
||||
#ifdef ENABLE_VOICE
|
||||
|
@@ -34,7 +34,6 @@
|
||||
#include "ui/ui.h"
|
||||
#include "ui/status.h"
|
||||
|
||||
|
||||
static void convertTime(uint8_t *line, uint8_t type)
|
||||
{
|
||||
char str[8] = "";
|
||||
|
Reference in New Issue
Block a user