mirror of
https://github.com/Keychron/qmk_firmware.git
synced 2024-11-26 10:27:52 +06:00
fix led issue
This commit is contained in:
parent
4555003019
commit
103badc87c
|
@ -476,7 +476,7 @@ void indicator_task(void) {
|
|||
}
|
||||
|
||||
#if defined(LED_MATRIX_ENABLE) || defined(RGB_MATRIX_ENABLE)
|
||||
static void os_state_indicate(void) {
|
||||
__attribute__((weak)) void os_state_indicate(void) {
|
||||
# if defined(NUM_LOCK_INDEX)
|
||||
if (host_keyboard_led_state().num_lock) {
|
||||
SET_LED_ON(NUM_LOCK_INDEX);
|
||||
|
@ -559,18 +559,24 @@ bool LED_INDICATORS_KB(void) {
|
|||
}
|
||||
|
||||
bool led_update_kb(led_t led_state) {
|
||||
if (!LED_DRIVER_IS_ENABLED()) {
|
||||
# if defined(LED_MATRIX_DRIVER_SHUTDOWN_ENABLE) || defined(RGB_MATRIX_DRIVER_SHUTDOWN_ENABLE)
|
||||
LED_DRIVER.exit_shutdown();
|
||||
# endif
|
||||
SET_ALL_LED_OFF();
|
||||
os_state_indicate();
|
||||
LED_DRIVER.flush();
|
||||
# if defined(LED_MATRIX_DRIVER_SHUTDOWN_ENABLE) || defined(RGB_MATRIX_DRIVER_SHUTDOWN_ENABLE)
|
||||
if (LED_DRIVER_ALLOW_SHUTDOWN()) LED_DRIVER.shutdown();
|
||||
# endif
|
||||
bool res = led_update_user(led_state);
|
||||
if (res) {
|
||||
led_update_ports(led_state);
|
||||
|
||||
if (!LED_DRIVER_IS_ENABLED()) {
|
||||
# if defined(LED_MATRIX_DRIVER_SHUTDOWN_ENABLE) || defined(RGB_MATRIX_DRIVER_SHUTDOWN_ENABLE)
|
||||
LED_DRIVER.exit_shutdown();
|
||||
# endif
|
||||
SET_ALL_LED_OFF();
|
||||
os_state_indicate();
|
||||
LED_DRIVER.flush();
|
||||
# if defined(LED_MATRIX_DRIVER_SHUTDOWN_ENABLE) || defined(RGB_MATRIX_DRIVER_SHUTDOWN_ENABLE)
|
||||
if (LED_DRIVER_ALLOW_SHUTDOWN()) LED_DRIVER.shutdown();
|
||||
# endif
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
void LED_NONE_INDICATORS_KB(void) {
|
||||
|
|
|
@ -106,6 +106,7 @@ void indicator_stop(void);
|
|||
void indicator_eeconfig_reload(void);
|
||||
bool indicator_is_enabled(void);
|
||||
bool indicator_is_running(void);
|
||||
void os_state_indicate(void);
|
||||
|
||||
#ifdef BAT_LOW_LED_PIN
|
||||
void indicator_battery_low_enable(bool enable);
|
||||
|
|
Loading…
Reference in New Issue
Block a user