Update GPIO API usage in keyboard code (#23361)
This commit is contained in:
parent
5426a7a129
commit
d09a06a1b3
390 changed files with 3912 additions and 3913 deletions
|
@ -5,26 +5,26 @@
|
|||
|
||||
layer_state_t layer_state_set_kb(layer_state_t state) {
|
||||
/* Display current layer using indicator LEDs */
|
||||
writePin(LED_INDICATOR_0_PIN, !IS_LAYER_ON_STATE(state, 1));
|
||||
writePin(LED_INDICATOR_1_PIN, !IS_LAYER_ON_STATE(state, 2));
|
||||
writePin(LED_INDICATOR_2_PIN, !IS_LAYER_ON_STATE(state, 3));
|
||||
gpio_write_pin(LED_INDICATOR_0_PIN, !IS_LAYER_ON_STATE(state, 1));
|
||||
gpio_write_pin(LED_INDICATOR_1_PIN, !IS_LAYER_ON_STATE(state, 2));
|
||||
gpio_write_pin(LED_INDICATOR_2_PIN, !IS_LAYER_ON_STATE(state, 3));
|
||||
return layer_state_set_user(state);
|
||||
}
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
/* Set indicator LEDs as outputs */
|
||||
setPinOutput(LED_INDICATOR_0_PIN);
|
||||
setPinOutput(LED_INDICATOR_1_PIN);
|
||||
setPinOutput(LED_INDICATOR_2_PIN);
|
||||
gpio_set_pin_output(LED_INDICATOR_0_PIN);
|
||||
gpio_set_pin_output(LED_INDICATOR_1_PIN);
|
||||
gpio_set_pin_output(LED_INDICATOR_2_PIN);
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
void suspend_power_down_kb(void) {
|
||||
/* Disable indicator LEDs when going to sleep */
|
||||
writePin(LED_INDICATOR_0_PIN, 1);
|
||||
writePin(LED_INDICATOR_1_PIN, 1);
|
||||
writePin(LED_INDICATOR_2_PIN, 1);
|
||||
gpio_write_pin(LED_INDICATOR_0_PIN, 1);
|
||||
gpio_write_pin(LED_INDICATOR_1_PIN, 1);
|
||||
gpio_write_pin(LED_INDICATOR_2_PIN, 1);
|
||||
suspend_power_down_user();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue