Update GPIO API usage in keyboard code (#23361)

This commit is contained in:
Ryan
2024-05-03 15:21:29 +10:00
committed by GitHub
parent 5426a7a129
commit d09a06a1b3
390 changed files with 3912 additions and 3913 deletions

View File

@@ -18,19 +18,19 @@
void keyboard_pre_init_kb(void) {
// initialize top row leds
setPinOutput(F7);
setPinOutput(F6);
setPinOutput(F5);
gpio_set_pin_output(F7);
gpio_set_pin_output(F6);
gpio_set_pin_output(F5);
// and then turn them off
writePinHigh(F7);
writePinHigh(F6);
writePinHigh(F5);
gpio_write_pin_high(F7);
gpio_write_pin_high(F6);
gpio_write_pin_high(F5);
}
bool led_update_kb(led_t led_state) {
bool res = led_update_user(led_state);
if(res) {
writePin(F7, !led_state.num_lock);
gpio_write_pin(F7, !led_state.num_lock);
}
return res;
}
@@ -38,16 +38,16 @@ bool led_update_kb(led_t led_state) {
layer_state_t layer_state_set_kb(layer_state_t state) {
switch (get_highest_layer(state)) {
case 1:
writePinHigh(F6);
writePinLow(F5);
gpio_write_pin_high(F6);
gpio_write_pin_low(F5);
break;
case 2:
writePinLow(F6);
writePinHigh(F5);
gpio_write_pin_low(F6);
gpio_write_pin_high(F5);
break;
default:
writePinHigh(F6);
writePinHigh(F5);
gpio_write_pin_high(F6);
gpio_write_pin_high(F5);
break;
}
return state;