diff --git a/Makefile b/Makefile index cd697715..f4ad3b3c 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,6 @@ ENABLE_AM_FIX := 1 ENABLE_AM_FIX_SHOW_DATA := 1 ENABLE_SQUELCH_MORE_SENSITIVE := 1 ENABLE_FASTER_CHANNEL_SCAN := 0 -ENABLE_BACKLIGHT_ON_RX := 0 ENABLE_RSSI_BAR := 1 ENABLE_AUDIO_BAR := 1 #ENABLE_COPY_CHAN_TO_VFO := 1 diff --git a/README.md b/README.md index 37b61cb9..40be7d38 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,6 @@ ENABLE_AM_FIX := 1 dynamically adjust the front end gains ENABLE_AM_FIX_SHOW_DATA := 1 show debug data for the AM fix (still tweaking it) ENABLE_SQUELCH_MORE_SENSITIVE := 1 make squelch levels a little bit more sensitive - I plan to let user adjust the values themselves ENABLE_FASTER_CHANNEL_SCAN := 0 increases the channel scan speed, but the squelch is also made more twitchy -ENABLE_BACKLIGHT_ON_RX := 0 turn the backlight on when the squelch opens ENABLE_RSSI_BAR := 1 enable a dBm/Sn RSSI bar graph level inplace of the little antenna symbols ENABLE_AUDIO_BAR := 0 experimental, display an audo bar level when TX'ing #ENABLE_COPY_CHAN_TO_VFO := 1 not yet implemented - copy the current channel into the VFO diff --git a/app/app.c b/app/app.c index cb716175..b457f238 100644 --- a/app/app.c +++ b/app/app.c @@ -486,9 +486,8 @@ void APP_StartListening(FUNCTION_Type_t Function, const bool reset_am_fix) gEnableSpeaker = true; - #ifdef ENABLE_BACKLIGHT_ON_RX + if (gSetting_backlight_on_rx) BACKLIGHT_TurnOn(); - #endif if (gScanState != SCAN_OFF) { diff --git a/app/menu.c b/app/menu.c index 8f4ef1ff..edde4a03 100644 --- a/app/menu.c +++ b/app/menu.c @@ -212,6 +212,7 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax) #ifdef ENABLE_AUDIO_BAR case MENU_MIC_BAR: #endif + case MENU_ABR_ON_RX: case MENU_BCL: case MENU_BEEP: case MENU_AUTOLK: @@ -504,6 +505,10 @@ void MENU_AcceptSetting(void) gEeprom.BACKLIGHT = gSubMenuSelection; break; + case MENU_ABR_ON_RX: + gSetting_backlight_on_rx = gSubMenuSelection; + break; + case MENU_TDR: gEeprom.DUAL_WATCH = gSubMenuSelection; gFlagReconfigureVfos = true; @@ -916,6 +921,10 @@ void MENU_ShowCurrentSetting(void) GPIO_SetBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn the backlight ON while in backlight menu break; + case MENU_ABR_ON_RX: + gSubMenuSelection = gSetting_backlight_on_rx; + break; + case MENU_TDR: gSubMenuSelection = gEeprom.DUAL_WATCH; break; diff --git a/board.c b/board.c index 2b5f729d..2a9ca2c4 100644 --- a/board.c +++ b/board.c @@ -712,6 +712,7 @@ void BOARD_EEPROM_Init(void) #ifdef ENABLE_AM_FIX gSetting_AM_fix = (Data[7] & (1u << 5)) ? true : false; #endif + gSetting_backlight_on_rx = (Data[7] & (1u << 6)) ? true : false; if (!gEeprom.VFO_OPEN) { diff --git a/firmware.bin b/firmware.bin index 23755e4b..7b670ec3 100644 Binary files a/firmware.bin and b/firmware.bin differ diff --git a/firmware.packed.bin b/firmware.packed.bin index 2aaed792..375e12cc 100644 Binary files a/firmware.packed.bin and b/firmware.packed.bin differ diff --git a/misc.c b/misc.c index cbc29e9b..e9fa122d 100644 --- a/misc.c +++ b/misc.c @@ -83,6 +83,8 @@ bool gSetting_TX_EN; uint8_t gSetting_F_LOCK; bool gSetting_ScrambleEnable; +bool gSetting_backlight_on_rx; + #ifdef ENABLE_AM_FIX bool gSetting_AM_fix; #endif diff --git a/misc.h b/misc.h index bc58fe85..f229649d 100644 --- a/misc.h +++ b/misc.h @@ -152,6 +152,8 @@ extern bool gSetting_TX_EN; extern uint8_t gSetting_F_LOCK; extern bool gSetting_ScrambleEnable; +extern bool gSetting_backlight_on_rx; + #ifdef ENABLE_AM_FIX extern bool gSetting_AM_fix; #endif diff --git a/settings.c b/settings.c index 207e0c6e..aa60e2d3 100644 --- a/settings.c +++ b/settings.c @@ -174,6 +174,8 @@ void SETTINGS_SaveSettings(void) #ifdef ENABLE_AM_FIX if (!gSetting_AM_fix) State[7] &= ~(1u << 5); #endif + if (!gSetting_backlight_on_rx) State[7] &= ~(1u << 6); + EEPROM_WriteBuffer(0x0F40, State); } diff --git a/ui/menu.c b/ui/menu.c index 4c5ecea0..2c6e51d2 100644 --- a/ui/menu.c +++ b/ui/menu.c @@ -62,7 +62,8 @@ const t_menu_item MenuList[] = {"CH DIS", VOICE_ID_INVALID, MENU_MDF }, // was "MDF" {"BATSAV", VOICE_ID_SAVE_MODE, MENU_SAVE }, // was "SAVE" {"VOX", VOICE_ID_VOX, MENU_VOX }, - {"BACKLT", VOICE_ID_INVALID, MENU_ABR }, // was "ABR" + {"BLT", VOICE_ID_INVALID, MENU_ABR }, // was "ABR" + {"BLT RX", VOICE_ID_INVALID, MENU_ABR_ON_RX }, {"DUALRX", VOICE_ID_DUAL_STANDBY, MENU_TDR }, // was "TDR" {"BEEP", VOICE_ID_BEEP_PROMPT, MENU_BEEP }, #ifdef ENABLE_VOICE @@ -591,6 +592,7 @@ void UI_DisplayMenu(void) #ifdef ENABLE_AM_FIX case MENU_AM_FIX: #endif + case MENU_ABR_ON_RX: case MENU_BCL: case MENU_BEEP: case MENU_S_ADD1: diff --git a/ui/menu.h b/ui/menu.h index f9bf8054..94258445 100644 --- a/ui/menu.h +++ b/ui/menu.h @@ -51,6 +51,7 @@ enum MENU_SAVE, MENU_VOX, MENU_ABR, + MENU_ABR_ON_RX, MENU_TDR, MENU_BEEP, #ifdef ENABLE_VOICE