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
|
@ -19,29 +19,29 @@
|
|||
#ifndef LAYER_LED_DISABLE
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
setPinOutput(LED_INDICATOR_TOP);
|
||||
setPinOutput(LED_INDICATOR_MID);
|
||||
setPinOutput(LED_INDICATOR_BOT);
|
||||
gpio_set_pin_output(LED_INDICATOR_TOP);
|
||||
gpio_set_pin_output(LED_INDICATOR_MID);
|
||||
gpio_set_pin_output(LED_INDICATOR_BOT);
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
||||
__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
writePinHigh(LED_INDICATOR_TOP);
|
||||
writePinHigh(LED_INDICATOR_MID);
|
||||
writePinHigh(LED_INDICATOR_BOT);
|
||||
gpio_write_pin_high(LED_INDICATOR_TOP);
|
||||
gpio_write_pin_high(LED_INDICATOR_MID);
|
||||
gpio_write_pin_high(LED_INDICATOR_BOT);
|
||||
|
||||
switch(get_highest_layer(state) % 4) {
|
||||
case 1:
|
||||
writePinLow(LED_INDICATOR_TOP);
|
||||
writePinLow(LED_INDICATOR_MID);
|
||||
gpio_write_pin_low(LED_INDICATOR_TOP);
|
||||
gpio_write_pin_low(LED_INDICATOR_MID);
|
||||
break;
|
||||
case 2:
|
||||
writePinLow(LED_INDICATOR_TOP);
|
||||
writePinLow(LED_INDICATOR_BOT);
|
||||
gpio_write_pin_low(LED_INDICATOR_TOP);
|
||||
gpio_write_pin_low(LED_INDICATOR_BOT);
|
||||
break;
|
||||
case 3:
|
||||
writePinLow(LED_INDICATOR_MID);
|
||||
writePinLow(LED_INDICATOR_BOT);
|
||||
gpio_write_pin_low(LED_INDICATOR_MID);
|
||||
gpio_write_pin_low(LED_INDICATOR_BOT);
|
||||
break;
|
||||
}
|
||||
return state;
|
||||
|
|
|
@ -19,29 +19,29 @@
|
|||
#ifndef LAYER_LED_DISABLE
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
setPinOutput(LED_INDICATOR_TOP);
|
||||
setPinOutput(LED_INDICATOR_MID);
|
||||
setPinOutput(LED_INDICATOR_BOT);
|
||||
gpio_set_pin_output(LED_INDICATOR_TOP);
|
||||
gpio_set_pin_output(LED_INDICATOR_MID);
|
||||
gpio_set_pin_output(LED_INDICATOR_BOT);
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
||||
__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
writePinHigh(LED_INDICATOR_TOP);
|
||||
writePinHigh(LED_INDICATOR_MID);
|
||||
writePinHigh(LED_INDICATOR_BOT);
|
||||
gpio_write_pin_high(LED_INDICATOR_TOP);
|
||||
gpio_write_pin_high(LED_INDICATOR_MID);
|
||||
gpio_write_pin_high(LED_INDICATOR_BOT);
|
||||
|
||||
switch(get_highest_layer(state) % 4) {
|
||||
case 1:
|
||||
writePinLow(LED_INDICATOR_TOP);
|
||||
writePinLow(LED_INDICATOR_MID);
|
||||
gpio_write_pin_low(LED_INDICATOR_TOP);
|
||||
gpio_write_pin_low(LED_INDICATOR_MID);
|
||||
break;
|
||||
case 2:
|
||||
writePinLow(LED_INDICATOR_TOP);
|
||||
writePinLow(LED_INDICATOR_BOT);
|
||||
gpio_write_pin_low(LED_INDICATOR_TOP);
|
||||
gpio_write_pin_low(LED_INDICATOR_BOT);
|
||||
break;
|
||||
case 3:
|
||||
writePinLow(LED_INDICATOR_MID);
|
||||
writePinLow(LED_INDICATOR_BOT);
|
||||
gpio_write_pin_low(LED_INDICATOR_MID);
|
||||
gpio_write_pin_low(LED_INDICATOR_BOT);
|
||||
break;
|
||||
}
|
||||
return state;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue