forked from mirror/qmk_firmware
Align sleep_led logic (#25395)
This commit is contained in:
@@ -40,9 +40,6 @@
|
||||
# define EARLY_INIT_PERFORM_BOOTLOADER_JUMP FALSE
|
||||
#endif
|
||||
|
||||
#ifdef SLEEP_LED_ENABLE
|
||||
# include "sleep_led.h"
|
||||
#endif
|
||||
#ifdef MIDI_ENABLE
|
||||
# include "qmk_midi.h"
|
||||
#endif
|
||||
|
||||
@@ -21,10 +21,6 @@
|
||||
#include "host.h"
|
||||
#include "suspend.h"
|
||||
#include "timer.h"
|
||||
#ifdef SLEEP_LED_ENABLE
|
||||
# include "sleep_led.h"
|
||||
# include "led.h"
|
||||
#endif
|
||||
#include "wait.h"
|
||||
#include "usb_endpoints.h"
|
||||
#include "usb_device_state.h"
|
||||
@@ -131,19 +127,11 @@ static inline bool usb_event_queue_dequeue(usbevent_t *event) {
|
||||
|
||||
static inline void usb_event_suspend_handler(void) {
|
||||
usb_device_state_set_suspend(USB_DRIVER.configuration != 0, USB_DRIVER.configuration);
|
||||
#ifdef SLEEP_LED_ENABLE
|
||||
sleep_led_enable();
|
||||
#endif /* SLEEP_LED_ENABLE */
|
||||
}
|
||||
|
||||
static inline void usb_event_wakeup_handler(void) {
|
||||
suspend_wakeup_init();
|
||||
usb_device_state_set_resume(USB_DRIVER.configuration != 0, USB_DRIVER.configuration);
|
||||
#ifdef SLEEP_LED_ENABLE
|
||||
sleep_led_disable();
|
||||
// NOTE: converters may not accept this
|
||||
led_set(host_keyboard_leds());
|
||||
#endif /* SLEEP_LED_ENABLE */
|
||||
}
|
||||
|
||||
bool last_suspend_state = false;
|
||||
|
||||
Reference in New Issue
Block a user