[keyboard] Binepad KnobX1 - refactor x1_layer_led function as weak (#25668)
refactor `x1_layer_led` function as weak
This commit is contained in:
parent
d1b0397d2f
commit
a4b112b1ef
2 changed files with 8 additions and 7 deletions
|
|
@ -9,6 +9,13 @@
|
||||||
# define X1_KEYMAP_LAYER_COUNT 4
|
# define X1_KEYMAP_LAYER_COUNT 4
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
__attribute__((weak)) void x1_layer_led(uint8_t lyr) {
|
||||||
|
gpio_write_pin(IND1_LED, lyr >= 0);
|
||||||
|
gpio_write_pin(IND2_LED, lyr >= 1);
|
||||||
|
gpio_write_pin(IND3_LED, lyr >= 2);
|
||||||
|
gpio_write_pin(IND4_LED, lyr >= 3);
|
||||||
|
}
|
||||||
|
|
||||||
void keyboard_pre_init_kb(void) {
|
void keyboard_pre_init_kb(void) {
|
||||||
const pin_t indicator_leds[4] = {IND1_LED, IND2_LED, IND3_LED, IND4_LED};
|
const pin_t indicator_leds[4] = {IND1_LED, IND2_LED, IND3_LED, IND4_LED};
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
|
|
|
||||||
|
|
@ -38,12 +38,6 @@ static inline void x1_led_3_off(void) { gpio_write_pin_low(IND3_LED); }
|
||||||
static inline void x1_led_4_off(void) { gpio_write_pin_low(IND4_LED); }
|
static inline void x1_led_4_off(void) { gpio_write_pin_low(IND4_LED); }
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
static inline void x1_layer_led(uint8_t lyr) {
|
void x1_layer_led(uint8_t lyr);
|
||||||
gpio_write_pin(IND1_LED, lyr >= 0);
|
|
||||||
gpio_write_pin(IND2_LED, lyr >= 1);
|
|
||||||
gpio_write_pin(IND3_LED, lyr >= 2);
|
|
||||||
gpio_write_pin(IND4_LED, lyr >= 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool process_x1_layer_up(keyrecord_t *record);
|
bool process_x1_layer_up(keyrecord_t *record);
|
||||||
bool process_x1_layer_down(keyrecord_t *record);
|
bool process_x1_layer_down(keyrecord_t *record);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue