Skip to content

Commit

Permalink
3x5_3 make via keymap pristine
Browse files Browse the repository at this point in the history
- move shutdown function to 3x5_3.c
  • Loading branch information
casuanoob committed Dec 1, 2023
1 parent 58dd4bf commit 1359d26
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
8 changes: 8 additions & 0 deletions keyboards/bastardkb/dilemma/3x5_3/3x5_3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 1 addition & 12 deletions keyboards/bastardkb/dilemma/3x5_3/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1359d26

Please sign in to comment.