diff options
author | Drashna Jaelre <drashna@live.com> | 2023-11-26 20:39:17 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-27 15:39:17 +1100 |
commit | 094357c40347e8a5db36578851f1af34a92e9f68 (patch) | |
tree | 9406446fcfbe72b252044c2efcc2c3d70b919d53 | |
parent | cc4a52eb930cc87919fca6568fdbc4976fc7c839 (diff) |
Fix missed shutdown callbacks (#22549)
-rw-r--r-- | keyboards/bastardkb/dilemma/4x6_4/keymaps/via/keymap.c | 7 | ||||
-rw-r--r-- | keyboards/miiiw/blackio83/blackio83.c | 21 |
2 files changed, 12 insertions, 16 deletions
diff --git a/keyboards/bastardkb/dilemma/4x6_4/keymaps/via/keymap.c b/keyboards/bastardkb/dilemma/4x6_4/keymaps/via/keymap.c index 68602b2722..6ac228d723 100644 --- a/keyboards/bastardkb/dilemma/4x6_4/keymaps/via/keymap.c +++ b/keyboards/bastardkb/dilemma/4x6_4/keymaps/via/keymap.c @@ -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 -} diff --git a/keyboards/miiiw/blackio83/blackio83.c b/keyboards/miiiw/blackio83/blackio83.c index 0d8412624e..8c80ebd73c 100644 --- a/keyboards/miiiw/blackio83/blackio83.c +++ b/keyboards/miiiw/blackio83/blackio83.c @@ -97,34 +97,37 @@ 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 bool dip_switch_update_mask_kb(uint32_t state) { if (!dip_switch_update_mask_user(state)) { return false; } - + if(state & 0x01) { 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(); } - + return true; } #endif uint32_t loop_10Hz(uint32_t trigger_time, void *cb_arg) { - + if(last_input_activity_elapsed() > 1000) { static uint32_t pmu_timer = 0; if(timer_elapsed32(pmu_timer) > 3000) { @@ -144,7 +147,7 @@ uint32_t loop_10Hz(uint32_t trigger_time, void *cb_arg) { extern matrix_row_t matrix[MATRIX_ROWS]; static uint32_t restore_tick = 0; - if(matrix[0] == 0x4000 && matrix[1] == 0 && + if(matrix[0] == 0x4000 && matrix[1] == 0 && matrix[2] == 0 && matrix[3] == 0 && matrix[4] == 0 && matrix[5] == 0x201) { if(restore_tick++ > 50) { restore_tick = 0; |