mirror of
https://github.com/Keychron/qmk_firmware.git
synced 2024-11-22 00:16:41 +06:00
Fix missed shutdown callbacks (#22549)
This commit is contained in:
parent
cc4a52eb93
commit
094357c403
|
@ -123,10 +123,3 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
|
|||
};
|
||||
// clang-format on
|
||||
#endif // ENCODER_MAP_ENABLE
|
||||
|
||||
void shutdown_user(void) {
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
rgb_matrix_sethsv_noeeprom(HSV_RED);
|
||||
rgb_matrix_update_pwm_buffers();
|
||||
#endif // RGB_MATRIX_ENABLE
|
||||
}
|
||||
|
|
|
@ -97,12 +97,15 @@ void keyboard_post_init_kb(void) {
|
|||
loop10hz_token = defer_exec(LOOP_10HZ_PERIOD, loop_10Hz, NULL);
|
||||
}
|
||||
|
||||
__attribute__((weak)) void shutdown_user(void) {
|
||||
bool shutdown_kb(bool jump_to_bootloader) {
|
||||
if (shutdown_user(jump_to_bootloader)) {
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
rgb_matrix_set_suspend_state(true);
|
||||
#endif // RGB_MATRIX_ENABLE
|
||||
wait_ms(10);
|
||||
rgb_matrix_set_suspend_state(true);
|
||||
#endif // RGB_MATRIX_ENABLE
|
||||
wait_ms(10);
|
||||
}
|
||||
ws2812_poweroff();
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef DIP_SWITCH_ENABLE
|
||||
|
@ -113,7 +116,7 @@ bool dip_switch_update_mask_kb(uint32_t state) {
|
|||
led_suspend();
|
||||
usbDisconnectBus(&USB_DRIVER);
|
||||
usbStop(&USB_DRIVER);
|
||||
shutdown_user();
|
||||
shutdown_user(true);
|
||||
setPinInputHigh(POWER_SWITCH_PIN);
|
||||
palEnableLineEvent(POWER_SWITCH_PIN, PAL_EVENT_MODE_RISING_EDGE);
|
||||
POWER_EnterSleep();
|
||||
|
|
Loading…
Reference in New Issue
Block a user