From 1359d26dc0715bbcc534bf501187317d0bc58340 Mon Sep 17 00:00:00 2001 From: casuanoob Date: Thu, 16 Nov 2023 13:06:10 +1100 Subject: [PATCH] 3x5_3 make via keymap pristine - move shutdown function to 3x5_3.c --- keyboards/bastardkb/dilemma/3x5_3/3x5_3.c | 8 ++++++++ .../bastardkb/dilemma/3x5_3/keymaps/via/keymap.c | 13 +------------ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/keyboards/bastardkb/dilemma/3x5_3/3x5_3.c b/keyboards/bastardkb/dilemma/3x5_3/3x5_3.c index 55c11982a2bd..5d8d24137676 100644 --- a/keyboards/bastardkb/dilemma/3x5_3/3x5_3.c +++ b/keyboards/bastardkb/dilemma/3x5_3/3x5_3.c @@ -92,4 +92,12 @@ bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) { } return false; }; + +// Forward-declare this helper function since it is defined in rgb_matrix.c. +void rgb_matrix_update_pwm_buffers(void); + +__attribute__((weak)) void shutdown_user(void) { + rgb_matrix_set_color_all(rgb_matrix_get_val(), 0x00, 0x00); + rgb_matrix_update_pwm_buffers(); +} #endif // RGB_MATRIX_ENABLE diff --git a/keyboards/bastardkb/dilemma/3x5_3/keymaps/via/keymap.c b/keyboards/bastardkb/dilemma/3x5_3/keymaps/via/keymap.c index d8c3349d94e8..59c4450cd7b7 100644 --- a/keyboards/bastardkb/dilemma/3x5_3/keymaps/via/keymap.c +++ b/keyboards/bastardkb/dilemma/3x5_3/keymaps/via/keymap.c @@ -167,15 +167,4 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { [LAYER_SYMBOLS] = {ENCODER_CCW_CW(RGB_RMOD, RGB_MOD), ENCODER_CCW_CW(KC_LEFT, KC_RGHT)}, }; // clang-format on -#endif // ENCODER_MAP_ENABL - -#ifdef RGB_MATRIX_ENABLE -// Forward-declare this helper function since it is defined in rgb_matrix.c. -void rgb_matrix_update_pwm_buffers(void); - -void shutdown_user(void) { - rgb_matrix_set_color_all(rgb_matrix_get_val(), 0x00, 0x00); - rgb_matrix_update_pwm_buffers(); -#endif // RGB_MATRIX_ENABLE -} - +#endif // ENCODER_MAP_ENABLE