General fixes and improvements to code

This commit is contained in:
leptun 2019-10-31 19:07:20 +02:00
parent 1e09f8c003
commit cd5ff783cf
5 changed files with 43 additions and 50 deletions

View file

@ -20,6 +20,13 @@ uint8_t backlightMode = BACKLIGHT_MODE_BRIGHT;
int16_t backlightTimer_period = 10;
LongTimer backlightTimer;
static void backlightTimer_reset() //used for resetting the timer and waking the display. Triggered on user interactions.
{
if (!backlightSupport) return;
backlightTimer.start();
backlight_update();
}
void force_bl_on(bool section_start)
{
if (section_start)
@ -61,13 +68,6 @@ void backlight_save() //saves all backlight data to eeprom.
eeprom_update_word((uint16_t *)EEPROM_BACKLIGHT_TIMEOUT, backlightTimer_period);
}
void backlightTimer_reset() //used for resetting the timer and waking the display. Triggered on user interactions.
{
if (!backlightSupport) return;
backlightTimer.start();
backlight_update();
}
void backlight_update()
{
if (!backlightSupport) return;
@ -109,4 +109,12 @@ void backlight_init()
backlightTimer_reset();
}
#else //LCD_BL_PIN
void force_bl_on(__attribute__((unused)) bool section_start) {}
void backlight_update() {}
void backlight_init() {}
void backlight_save() {}
void backlight_wake(__attribute__((unused)) const uint8_t flashNo) {}
#endif //LCD_BL_PIN