Skip to content

Commit

Permalink
Added backlight on RX menu option "BLT RX"
Browse files Browse the repository at this point in the history
  • Loading branch information
OneOfEleven committed Oct 3, 2023
1 parent ac05207 commit 84e1745
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 5 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions app/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
9 changes: 9 additions & 0 deletions app/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions board.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Binary file modified firmware.bin
Binary file not shown.
Binary file modified firmware.packed.bin
Binary file not shown.
2 changes: 2 additions & 0 deletions misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
4 changes: 3 additions & 1 deletion ui/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions ui/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ enum
MENU_SAVE,
MENU_VOX,
MENU_ABR,
MENU_ABR_ON_RX,
MENU_TDR,
MENU_BEEP,
#ifdef ENABLE_VOICE
Expand Down

0 comments on commit 84e1745

Please sign in to comment.