Improve BackLt (35/63)
This commit is contained in:
@@ -504,7 +504,7 @@ void ACTION_BackLightOnDemand(void)
|
||||
if(gBackLight == false)
|
||||
{
|
||||
gBacklightTimeOriginal = gEeprom.BACKLIGHT_TIME;
|
||||
gEeprom.BACKLIGHT_TIME = 7;
|
||||
gEeprom.BACKLIGHT_TIME = 17;
|
||||
gBackLight = true;
|
||||
}
|
||||
else
|
||||
@@ -515,7 +515,7 @@ void ACTION_BackLightOnDemand(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
gEeprom.BACKLIGHT_TIME = 7;
|
||||
gEeprom.BACKLIGHT_TIME = 17;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1483,7 +1483,7 @@ void APP_TimeSlice500ms(void)
|
||||
// don't turn off backlight if user is in backlight menu option
|
||||
&& !(gScreenToDisplay == DISPLAY_MENU && (UI_MENU_GetCurrentMenuId() == MENU_ABR || UI_MENU_GetCurrentMenuId() == MENU_ABR_MAX))
|
||||
&& --gBacklightCountdown_500ms == 0
|
||||
&& gEeprom.BACKLIGHT_TIME < (ARRAY_SIZE(gSubMenu_BACKLIGHT) - 1)
|
||||
&& gEeprom.BACKLIGHT_TIME < 17
|
||||
) {
|
||||
BACKLIGHT_TurnOff();
|
||||
}
|
||||
|
@@ -129,7 +129,7 @@ int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax)
|
||||
|
||||
case MENU_ABR:
|
||||
//*pMin = 0;
|
||||
*pMax = ARRAY_SIZE(gSubMenu_BACKLIGHT) - 1;
|
||||
*pMax = 17;
|
||||
break;
|
||||
|
||||
case MENU_ABR_MIN:
|
||||
|
@@ -110,17 +110,13 @@ void BACKLIGHT_TurnOn(void)
|
||||
|
||||
switch (gEeprom.BACKLIGHT_TIME) {
|
||||
default:
|
||||
case 1: // 5 sec
|
||||
case 2: // 10 sec
|
||||
case 3: // 20 sec
|
||||
gBacklightCountdown_500ms = 1 + (2 << (gEeprom.BACKLIGHT_TIME - 1)) * 5;
|
||||
case 1 ... 11: // 5 sec * value
|
||||
gBacklightCountdown_500ms = 1 + (gEeprom.BACKLIGHT_TIME * 5) * 2;
|
||||
break;
|
||||
case 4: // 1 min
|
||||
case 5: // 2 min
|
||||
case 6: // 4 min
|
||||
gBacklightCountdown_500ms = 1 + (2 << (gEeprom.BACKLIGHT_TIME - 4)) * 60;
|
||||
case 12 ... 16: // 1 min $ value
|
||||
gBacklightCountdown_500ms = 1 + ((gEeprom.BACKLIGHT_TIME - 11) * 60) * 2;
|
||||
break;
|
||||
case 7: // always on
|
||||
case 17: // always on
|
||||
gBacklightCountdown_500ms = 0;
|
||||
break;
|
||||
}
|
||||
|
@@ -219,7 +219,7 @@ void BATTERY_TimeSlice500ms(void)
|
||||
|
||||
ST7565_HardwareReset();
|
||||
|
||||
if (gEeprom.BACKLIGHT_TIME < (ARRAY_SIZE(gSubMenu_BACKLIGHT) - 1)) {
|
||||
if (gEeprom.BACKLIGHT_TIME < 17) {
|
||||
BACKLIGHT_TurnOff();
|
||||
}
|
||||
}
|
||||
|
2
main.c
2
main.c
@@ -151,7 +151,7 @@ void Main(void)
|
||||
{
|
||||
FUNCTION_Select(FUNCTION_POWER_SAVE);
|
||||
|
||||
if (gEeprom.BACKLIGHT_TIME < (ARRAY_SIZE(gSubMenu_BACKLIGHT) - 1)) // backlight is not set to be always on
|
||||
if (gEeprom.BACKLIGHT_TIME < 17) // backlight is not set to be always on
|
||||
BACKLIGHT_TurnOff(); // turn the backlight OFF
|
||||
else
|
||||
BACKLIGHT_TurnOn(); // turn the backlight ON
|
||||
|
@@ -67,7 +67,7 @@ void SETTINGS_InitEEPROM(void)
|
||||
gEeprom.CROSS_BAND_RX_TX = (Data[2] < 3) ? Data[2] : CROSS_BAND_OFF;
|
||||
gEeprom.BATTERY_SAVE = (Data[3] < 5) ? Data[3] : 4;
|
||||
gEeprom.DUAL_WATCH = (Data[4] < 3) ? Data[4] : DUAL_WATCH_CHAN_A;
|
||||
gEeprom.BACKLIGHT_TIME = (Data[5] < ARRAY_SIZE(gSubMenu_BACKLIGHT)) ? Data[5] : 3;
|
||||
gEeprom.BACKLIGHT_TIME = (Data[5] < 18) ? Data[5] : 3;
|
||||
gEeprom.TAIL_TONE_ELIMINATION = (Data[6] < 2) ? Data[6] : false;
|
||||
gEeprom.VFO_OPEN = (Data[7] < 2) ? Data[7] : true;
|
||||
|
||||
|
30
ui/menu.c
30
ui/menu.c
@@ -312,18 +312,6 @@ const char * const gSubMenu_F_LOCK[] =
|
||||
"UNLOCK\nALL",
|
||||
};
|
||||
|
||||
const char gSubMenu_BACKLIGHT[][7] =
|
||||
{
|
||||
"OFF",
|
||||
"5 sec",
|
||||
"10 sec",
|
||||
"20 sec",
|
||||
"1 min",
|
||||
"2 min",
|
||||
"4 min",
|
||||
"ON"
|
||||
};
|
||||
|
||||
const char gSubMenu_RX_TX[][6] =
|
||||
{
|
||||
"OFF",
|
||||
@@ -668,7 +656,23 @@ void UI_DisplayMenu(void)
|
||||
#endif
|
||||
|
||||
case MENU_ABR:
|
||||
strcpy(String, gSubMenu_BACKLIGHT[gSubMenuSelection]);
|
||||
if(gSubMenuSelection == 0)
|
||||
{
|
||||
sprintf(String, "%s", "OFF");
|
||||
}
|
||||
else if(gSubMenuSelection < 12)
|
||||
{
|
||||
sprintf(String, "%d sec", gSubMenuSelection * 5);
|
||||
}
|
||||
else if(gSubMenuSelection < 17)
|
||||
{
|
||||
sprintf(String, "%d min", gSubMenuSelection - 11);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(String, "%s", "ON");
|
||||
}
|
||||
|
||||
if(BACKLIGHT_GetBrightness() < 4)
|
||||
BACKLIGHT_SetBrightness(4);
|
||||
break;
|
||||
|
@@ -180,7 +180,6 @@ extern const char* const gSubMenu_PTT_ID[5];
|
||||
extern const char gSubMenu_ROGER[3][6];
|
||||
extern const char gSubMenu_RESET[2][4];
|
||||
extern const char* const gSubMenu_F_LOCK[F_LOCK_LEN];
|
||||
extern const char gSubMenu_BACKLIGHT[8][7];
|
||||
extern const char gSubMenu_RX_TX[4][6];
|
||||
extern const char gSubMenu_BAT_TXT[3][8];
|
||||
extern const char gSubMenu_BATTYP[2][9];
|
||||
|
Reference in New Issue
Block a user