mirror of
https://github.com/qmk/qmk_firmware.git
synced 2026-08-05 00:40:49 -04:00
Add _noeeprom variants of backlight enable/disable. (#26328)
This commit is contained in:
@@ -209,9 +209,9 @@ void housekeeping_task_kb(void) {
|
||||
// Match the backlight to the LCD state
|
||||
if (is_keyboard_master() && is_backlight_enabled() != peripherals_on) {
|
||||
if (peripherals_on)
|
||||
backlight_enable();
|
||||
backlight_enable_noeeprom();
|
||||
else
|
||||
backlight_disable();
|
||||
backlight_disable_noeeprom();
|
||||
}
|
||||
|
||||
// Draw the UI
|
||||
|
||||
@@ -107,32 +107,44 @@ void backlight_toggle(void) {
|
||||
|
||||
/** \brief Enable backlight
|
||||
*
|
||||
* FIXME: needs doc
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
void backlight_enable(void) {
|
||||
void backlight_enable_noeeprom(void) {
|
||||
if (backlight_config.enable) return; // do nothing if backlight is already on
|
||||
|
||||
backlight_config.enable = true;
|
||||
if (backlight_config.raw == 1) // enabled but level == 0
|
||||
backlight_config.level = 1;
|
||||
eeconfig_update_backlight(&backlight_config);
|
||||
dprintf("backlight enable\n");
|
||||
backlight_set(backlight_config.level);
|
||||
}
|
||||
|
||||
void backlight_enable(void) {
|
||||
if (backlight_config.enable) return; // do nothing if backlight is already on
|
||||
|
||||
backlight_enable_noeeprom();
|
||||
eeconfig_update_backlight(&backlight_config);
|
||||
}
|
||||
|
||||
/** \brief Disable backlight
|
||||
*
|
||||
* FIXME: needs doc
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
void backlight_disable(void) {
|
||||
void backlight_disable_noeeprom(void) {
|
||||
if (!backlight_config.enable) return; // do nothing if backlight is already off
|
||||
|
||||
backlight_config.enable = false;
|
||||
eeconfig_update_backlight(&backlight_config);
|
||||
dprintf("backlight disable\n");
|
||||
backlight_set(0);
|
||||
}
|
||||
|
||||
void backlight_disable(void) {
|
||||
if (!backlight_config.enable) return; // do nothing if backlight is already off
|
||||
|
||||
backlight_disable_noeeprom();
|
||||
eeconfig_update_backlight(&backlight_config);
|
||||
}
|
||||
|
||||
/** /brief Get the backlight status
|
||||
*
|
||||
* FIXME: needs doc
|
||||
|
||||
@@ -51,7 +51,9 @@ STATIC_ASSERT(sizeof(backlight_config_t) == sizeof(uint8_t), "Backlight EECONFIG
|
||||
void backlight_init(void);
|
||||
void backlight_toggle(void);
|
||||
void backlight_enable(void);
|
||||
void backlight_enable_noeeprom(void);
|
||||
void backlight_disable(void);
|
||||
void backlight_disable_noeeprom(void);
|
||||
bool is_backlight_enabled(void);
|
||||
void backlight_step(void);
|
||||
void backlight_increase(void);
|
||||
|
||||
Reference in New Issue
Block a user