Update GPIO macros in keymaps (#23792)
This commit is contained in:
parent
8ff8e9eae5
commit
b8f29c3865
82 changed files with 402 additions and 402 deletions
|
@ -20,26 +20,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
};
|
||||
|
||||
bool led_update_user(led_t led_state) {
|
||||
setPinOutput(B4);
|
||||
setPinOutput(D6);
|
||||
setPinOutput(D7);
|
||||
gpio_set_pin_output(B4);
|
||||
gpio_set_pin_output(D6);
|
||||
gpio_set_pin_output(D7);
|
||||
|
||||
if (led_state.num_lock) {
|
||||
writePinHigh(D7);
|
||||
gpio_write_pin_high(D7);
|
||||
} else {
|
||||
writePinLow(D7);
|
||||
gpio_write_pin_low(D7);
|
||||
}
|
||||
|
||||
if (led_state.caps_lock) {
|
||||
writePinHigh(B4);
|
||||
gpio_write_pin_high(B4);
|
||||
} else {
|
||||
writePinLow(B4);
|
||||
gpio_write_pin_low(B4);
|
||||
}
|
||||
|
||||
if (led_state.scroll_lock) {
|
||||
writePinHigh(D6);
|
||||
gpio_write_pin_high(D6);
|
||||
} else {
|
||||
writePinLow(D6);
|
||||
gpio_write_pin_low(D6);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -75,30 +75,30 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
};
|
||||
|
||||
void keyboard_pre_init_user(void) {
|
||||
setPinOutput(F5); // initialize F5 for LED
|
||||
setPinOutput(F6); // initialize F6 for LED
|
||||
setPinOutput(F7); // initialize F7 for LED
|
||||
gpio_set_pin_output(F5); // initialize F5 for LED
|
||||
gpio_set_pin_output(F6); // initialize F6 for LED
|
||||
gpio_set_pin_output(F7); // initialize F7 for LED
|
||||
|
||||
}
|
||||
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
writePinLow(F5);
|
||||
writePinLow(F6);
|
||||
writePinLow(F7);
|
||||
gpio_write_pin_low(F5);
|
||||
gpio_write_pin_low(F6);
|
||||
gpio_write_pin_low(F7);
|
||||
switch (get_highest_layer(state)) {
|
||||
case _FN1:
|
||||
writePinHigh(F5);
|
||||
gpio_write_pin_high(F5);
|
||||
break;
|
||||
case _FN2:
|
||||
writePinHigh(F6);
|
||||
gpio_write_pin_high(F6);
|
||||
break;
|
||||
case _FN3: // replace 'XXXX' with the layer or function name
|
||||
writePinHigh(F7);
|
||||
gpio_write_pin_high(F7);
|
||||
break;
|
||||
case KC_F24:
|
||||
writePinHigh(F7);
|
||||
writePinHigh(F5);
|
||||
writePinHigh(F6);
|
||||
gpio_write_pin_high(F7);
|
||||
gpio_write_pin_high(F5);
|
||||
gpio_write_pin_high(F6);
|
||||
break;
|
||||
}
|
||||
return state;
|
||||
|
|
|
@ -75,38 +75,38 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
};
|
||||
|
||||
void keyboard_pre_init_user(void) {
|
||||
setPinOutput(F5); // initialize F5 for LED
|
||||
setPinOutput(F6); // initialize F6 for LED
|
||||
setPinOutput(F7); // initialize F7 for LED
|
||||
gpio_set_pin_output(F5); // initialize F5 for LED
|
||||
gpio_set_pin_output(F6); // initialize F6 for LED
|
||||
gpio_set_pin_output(F7); // initialize F7 for LED
|
||||
|
||||
}
|
||||
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
switch (get_highest_layer(state)) {
|
||||
case _FN1:
|
||||
writePinHigh(F5);
|
||||
writePinLow(F6);
|
||||
writePinLow(F7);
|
||||
gpio_write_pin_high(F5);
|
||||
gpio_write_pin_low(F6);
|
||||
gpio_write_pin_low(F7);
|
||||
break;
|
||||
case _FN2:
|
||||
writePinHigh(F6);
|
||||
writePinLow(F5);
|
||||
writePinLow(F7);
|
||||
gpio_write_pin_high(F6);
|
||||
gpio_write_pin_low(F5);
|
||||
gpio_write_pin_low(F7);
|
||||
break;
|
||||
case _FN3: // replace 'XXXX' with the layer or function name
|
||||
writePinHigh(F7);
|
||||
writePinLow(F5);
|
||||
writePinLow(F6);
|
||||
gpio_write_pin_high(F7);
|
||||
gpio_write_pin_low(F5);
|
||||
gpio_write_pin_low(F6);
|
||||
break;
|
||||
case KC_F24:
|
||||
writePinHigh(F7);
|
||||
writePinHigh(F5);
|
||||
writePinHigh(F6);
|
||||
gpio_write_pin_high(F7);
|
||||
gpio_write_pin_high(F5);
|
||||
gpio_write_pin_high(F6);
|
||||
break;
|
||||
default:
|
||||
writePinLow(F5);
|
||||
writePinLow(F6);
|
||||
writePinLow(F7);
|
||||
gpio_write_pin_low(F5);
|
||||
gpio_write_pin_low(F6);
|
||||
gpio_write_pin_low(F7);
|
||||
break;
|
||||
}
|
||||
return state;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue