Update GPIO macros in keymaps (#23792)

This commit is contained in:
Ryan 2024-05-25 04:38:57 +10:00 committed by GitHub
parent 8ff8e9eae5
commit b8f29c3865
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
82 changed files with 402 additions and 402 deletions

View File

@ -20,11 +20,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
if (led_state.caps_lock) { if (led_state.caps_lock) {
setPinOutput(B2); gpio_set_pin_output(B2);
writePinLow(B2); gpio_write_pin_low(B2);
} else { } else {
setPinInput(B2); gpio_set_pin_input(B2);
writePinLow(B2); gpio_write_pin_low(B2);
} }
return false; return false;
} }

View File

@ -20,11 +20,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
if (led_state.caps_lock) { if (led_state.caps_lock) {
setPinOutput(B2); gpio_set_pin_output(B2);
writePinLow(B2); gpio_write_pin_low(B2);
} else { } else {
setPinInput(B2); gpio_set_pin_input(B2);
writePinLow(B2); gpio_write_pin_low(B2);
} }
return false; return false;
} }

View File

@ -20,11 +20,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
if (led_state.caps_lock) { if (led_state.caps_lock) {
setPinOutput(B2); gpio_set_pin_output(B2);
writePinLow(B2); gpio_write_pin_low(B2);
} else { } else {
setPinInput(B2); gpio_set_pin_input(B2);
writePinLow(B2); gpio_write_pin_low(B2);
} }
return false; return false;
} }

View File

@ -90,9 +90,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//function for layer indicator LED //function for layer indicator LED
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
writePin(D0, layer_state_cmp(state, 0)); gpio_write_pin(D0, layer_state_cmp(state, 0));
writePin(D1, layer_state_cmp(state, 1)); gpio_write_pin(D1, layer_state_cmp(state, 1));
writePin(D2, layer_state_cmp(state, 2)); gpio_write_pin(D2, layer_state_cmp(state, 2));
return state; return state;
} }

View File

@ -90,9 +90,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//function for layer indicator LED //function for layer indicator LED
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
writePin(D0, layer_state_cmp(state, 0)); gpio_write_pin(D0, layer_state_cmp(state, 0));
writePin(D1, layer_state_cmp(state, 1)); gpio_write_pin(D1, layer_state_cmp(state, 1));
writePin(D2, layer_state_cmp(state, 2)); gpio_write_pin(D2, layer_state_cmp(state, 2));
return state; return state;
} }

View File

@ -37,8 +37,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Layer-specific lighting */ /* Layer-specific lighting */
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
writePin(F4, !layer_state_cmp(state, _VC)); gpio_write_pin(F4, !layer_state_cmp(state, _VC));
writePin(F5, !layer_state_cmp(state, _VIM)); gpio_write_pin(F5, !layer_state_cmp(state, _VIM));
return state; return state;
}; };

View File

@ -29,7 +29,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
}; };
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
writePin(D0, IS_LAYER_ON_STATE(state, 1)); gpio_write_pin(D0, IS_LAYER_ON_STATE(state, 1));
return state; return state;
} }

View File

@ -46,11 +46,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// C6 E6 D7 // C6 E6 D7
void matrix_scan_user(void) { void matrix_scan_user(void) {
writePin(C6, layer_state_is(1)); gpio_write_pin(C6, layer_state_is(1));
writePin(E6, layer_state_is(2)); gpio_write_pin(E6, layer_state_is(2));
writePin(D7, layer_state_is(3)); gpio_write_pin(D7, layer_state_is(3));
writePin(D4, layer_state_is(4)); gpio_write_pin(D4, layer_state_is(4));
writePin(D0, layer_state_is(5)); gpio_write_pin(D0, layer_state_is(5));
if (is_alt_tab_active) { if (is_alt_tab_active) {
if (timer_elapsed(alt_tab_timer) > 1000) { if (timer_elapsed(alt_tab_timer) > 1000) {
unregister_code(KC_LWIN); unregister_code(KC_LWIN);

View File

@ -47,15 +47,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
} }
void matrix_init_user(void) { void matrix_init_user(void) {
setPinOutput(B0); gpio_set_pin_output(B0);
writePinLow(B0); gpio_write_pin_low(B0);
} }
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
if (led_state.caps_lock) { if (led_state.caps_lock) {
writePinHigh(B0); gpio_write_pin_high(B0);
} else { } else {
writePinLow(B0); gpio_write_pin_low(B0);
} }
return false; return false;
} }

View File

@ -37,8 +37,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
void matrix_scan_user(void) { void matrix_scan_user(void) {
// escape LED on layer 1 // escape LED on layer 1
if (IS_LAYER_ON(1)) { if (IS_LAYER_ON(1)) {
writePinLow(B0); gpio_write_pin_low(B0);
} else { } else {
writePinHigh(B0); gpio_write_pin_high(B0);
} }
} }

View File

@ -73,6 +73,6 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
#endif #endif
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
writePin(C0, layer_state_cmp(state, 1)); gpio_write_pin(C0, layer_state_cmp(state, 1));
return state; return state;
}; };

View File

@ -73,6 +73,6 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
#endif #endif
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
writePin(C0, layer_state_cmp(state, 1)); gpio_write_pin(C0, layer_state_cmp(state, 1));
return state; return state;
}; };

View File

@ -64,6 +64,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
}; };
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
writePin(C0, layer_state_cmp(state, 1)); gpio_write_pin(C0, layer_state_cmp(state, 1));
return state; return state;
}; };

View File

@ -64,6 +64,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
}; };
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
writePin(C0, layer_state_cmp(state, 1)); gpio_write_pin(C0, layer_state_cmp(state, 1));
return state; return state;
}; };

View File

@ -51,10 +51,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
if (led_state.caps_lock) { if (led_state.caps_lock) {
rgblight_sethsv(HSV_CYAN); rgblight_sethsv(HSV_CYAN);
writePinHigh(D1); gpio_write_pin_high(D1);
} else { } else {
rgblight_sethsv(HSV_GREEN); rgblight_sethsv(HSV_GREEN);
writePinLow(D1); gpio_write_pin_low(D1);
} }
return false; return false;
} }

View File

@ -215,18 +215,18 @@ led_config_t led_config;
//Set leds to saved state during powerup //Set leds to saved state during powerup
void keyboard_post_init_user(void) { void keyboard_post_init_user(void) {
// set LED pin modes // set LED pin modes
setPinOutput(LED_RED); gpio_set_pin_output(LED_RED);
setPinOutput(LED_GREEN); gpio_set_pin_output(LED_GREEN);
// Call the post init code. // Call the post init code.
led_config.raw = eeconfig_read_user(); led_config.raw = eeconfig_read_user();
if(led_config.red_mode == LEDMODE_ON) { if(led_config.red_mode == LEDMODE_ON) {
writePinHigh(LED_RED); gpio_write_pin_high(LED_RED);
} }
if(led_config.green_mode == LEDMODE_ON) { if(led_config.green_mode == LEDMODE_ON) {
writePinHigh(LED_GREEN); gpio_write_pin_high(LED_GREEN);
} }
} }
@ -248,10 +248,10 @@ void led_keypress_update(uint8_t led, uint8_t led_mode, uint16_t keycode, keyrec
for (int i=0;i<ARRAY_SIZE(modifiers);i++) { for (int i=0;i<ARRAY_SIZE(modifiers);i++) {
if(keycode==modifiers[i]) { if(keycode==modifiers[i]) {
if (record->event.pressed) { if (record->event.pressed) {
writePinHigh(led); gpio_write_pin_high(led);
} }
else { else {
writePinLow(led); gpio_write_pin_low(led);
} }
} }
} }
@ -260,30 +260,30 @@ void led_keypress_update(uint8_t led, uint8_t led_mode, uint16_t keycode, keyrec
if (record->event.pressed) { if (record->event.pressed) {
if(rand() % 2 == 1) { if(rand() % 2 == 1) {
if(rand() % 2 == 0) { if(rand() % 2 == 0) {
writePinLow(led); gpio_write_pin_low(led);
} }
else { else {
writePinHigh(led); gpio_write_pin_high(led);
} }
} }
} }
break; break;
case LEDMODE_KEY: case LEDMODE_KEY:
if (record->event.pressed) { if (record->event.pressed) {
writePinHigh(led); gpio_write_pin_high(led);
return; return;
} }
else { else {
writePinLow(led); gpio_write_pin_low(led);
return; return;
} }
break; break;
case LEDMODE_ENTER: case LEDMODE_ENTER:
if (keycode==KC_ENT) { if (keycode==KC_ENT) {
writePinHigh(led); gpio_write_pin_high(led);
} }
else { else {
writePinLow(led); gpio_write_pin_low(led);
} }
break; break;
@ -345,11 +345,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) { if (record->event.pressed) {
if (led_config.red_mode==LEDMODE_ON) { if (led_config.red_mode==LEDMODE_ON) {
led_config.red_mode=LEDMODE_OFF; led_config.red_mode=LEDMODE_OFF;
writePinLow(LED_RED); gpio_write_pin_low(LED_RED);
} }
else { else {
led_config.red_mode=LEDMODE_ON; led_config.red_mode=LEDMODE_ON;
writePinHigh(LED_RED); gpio_write_pin_high(LED_RED);
} }
} }
eeconfig_update_user(led_config.raw); eeconfig_update_user(led_config.raw);
@ -359,11 +359,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) { if (record->event.pressed) {
if (led_config.green_mode==LEDMODE_ON) { if (led_config.green_mode==LEDMODE_ON) {
led_config.green_mode=LEDMODE_OFF; led_config.green_mode=LEDMODE_OFF;
writePinLow(LED_GREEN); gpio_write_pin_low(LED_GREEN);
} }
else { else {
led_config.green_mode=LEDMODE_ON; led_config.green_mode=LEDMODE_ON;
writePinHigh(LED_GREEN); gpio_write_pin_high(LED_GREEN);
} }
} }
eeconfig_update_user(led_config.raw); eeconfig_update_user(led_config.raw);

View File

@ -95,7 +95,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
}; };
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
writePin(LED_RED, led_state.caps_lock); gpio_write_pin(LED_RED, led_state.caps_lock);
writePin(LED_GREEN, led_state.scroll_lock); gpio_write_pin(LED_GREEN, led_state.scroll_lock);
return false; return false;
} }

View File

@ -66,6 +66,6 @@ bool rgb_matrix_indicators_user(void) {
} }
void keyboard_pre_init_user(void) { void keyboard_pre_init_user(void) {
setPinOutput(B5); gpio_set_pin_output(B5);
writePinLow(B5); gpio_write_pin_low(B5);
} }

View File

@ -48,9 +48,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
if (get_highest_layer(state) != 0) { if (get_highest_layer(state) != 0) {
writePinLow(C6); gpio_write_pin_low(C6);
} else { } else {
writePinHigh(C6); gpio_write_pin_high(C6);
} }
return state; return state;
} }

View File

@ -48,9 +48,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
if (get_highest_layer(state) != 0) { if (get_highest_layer(state) != 0) {
writePinLow(C6); gpio_write_pin_low(C6);
} else { } else {
writePinHigh(C6); gpio_write_pin_high(C6);
} }
return state; return state;
} }

View File

@ -48,9 +48,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
if (get_highest_layer(state) != 0) { if (get_highest_layer(state) != 0) {
writePinLow(C6); gpio_write_pin_low(C6);
} else { } else {
writePinHigh(C6); gpio_write_pin_high(C6);
} }
return state; return state;
} }

View File

@ -56,13 +56,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
}; };
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
setPinOutput(LOCK_LED_PIN); gpio_set_pin_output(LOCK_LED_PIN);
switch (get_highest_layer(state)) { switch (get_highest_layer(state)) {
case _LOCK: case _LOCK:
writePin(LOCK_LED_PIN, 0); gpio_write_pin(LOCK_LED_PIN, 0);
break; break;
default: // for any other layers, or the default layer default: // for any other layers, or the default layer
writePin(LOCK_LED_PIN, 1); gpio_write_pin(LOCK_LED_PIN, 1);
break; break;
} }
return state; return state;

View File

@ -46,9 +46,9 @@ layer_state_t layer_state_set_user(layer_state_t state) {
// override kb level function // override kb level function
bool led_update_user(led_t usb_led) { bool led_update_user(led_t usb_led) {
writePin(B1, !top); gpio_write_pin(B1, !top);
writePin(B2, !middle); gpio_write_pin(B2, !middle);
writePin(B3, !bottom); gpio_write_pin(B3, !bottom);
return false; // we are using LEDs for something else override kb return false; // we are using LEDs for something else override kb
} }
#endif #endif

View File

@ -95,15 +95,15 @@ void matrix_init_user(void) {
// Call the keymap level matrix init. // Call the keymap level matrix init.
// Set our LED pins as output // Set our LED pins as output
setPinOutput(C4); gpio_set_pin_output(C4);
setPinOutput(C5); gpio_set_pin_output(C5);
setPinOutput(C6); gpio_set_pin_output(C6);
} }
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
writePin(C4, led_state.num_lock); gpio_write_pin(C4, led_state.num_lock);
writePin(C5, led_state.caps_lock); gpio_write_pin(C5, led_state.caps_lock);
writePin(C6, led_state.scroll_lock); gpio_write_pin(C6, led_state.scroll_lock);
return false; return false;
} }

View File

@ -54,12 +54,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Show "Fun Lock" layer state via the "Fun Lock" LED */ /* Show "Fun Lock" layer state via the "Fun Lock" LED */
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
setPinOutput(LED_FUN_LOCK_PIN); gpio_set_pin_output(LED_FUN_LOCK_PIN);
if (layer_state_cmp(state, _FUNCTION)) if (layer_state_cmp(state, _FUNCTION))
writePinHigh(LED_FUN_LOCK_PIN); gpio_write_pin_high(LED_FUN_LOCK_PIN);
else else
writePinLow(LED_FUN_LOCK_PIN); gpio_write_pin_low(LED_FUN_LOCK_PIN);
return state; return state;
} }

View File

@ -25,15 +25,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
if (led_state.caps_lock) { if (led_state.caps_lock) {
writePinHigh(F1); gpio_write_pin_high(F1);
} else { } else {
writePinLow(F1); gpio_write_pin_low(F1);
} }
if (led_state.scroll_lock) { if (led_state.scroll_lock) {
writePinHigh(F0); gpio_write_pin_high(F0);
} else { } else {
writePinLow(F0); gpio_write_pin_low(F0);
} }
if (!led_state.num_lock) { if (!led_state.num_lock) {
@ -46,13 +46,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) { if (record->event.pressed) {
if (sysreq_led) { if (sysreq_led) {
sysreq_led = false; sysreq_led = false;
writePinLow(F4); gpio_write_pin_low(F4);
} }
else { else {
switch(keycode) { switch(keycode) {
case KC_SYSTEM_REQUEST: case KC_SYSTEM_REQUEST:
sysreq_led = true; sysreq_led = true;
writePinHigh(F4); gpio_write_pin_high(F4);
} }
} }
} }

View File

@ -25,15 +25,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
if (led_state.caps_lock) { if (led_state.caps_lock) {
writePinHigh(F1); gpio_write_pin_high(F1);
} else { } else {
writePinLow(F1); gpio_write_pin_low(F1);
} }
if (led_state.scroll_lock) { if (led_state.scroll_lock) {
writePinHigh(F0); gpio_write_pin_high(F0);
} else { } else {
writePinLow(F0); gpio_write_pin_low(F0);
} }
if (!led_state.num_lock) { if (!led_state.num_lock) {
@ -46,13 +46,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) { if (record->event.pressed) {
if (sysreq_led) { if (sysreq_led) {
sysreq_led = false; sysreq_led = false;
writePinLow(F4); gpio_write_pin_low(F4);
} }
else { else {
switch(keycode) { switch(keycode) {
case KC_SYSTEM_REQUEST: case KC_SYSTEM_REQUEST:
sysreq_led = true; sysreq_led = true;
writePinHigh(F4); gpio_write_pin_high(F4);
} }
} }
} }

View File

@ -84,16 +84,16 @@ layer_state_t layer_state_set_user(layer_state_t state) {
#ifdef JOTANCK_LEDS #ifdef JOTANCK_LEDS
switch (get_highest_layer(state)) { switch (get_highest_layer(state)) {
case _LOWER: case _LOWER:
writePinHigh(JOTANCK_LED1); gpio_write_pin_high(JOTANCK_LED1);
writePinLow(JOTANCK_LED2); gpio_write_pin_low(JOTANCK_LED2);
break; break;
case _RAISE: case _RAISE:
writePinLow(JOTANCK_LED1); gpio_write_pin_low(JOTANCK_LED1);
writePinHigh(JOTANCK_LED2); gpio_write_pin_high(JOTANCK_LED2);
break; break;
default: default:
writePinLow(JOTANCK_LED1); gpio_write_pin_low(JOTANCK_LED1);
writePinLow(JOTANCK_LED2); gpio_write_pin_low(JOTANCK_LED2);
break; break;
}; };
#endif #endif

View File

@ -76,15 +76,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
} }
void matrix_init_user(void) { void matrix_init_user(void) {
setPinOutput(C7); gpio_set_pin_output(C7);
writePinLow(C7); gpio_write_pin_low(C7);
} }
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
if (get_highest_layer(state)) { if (get_highest_layer(state)) {
writePinHigh(C7); gpio_write_pin_high(C7);
} else { } else {
writePinLow(C7); gpio_write_pin_low(C7);
} }
return state; return state;
} }

View File

@ -51,7 +51,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
case LEDCHANGE: case LEDCHANGE:
if (record->event.pressed) { if (record->event.pressed) {
led_state = !led_state; led_state = !led_state;
writePin(F6, led_state); gpio_write_pin(F6, led_state);
} }
break; break;
} }
@ -59,6 +59,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
} }
void matrix_init_user(void) { void matrix_init_user(void) {
setPinOutput(F6); gpio_set_pin_output(F6);
writePinLow(F6); gpio_write_pin_low(F6);
} }

View File

@ -67,16 +67,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
}; };
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
writePin(NUM_LOCK_LED_PIN, led_state.num_lock); gpio_write_pin(NUM_LOCK_LED_PIN, led_state.num_lock);
writePin(CAPS_LOCK_LED_PIN, led_state.caps_lock); gpio_write_pin(CAPS_LOCK_LED_PIN, led_state.caps_lock);
// writePin(SCROLL_LOCK_LED_PIN, led_state.scroll_lock); // gpio_write_pin(SCROLL_LOCK_LED_PIN, led_state.scroll_lock);
return false; return false;
} }
//function for layer indicator LED //function for layer indicator LED
layer_state_t layer_state_set_user(layer_state_t state) layer_state_t layer_state_set_user(layer_state_t state)
{ {
writePin(SCROLL_LOCK_LED_PIN, (get_highest_layer(state) == 1)); gpio_write_pin(SCROLL_LOCK_LED_PIN, (get_highest_layer(state) == 1));
return state; return state;
} }

View File

@ -52,16 +52,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
}; };
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
writePin(NUM_LOCK_LED_PIN, led_state.num_lock); gpio_write_pin(NUM_LOCK_LED_PIN, led_state.num_lock);
writePin(CAPS_LOCK_LED_PIN, led_state.caps_lock); gpio_write_pin(CAPS_LOCK_LED_PIN, led_state.caps_lock);
// writePin(SCROLL_LOCK_LED_PIN, led_state.scroll_lock); // gpio_write_pin(SCROLL_LOCK_LED_PIN, led_state.scroll_lock);
return false; return false;
} }
//function for layer indicator LED //function for layer indicator LED
layer_state_t layer_state_set_user(layer_state_t state) layer_state_t layer_state_set_user(layer_state_t state)
{ {
writePin(SCROLL_LOCK_LED_PIN, (get_highest_layer(state) == 1)); gpio_write_pin(SCROLL_LOCK_LED_PIN, (get_highest_layer(state) == 1));
return state; return state;
} }

View File

@ -150,18 +150,18 @@ layer_state_t layer_state_set_user(layer_state_t state) {
/* Use LED0 and 4 (Kana and KB Lock as layer indicators) */ /* Use LED0 and 4 (Kana and KB Lock as layer indicators) */
switch (get_highest_layer(state)) { switch (get_highest_layer(state)) {
case _FN: case _FN:
writePinLow(LED_KANA_PIN); gpio_write_pin_low(LED_KANA_PIN);
break; break;
case _MUS: case _MUS:
writePinLow(LED_KB_LOCK_PIN); gpio_write_pin_low(LED_KB_LOCK_PIN);
break; break;
case _LOCK: case _LOCK:
writePinLow(LED_KANA_PIN); gpio_write_pin_low(LED_KANA_PIN);
writePinLow(LED_KB_LOCK_PIN); gpio_write_pin_low(LED_KB_LOCK_PIN);
break; break;
default: // for any other layers, or the default layer default: // for any other layers, or the default layer
writePinHigh(LED_KANA_PIN); gpio_write_pin_high(LED_KANA_PIN);
writePinHigh(LED_KB_LOCK_PIN); gpio_write_pin_high(LED_KB_LOCK_PIN);
break; break;
} }
return state; return state;

View File

@ -50,10 +50,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
void matrix_scan_user(void) { void matrix_scan_user(void) {
writePin(A7, layer_state_is(1)); gpio_write_pin(A7, layer_state_is(1));
} }
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
writePin(LED_CAPS_LOCK_PIN, led_state.caps_lock); gpio_write_pin(LED_CAPS_LOCK_PIN, led_state.caps_lock);
return false; return false;
}; };

View File

@ -73,6 +73,6 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
#endif #endif
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
writePin(C0, layer_state_cmp(state, 1)); gpio_write_pin(C0, layer_state_cmp(state, 1));
return state; return state;
}; };

View File

@ -73,6 +73,6 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
#endif #endif
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
writePin(C0, layer_state_cmp(state, 1)); gpio_write_pin(C0, layer_state_cmp(state, 1));
return state; return state;
}; };

View File

@ -132,12 +132,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
} }
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
writePin(B1, led_state.num_lock); gpio_write_pin(B1, led_state.num_lock);
return false; return false;
} }
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
writePin(B3, !IS_LAYER_ON_STATE(state, 0)); gpio_write_pin(B3, !IS_LAYER_ON_STATE(state, 0));
return state; return state;
} }

View File

@ -28,7 +28,7 @@ LAYOUT_ortho_4x4(
// Only for Rev1 & Rev2 // Only for Rev1 & Rev2
#ifdef LED_RED #ifdef LED_RED
void keyboard_post_init_user(void) { void keyboard_post_init_user(void) {
writePinHigh(LED_RED); gpio_write_pin_high(LED_RED);
} }
#endif #endif

View File

@ -41,7 +41,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// Only for Rev1 & Rev2 // Only for Rev1 & Rev2
#ifdef LED_RED #ifdef LED_RED
void keyboard_post_init_user(void) { void keyboard_post_init_user(void) {
writePinHigh(LED_RED); gpio_write_pin_high(LED_RED);
} }
#endif #endif

View File

@ -99,13 +99,13 @@ void tk_finished(tap_dance_state_t *state, void *user_data){
layer_off(_ML1); layer_off(_ML1);
//turn off the indicator LED //turn off the indicator LED
//set LED HI to turn it off //set LED HI to turn it off
writePinHigh(INDICATOR_LED); gpio_write_pin_high(INDICATOR_LED);
} else { } else {
//turn on the media layer //turn on the media layer
layer_on(_ML1); layer_on(_ML1);
//turn on the indicator LED //turn on the indicator LED
//set LED pin to LOW to turn it on //set LED pin to LOW to turn it on
writePinLow(INDICATOR_LED); gpio_write_pin_low(INDICATOR_LED);
} }
break; break;
case SINGLE_HOLD: case SINGLE_HOLD:

View File

@ -97,6 +97,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
writePin(LED4_PIN, layer_state_cmp(state, _NM)); gpio_write_pin(LED4_PIN, layer_state_cmp(state, _NM));
return state; return state;
} }

View File

@ -111,11 +111,11 @@ KC_GRV,KC_LGUI,KC_ESC,MO(_NUMPAD), KC_LBRC,
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
//set LEDs which are triggered by a layer change //set LEDs which are triggered by a layer change
#ifdef LED_COMPOSE_PIN #ifdef LED_COMPOSE_PIN
writePin(LED_COMPOSE_PIN, !layer_state_cmp(state, _KEYPAD)); gpio_write_pin(LED_COMPOSE_PIN, !layer_state_cmp(state, _KEYPAD));
#endif #endif
#ifdef LED_NUM_LOCK_PIN #ifdef LED_NUM_LOCK_PIN
writePin(LED_NUM_LOCK_PIN, !layer_state_cmp(state, _NUMPAD)); gpio_write_pin(LED_NUM_LOCK_PIN, !layer_state_cmp(state, _NUMPAD));
#endif #endif
return state; return state;
@ -123,11 +123,11 @@ layer_state_t layer_state_set_user(layer_state_t state) {
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
#ifdef LED_CAPS_LOCK_PIN #ifdef LED_CAPS_LOCK_PIN
writePin(LED_CAPS_LOCK_PIN, !led_state.caps_lock); gpio_write_pin(LED_CAPS_LOCK_PIN, !led_state.caps_lock);
#endif #endif
#ifdef LED_SCROLL_LOCK_PIN #ifdef LED_SCROLL_LOCK_PIN
writePin(LED_SCROLL_LOCK_PIN, !led_state.scroll_lock); gpio_write_pin(LED_SCROLL_LOCK_PIN, !led_state.scroll_lock);
#endif #endif
//disable default processing of LEDs //disable default processing of LEDs

View File

@ -41,9 +41,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
if (led_state.caps_lock) { if (led_state.caps_lock) {
writePinLow(B1); gpio_write_pin_low(B1);
} else { } else {
writePinHigh(B1); gpio_write_pin_high(B1);
} }
return false; return false;
} }

View File

@ -173,8 +173,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Joystick + Encoder fix */ /* Joystick + Encoder fix */
void keyboard_post_init_kb(void) { void keyboard_post_init_kb(void) {
if (is_keyboard_master()) { if (is_keyboard_master()) {
writePinLow(JOYSTICK_X_PIN); gpio_write_pin_low(JOYSTICK_X_PIN);
writePinLow(JOYSTICK_Y_PIN); gpio_write_pin_low(JOYSTICK_Y_PIN);
} }
} }

View File

@ -60,9 +60,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
state = update_tri_layer_state(state, _4, X_PAUSE, X_PAUSE); state = update_tri_layer_state(state, _4, X_PAUSE, X_PAUSE);
writePin(IND_1, layer_state_cmp(state, 1)); gpio_write_pin(IND_1, layer_state_cmp(state, 1));
writePin(IND_2, layer_state_cmp(state, 2)); gpio_write_pin(IND_2, layer_state_cmp(state, 2));
writePin(IND_3, layer_state_cmp(state, 3)); gpio_write_pin(IND_3, layer_state_cmp(state, 3));
return state; return state;
} }
@ -89,13 +89,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
void matrix_init_user(void) { void matrix_init_user(void) {
//init the Pro Micro on-board LEDs //init the Pro Micro on-board LEDs
setPinOutput(IND_1); gpio_set_pin_output(IND_1);
setPinOutput(IND_2); gpio_set_pin_output(IND_2);
setPinOutput(IND_3); gpio_set_pin_output(IND_3);
//set to off //set to off
writePinHigh(IND_1); gpio_write_pin_high(IND_1);
writePinHigh(IND_2); gpio_write_pin_high(IND_2);
writePinHigh(IND_3); gpio_write_pin_high(IND_3);
} }
bool encoder_update_user(uint8_t index, bool clockwise) { bool encoder_update_user(uint8_t index, bool clockwise) {

View File

@ -60,9 +60,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
state = update_tri_layer_state(state, _4, X_PAUSE, X_PAUSE); state = update_tri_layer_state(state, _4, X_PAUSE, X_PAUSE);
writePin(IND_1, layer_state_cmp(state, 1)); gpio_write_pin(IND_1, layer_state_cmp(state, 1));
writePin(IND_2, layer_state_cmp(state, 2)); gpio_write_pin(IND_2, layer_state_cmp(state, 2));
writePin(IND_3, layer_state_cmp(state, 3)); gpio_write_pin(IND_3, layer_state_cmp(state, 3));
return state; return state;
} }
@ -89,13 +89,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
void matrix_init_user(void) { void matrix_init_user(void) {
//init the Pro Micro on-board LEDs //init the Pro Micro on-board LEDs
setPinOutput(IND_1); gpio_set_pin_output(IND_1);
setPinOutput(IND_2); gpio_set_pin_output(IND_2);
setPinOutput(IND_3); gpio_set_pin_output(IND_3);
//set to off //set to off
writePinHigh(IND_1); gpio_write_pin_high(IND_1);
writePinHigh(IND_2); gpio_write_pin_high(IND_2);
writePinHigh(IND_3); gpio_write_pin_high(IND_3);
} }
bool encoder_update_user(uint8_t index, bool clockwise) { bool encoder_update_user(uint8_t index, bool clockwise) {

View File

@ -156,7 +156,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
// for exsample customize of LED inducator // for exsample customize of LED inducator
// bool led_update_user(led_t led_state) { // bool led_update_user(led_t led_state) {
// writePin(D2, IS_LAYER_ON(_LOWER)); // gpio_write_pin(D2, IS_LAYER_ON(_LOWER));
// writePin(D1, IS_LAYER_ON(_RAISE)); // gpio_write_pin(D1, IS_LAYER_ON(_RAISE));
// return false; // return false;
// } // }

View File

@ -156,7 +156,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
// for exsample customize of LED inducator // for exsample customize of LED inducator
// bool led_update_user(led_t led_state) { // bool led_update_user(led_t led_state) {
// writePin(D2, IS_LAYER_ON(_LOWER)); // gpio_write_pin(D2, IS_LAYER_ON(_LOWER));
// writePin(D1, IS_LAYER_ON(_RAISE)); // gpio_write_pin(D1, IS_LAYER_ON(_RAISE));
// return false; // return false;
// } // }

View File

@ -36,12 +36,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) { switch (keycode) {
case LOGO_LED_ON: case LOGO_LED_ON:
if (record->event.pressed) { if (record->event.pressed) {
writePinLow(D7); gpio_write_pin_low(D7);
} }
break; break;
case LOGO_LED_OFF: case LOGO_LED_OFF:
if (record->event.pressed) { if (record->event.pressed) {
writePinHigh(D7); gpio_write_pin_high(D7);
} }
break; break;
} }

View File

@ -59,12 +59,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) { switch (keycode) {
case LOGO_LED_ON: case LOGO_LED_ON:
if (record->event.pressed) { if (record->event.pressed) {
writePinLow(D7); gpio_write_pin_low(D7);
} }
break; break;
case LOGO_LED_OFF: case LOGO_LED_OFF:
if (record->event.pressed) { if (record->event.pressed) {
writePinHigh(D7); gpio_write_pin_high(D7);
} }
break; break;
} }

View File

@ -32,12 +32,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) { switch (keycode) {
case BL_ON: case BL_ON:
if (record->event.pressed) { if (record->event.pressed) {
writePinHigh(B7); gpio_write_pin_high(B7);
} }
break; break;
case BL_OFF: case BL_OFF:
if (record->event.pressed) { if (record->event.pressed) {
writePinLow(B7); gpio_write_pin_low(B7);
} }
break; break;
} }

View File

@ -57,12 +57,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) { switch (keycode) {
case LOGO_LED_ON: case LOGO_LED_ON:
if (record->event.pressed) { if (record->event.pressed) {
writePinHigh(B7); gpio_write_pin_high(B7);
} }
break; break;
case LOGO_LED_OFF: case LOGO_LED_OFF:
if (record->event.pressed) { if (record->event.pressed) {
writePinLow(B7); gpio_write_pin_low(B7);
} }
break; break;
} }

View File

@ -30,32 +30,32 @@ static const pin_t row_pins[] = MATRIX_ROW_PINS;
static const pin_t col_pins[] = MATRIX_COL_PINS; static const pin_t col_pins[] = MATRIX_COL_PINS;
static void select_row(uint8_t row) { static void select_row(uint8_t row) {
setPinOutput(row_pins[row]); gpio_set_pin_output(row_pins[row]);
writePinLow(row_pins[row]); gpio_write_pin_low(row_pins[row]);
} }
static void unselect_row(uint8_t row) { static void unselect_row(uint8_t row) {
setPinInputHigh(row_pins[row]); gpio_set_pin_input_high(row_pins[row]);
} }
static void unselect_rows(void) { static void unselect_rows(void) {
for (uint8_t x = 0; x < MATRIX_ROWS; x++) { for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
setPinInputHigh(row_pins[x]); gpio_set_pin_input_high(row_pins[x]);
} }
} }
static void select_col(uint8_t col) { static void select_col(uint8_t col) {
setPinOutput(col_pins[col]); gpio_set_pin_output(col_pins[col]);
writePinLow(col_pins[col]); gpio_write_pin_low(col_pins[col]);
} }
static void unselect_col(uint8_t col) { static void unselect_col(uint8_t col) {
setPinInputHigh(col_pins[col]); gpio_set_pin_input_high(col_pins[col]);
} }
static void unselect_cols(void) { static void unselect_cols(void) {
for (uint8_t x = 0; x < MATRIX_COLS/2; x++) { for (uint8_t x = 0; x < MATRIX_COLS/2; x++) {
setPinInputHigh(col_pins[x*2]); gpio_set_pin_input_high(col_pins[x*2]);
} }
} }
@ -76,7 +76,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
for (uint8_t col_index = 0; col_index < MATRIX_COLS / 2; col_index++) { for (uint8_t col_index = 0; col_index < MATRIX_COLS / 2; col_index++) {
uint16_t column_index_bitmask = ROW_SHIFTER << ((col_index * 2) + 1); uint16_t column_index_bitmask = ROW_SHIFTER << ((col_index * 2) + 1);
// Check row pin state // Check row pin state
if (readPin(col_pins[col_index*2])) { if (gpio_read_pin(col_pins[col_index*2])) {
// Pin HI, clear col bit // Pin HI, clear col bit
current_matrix[current_row] &= ~column_index_bitmask; current_matrix[current_row] &= ~column_index_bitmask;
} else { } else {
@ -105,7 +105,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
uint16_t column_index_bitmask = ROW_SHIFTER << (current_col * 2); uint16_t column_index_bitmask = ROW_SHIFTER << (current_col * 2);
// Check row pin state // Check row pin state
if (readPin(row_pins[row_index])) { if (gpio_read_pin(row_pins[row_index])) {
// Pin HI, clear col bit // Pin HI, clear col bit
current_matrix[row_index] &= ~column_index_bitmask; current_matrix[row_index] &= ~column_index_bitmask;
} else { } else {

View File

@ -54,11 +54,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
if (led_state.caps_lock) { if (led_state.caps_lock) {
setPinOutput(B6); gpio_set_pin_output(B6);
writePinHigh(B6); gpio_write_pin_high(B6);
} else { } else {
setPinInput(B6); gpio_set_pin_input(B6);
writePinLow(B6); gpio_write_pin_low(B6);
} }
return false; return false;
} }

View File

@ -72,12 +72,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
if (led_state.caps_lock) { if (led_state.caps_lock) {
setPinOutput(B6); gpio_set_pin_output(B6);
writePinHigh(B6); gpio_write_pin_high(B6);
} }
else { else {
setPinInput(B6); gpio_set_pin_input(B6);
writePinLow(B6); gpio_write_pin_low(B6);
} }
return false; return false;
} }

View File

@ -54,11 +54,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
if (led_state.caps_lock) { if (led_state.caps_lock) {
setPinOutput(B6); gpio_set_pin_output(B6);
writePinHigh(B6); gpio_write_pin_high(B6);
} else { } else {
setPinInput(B6); gpio_set_pin_input(B6);
writePinLow(B6); gpio_write_pin_low(B6);
} }
return false; return false;
} }

View File

@ -55,27 +55,27 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
if (led_state.num_lock) { if (led_state.num_lock) {
setPinOutput(B0); gpio_set_pin_output(B0);
writePinLow(B0); gpio_write_pin_low(B0);
} else { } else {
setPinInput(B0); gpio_set_pin_input(B0);
writePinLow(B0); gpio_write_pin_low(B0);
} }
if (led_state.caps_lock) { if (led_state.caps_lock) {
setPinOutput(B1); gpio_set_pin_output(B1);
writePinLow(B1); gpio_write_pin_low(B1);
} else { } else {
setPinInput(B1); gpio_set_pin_input(B1);
writePinLow(B1); gpio_write_pin_low(B1);
} }
if (led_state.scroll_lock) { if (led_state.scroll_lock) {
setPinOutput(B2); gpio_set_pin_output(B2);
writePinLow(B2); gpio_write_pin_low(B2);
} else { } else {
setPinInput(B2); gpio_set_pin_input(B2);
writePinLow(B2); gpio_write_pin_low(B2);
} }
return false; return false;
} }

View File

@ -50,23 +50,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
}; };
void keyboard_pre_init_user() { void keyboard_pre_init_user() {
writePin(LED1, true); gpio_write_pin(LED1, true);
writePin(LED2, true); gpio_write_pin(LED2, true);
} }
void keyboard_post_init_user() { void keyboard_post_init_user() {
writePin(LED1, false); gpio_write_pin(LED1, false);
writePin(LED2, false); gpio_write_pin(LED2, false);
} }
bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record) {
writePin(LED1, record->event.pressed); gpio_write_pin(LED1, record->event.pressed);
return true; return true;
} }
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
writePin(LED2, state); gpio_write_pin(LED2, state);
return state; return state;
} }

View File

@ -210,12 +210,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
backlight_step(); backlight_step();
#endif #endif
#ifdef KEYBOARD_planck_rev5 #ifdef KEYBOARD_planck_rev5
writePinLow(E6); gpio_write_pin_low(E6);
#endif #endif
} else { } else {
unregister_code(KC_RSFT); unregister_code(KC_RSFT);
#ifdef KEYBOARD_planck_rev5 #ifdef KEYBOARD_planck_rev5
writePinHigh(E6); gpio_write_pin_high(E6);
#endif #endif
} }
return false; return false;

View File

@ -22,11 +22,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
if (led_state.caps_lock) { if (led_state.caps_lock) {
setPinOutput(F4); gpio_set_pin_output(F4);
writePinLow(F4); gpio_write_pin_low(F4);
} else { } else {
setPinInput(F4); gpio_set_pin_input(F4);
writePinLow(F4); gpio_write_pin_low(F4);
} }
return false; return false;
} }

View File

@ -216,12 +216,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
rgblight_step(); rgblight_step();
#endif #endif
#ifdef __AVR__ #ifdef __AVR__
writePinLow(E6); gpio_write_pin_low(E6);
#endif #endif
} else { } else {
unregister_code(KC_RSFT); unregister_code(KC_RSFT);
#ifdef __AVR__ #ifdef __AVR__
writePinHigh(E6); gpio_write_pin_high(E6);
#endif #endif
} }
return false; return false;

View File

@ -47,26 +47,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
void matrix_init_user(void) { void matrix_init_user(void) {
// set CapsLock LED to output and low // set CapsLock LED to output and low
setPinOutput(B1); gpio_set_pin_output(B1);
writePinLow(B1); gpio_write_pin_low(B1);
// set NumLock LED to output and low // set NumLock LED to output and low
setPinOutput(B2); gpio_set_pin_output(B2);
writePinLow(B2); gpio_write_pin_low(B2);
// set ScrollLock LED to output and low // set ScrollLock LED to output and low
setPinOutput(B3); gpio_set_pin_output(B3);
writePinLow(B3); gpio_write_pin_low(B3);
} }
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
if (led_state.num_lock) { if (led_state.num_lock) {
writePinHigh(B2); gpio_write_pin_high(B2);
} else { } else {
writePinLow(B2); gpio_write_pin_low(B2);
} }
if (led_state.caps_lock) { if (led_state.caps_lock) {
writePinHigh(B1); gpio_write_pin_high(B1);
} else { } else {
writePinLow(B1); gpio_write_pin_low(B1);
} }
return false; return false;
} }
@ -75,9 +75,9 @@ bool led_update_user(led_t led_state) {
layer_state_t layer_state_set_user(layer_state_t state) layer_state_t layer_state_set_user(layer_state_t state)
{ {
if (get_highest_layer(state) == 1) { if (get_highest_layer(state) == 1) {
writePinHigh(B3); gpio_write_pin_high(B3);
} else { } else {
writePinLow(B3); gpio_write_pin_low(B3);
} }
return state; return state;
} }

View File

@ -75,26 +75,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
void matrix_init_user(void) { void matrix_init_user(void) {
// set CapsLock LED to output and low // set CapsLock LED to output and low
setPinOutput(B1); gpio_set_pin_output(B1);
writePinLow(B1); gpio_write_pin_low(B1);
// set NumLock LED to output and low // set NumLock LED to output and low
setPinOutput(B2); gpio_set_pin_output(B2);
writePinLow(B2); gpio_write_pin_low(B2);
// set ScrollLock LED to output and low // set ScrollLock LED to output and low
setPinOutput(B3); gpio_set_pin_output(B3);
writePinLow(B3); gpio_write_pin_low(B3);
} }
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
if (led_state.num_lock) { if (led_state.num_lock) {
writePinHigh(B2); gpio_write_pin_high(B2);
} else { } else {
writePinLow(B2); gpio_write_pin_low(B2);
} }
if (led_state.caps_lock) { if (led_state.caps_lock) {
writePinHigh(B1); gpio_write_pin_high(B1);
} else { } else {
writePinLow(B1); gpio_write_pin_low(B1);
} }
return false; return false;
} }
@ -103,9 +103,9 @@ bool led_update_user(led_t led_state) {
layer_state_t layer_state_set_user(layer_state_t state) layer_state_t layer_state_set_user(layer_state_t state)
{ {
if (get_highest_layer(state) == 1) { if (get_highest_layer(state) == 1) {
writePinHigh(B3); gpio_write_pin_high(B3);
} else { } else {
writePinLow(B3); gpio_write_pin_low(B3);
} }
return state; return state;
} }

View File

@ -69,7 +69,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
void led_keypress_update(pin_t led_pin, uint16_t keycode, keyrecord_t *record) { void led_keypress_update(pin_t led_pin, uint16_t keycode, keyrecord_t *record) {
// When a key is pressed turn on the LED, when released turn it off // When a key is pressed turn on the LED, when released turn it off
writePin(led_pin, record->event.pressed); gpio_write_pin(led_pin, record->event.pressed);
} }
bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record) {

View File

@ -64,7 +64,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
void led_keypress_update(pin_t led_pin, uint16_t keycode, keyrecord_t *record) { void led_keypress_update(pin_t led_pin, uint16_t keycode, keyrecord_t *record) {
// When a key is pressed turn on the LED, when released turn it off // When a key is pressed turn on the LED, when released turn it off
writePin(led_pin, record->event.pressed); gpio_write_pin(led_pin, record->event.pressed);
} }
bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record) {

View File

@ -51,20 +51,20 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
void matrix_init_user(void) { void matrix_init_user(void) {
// set top LED to output and off (active low) // set top LED to output and off (active low)
setPinOutput(D5); gpio_set_pin_output(D5);
writePinHigh(D5); gpio_write_pin_high(D5);
// set middle LED to output and off (active low) // set middle LED to output and off (active low)
setPinOutput(D4); gpio_set_pin_output(D4);
writePinHigh(D4); gpio_write_pin_high(D4);
// set bottom LED to output and off (active low) // set bottom LED to output and off (active low)
setPinOutput(D3); gpio_set_pin_output(D3);
writePinHigh(D3); gpio_write_pin_high(D3);
} }
// write to above indicators in a binary fashion based on current layer // write to above indicators in a binary fashion based on current layer
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
writePin(D5, get_highest_layer(state)); gpio_write_pin(D5, get_highest_layer(state));
writePin(D4, !layer_state_cmp(state, 1)); gpio_write_pin(D4, !layer_state_cmp(state, 1));
writePin(D3, !layer_state_cmp(state, 2)); gpio_write_pin(D3, !layer_state_cmp(state, 2));
return state; return state;
} }

View File

@ -51,20 +51,20 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
void matrix_init_user(void) { void matrix_init_user(void) {
// set top LED to output and off (active low) // set top LED to output and off (active low)
setPinOutput(D5); gpio_set_pin_output(D5);
writePinHigh(D5); gpio_write_pin_high(D5);
// set middle LED to output and off (active low) // set middle LED to output and off (active low)
setPinOutput(D4); gpio_set_pin_output(D4);
writePinHigh(D4); gpio_write_pin_high(D4);
// set bottom LED to output and off (active low) // set bottom LED to output and off (active low)
setPinOutput(D3); gpio_set_pin_output(D3);
writePinHigh(D3); gpio_write_pin_high(D3);
} }
// write to above indicators in a binary fashion based on current layer // write to above indicators in a binary fashion based on current layer
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
writePin(D5, get_highest_layer(state)); gpio_write_pin(D5, get_highest_layer(state));
writePin(D4, !layer_state_cmp(state, 1)); gpio_write_pin(D4, !layer_state_cmp(state, 1));
writePin(D3, !layer_state_cmp(state, 2)); gpio_write_pin(D3, !layer_state_cmp(state, 2));
return state; return state;
} }

View File

@ -77,11 +77,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
if (led_state.caps_lock) { if (led_state.caps_lock) {
setPinOutput(A3); gpio_set_pin_output(A3);
writePinHigh(A3); gpio_write_pin_high(A3);
} else { } else {
setPinInput(A3); gpio_set_pin_input(A3);
writePinLow(A3); gpio_write_pin_low(A3);
} }
return false; return false;
} }

View File

@ -20,26 +20,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
}; };
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
setPinOutput(B4); gpio_set_pin_output(B4);
setPinOutput(D6); gpio_set_pin_output(D6);
setPinOutput(D7); gpio_set_pin_output(D7);
if (led_state.num_lock) { if (led_state.num_lock) {
writePinHigh(D7); gpio_write_pin_high(D7);
} else { } else {
writePinLow(D7); gpio_write_pin_low(D7);
} }
if (led_state.caps_lock) { if (led_state.caps_lock) {
writePinHigh(B4); gpio_write_pin_high(B4);
} else { } else {
writePinLow(B4); gpio_write_pin_low(B4);
} }
if (led_state.scroll_lock) { if (led_state.scroll_lock) {
writePinHigh(D6); gpio_write_pin_high(D6);
} else { } else {
writePinLow(D6); gpio_write_pin_low(D6);
} }
return false; return false;
} }

View File

@ -75,30 +75,30 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
}; };
void keyboard_pre_init_user(void) { void keyboard_pre_init_user(void) {
setPinOutput(F5); // initialize F5 for LED gpio_set_pin_output(F5); // initialize F5 for LED
setPinOutput(F6); // initialize F6 for LED gpio_set_pin_output(F6); // initialize F6 for LED
setPinOutput(F7); // initialize F7 for LED gpio_set_pin_output(F7); // initialize F7 for LED
} }
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
writePinLow(F5); gpio_write_pin_low(F5);
writePinLow(F6); gpio_write_pin_low(F6);
writePinLow(F7); gpio_write_pin_low(F7);
switch (get_highest_layer(state)) { switch (get_highest_layer(state)) {
case _FN1: case _FN1:
writePinHigh(F5); gpio_write_pin_high(F5);
break; break;
case _FN2: case _FN2:
writePinHigh(F6); gpio_write_pin_high(F6);
break; break;
case _FN3: // replace 'XXXX' with the layer or function name case _FN3: // replace 'XXXX' with the layer or function name
writePinHigh(F7); gpio_write_pin_high(F7);
break; break;
case KC_F24: case KC_F24:
writePinHigh(F7); gpio_write_pin_high(F7);
writePinHigh(F5); gpio_write_pin_high(F5);
writePinHigh(F6); gpio_write_pin_high(F6);
break; break;
} }
return state; return state;

View File

@ -75,38 +75,38 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
}; };
void keyboard_pre_init_user(void) { void keyboard_pre_init_user(void) {
setPinOutput(F5); // initialize F5 for LED gpio_set_pin_output(F5); // initialize F5 for LED
setPinOutput(F6); // initialize F6 for LED gpio_set_pin_output(F6); // initialize F6 for LED
setPinOutput(F7); // initialize F7 for LED gpio_set_pin_output(F7); // initialize F7 for LED
} }
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
switch (get_highest_layer(state)) { switch (get_highest_layer(state)) {
case _FN1: case _FN1:
writePinHigh(F5); gpio_write_pin_high(F5);
writePinLow(F6); gpio_write_pin_low(F6);
writePinLow(F7); gpio_write_pin_low(F7);
break; break;
case _FN2: case _FN2:
writePinHigh(F6); gpio_write_pin_high(F6);
writePinLow(F5); gpio_write_pin_low(F5);
writePinLow(F7); gpio_write_pin_low(F7);
break; break;
case _FN3: // replace 'XXXX' with the layer or function name case _FN3: // replace 'XXXX' with the layer or function name
writePinHigh(F7); gpio_write_pin_high(F7);
writePinLow(F5); gpio_write_pin_low(F5);
writePinLow(F6); gpio_write_pin_low(F6);
break; break;
case KC_F24: case KC_F24:
writePinHigh(F7); gpio_write_pin_high(F7);
writePinHigh(F5); gpio_write_pin_high(F5);
writePinHigh(F6); gpio_write_pin_high(F6);
break; break;
default: default:
writePinLow(F5); gpio_write_pin_low(F5);
writePinLow(F6); gpio_write_pin_low(F6);
writePinLow(F7); gpio_write_pin_low(F7);
break; break;
} }
return state; return state;

View File

@ -49,38 +49,38 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//Initialize indicator LEDs //Initialize indicator LEDs
void matrix_init_user(void) { void matrix_init_user(void) {
setPinOutput(B5); gpio_set_pin_output(B5);
writePinLow(B5); gpio_write_pin_low(B5);
setPinOutput(B6); gpio_set_pin_output(B6);
writePinLow(B6); gpio_write_pin_low(B6);
setPinOutput(B7); gpio_set_pin_output(B7);
writePinLow(B7); gpio_write_pin_low(B7);
} }
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
switch (get_highest_layer(state)) { switch (get_highest_layer(state)) {
case 1: case 1:
writePinHigh(B7); gpio_write_pin_high(B7);
writePinLow(B6); gpio_write_pin_low(B6);
break; break;
case 2: case 2:
writePinLow(B7); gpio_write_pin_low(B7);
writePinHigh(B6); gpio_write_pin_high(B6);
break; break;
case 3: case 3:
writePinHigh(B7); gpio_write_pin_high(B7);
writePinHigh(B6); gpio_write_pin_high(B6);
break; break;
default: default:
writePinLow(B7); gpio_write_pin_low(B7);
writePinLow(B6); gpio_write_pin_low(B6);
break; break;
} }
return state; return state;
} }
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
writePin(B5, led_state.caps_lock); gpio_write_pin(B5, led_state.caps_lock);
return false; return false;
} }

View File

@ -49,34 +49,34 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//Initialize indicator LEDs //Initialize indicator LEDs
void matrix_init_user(void) { void matrix_init_user(void) {
setPinOutput(B5); gpio_set_pin_output(B5);
writePinLow(B5); gpio_write_pin_low(B5);
setPinOutput(B6); gpio_set_pin_output(B6);
writePinLow(B6); gpio_write_pin_low(B6);
setPinOutput(B7); gpio_set_pin_output(B7);
writePinLow(B7); gpio_write_pin_low(B7);
} }
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
writePinLow(B7); gpio_write_pin_low(B7);
writePinLow(B6); gpio_write_pin_low(B6);
switch (get_highest_layer(state)) { switch (get_highest_layer(state)) {
case 1: case 1:
writePinHigh(B7); gpio_write_pin_high(B7);
break; break;
case 2: case 2:
writePinHigh(B6); gpio_write_pin_high(B6);
break; break;
case 3: case 3:
writePinHigh(B7); gpio_write_pin_high(B7);
writePinHigh(B6); gpio_write_pin_high(B6);
break; break;
} }
return state; return state;
} }
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
writePin(B5, led_state.caps_lock); gpio_write_pin(B5, led_state.caps_lock);
return false; return false;
} }

View File

@ -49,38 +49,38 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//Initialize indicator LEDs //Initialize indicator LEDs
void matrix_init_user(void) { void matrix_init_user(void) {
setPinOutput(B5); gpio_set_pin_output(B5);
writePinLow(B5); gpio_write_pin_low(B5);
setPinOutput(B6); gpio_set_pin_output(B6);
writePinLow(B6); gpio_write_pin_low(B6);
setPinOutput(B7); gpio_set_pin_output(B7);
writePinLow(B7); gpio_write_pin_low(B7);
} }
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
switch (get_highest_layer(state)) { switch (get_highest_layer(state)) {
case 1: case 1:
writePinHigh(B7); gpio_write_pin_high(B7);
writePinLow(B6); gpio_write_pin_low(B6);
break; break;
case 2: case 2:
writePinLow(B7); gpio_write_pin_low(B7);
writePinHigh(B6); gpio_write_pin_high(B6);
break; break;
case 3: case 3:
writePinHigh(B7); gpio_write_pin_high(B7);
writePinHigh(B6); gpio_write_pin_high(B6);
break; break;
default: default:
writePinLow(B7); gpio_write_pin_low(B7);
writePinLow(B6); gpio_write_pin_low(B6);
break; break;
} }
return state; return state;
} }
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
writePin(B5, led_state.caps_lock); gpio_write_pin(B5, led_state.caps_lock);
return false; return false;
} }

View File

@ -54,13 +54,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
// Insert custom handling for CAPS_LOCK, NUM_LOCK, SCROLL_LOCK here // Insert custom handling for CAPS_LOCK, NUM_LOCK, SCROLL_LOCK here
if (led_state.num_lock) { if (led_state.num_lock) {
writePinHigh(F4); gpio_write_pin_high(F4);
writePinHigh(F1); gpio_write_pin_high(F1);
writePinHigh(F5); gpio_write_pin_high(F5);
} else { } else {
writePinLow(F4); gpio_write_pin_low(F4);
writePinLow(F1); gpio_write_pin_low(F1);
writePinLow(F5); gpio_write_pin_low(F5);
} }
return false; return false;
} }

View File

@ -114,20 +114,20 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
} }
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
writePinLow(B2); gpio_write_pin_low(B2);
writePinLow(B3); gpio_write_pin_low(B3);
writePinLow(B7); gpio_write_pin_low(B7);
if (work_louder_config.led_level) { if (work_louder_config.led_level) {
switch (get_highest_layer(state)) { switch (get_highest_layer(state)) {
case 1: case 1:
writePinHigh(B2); gpio_write_pin_high(B2);
break; break;
case 2: case 2:
writePinHigh(B3); gpio_write_pin_high(B3);
break; break;
case 3: case 3:
writePinHigh(B7); gpio_write_pin_high(B7);
break; break;
} }
} }

View File

@ -56,26 +56,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
switch (get_highest_layer(state)) { switch (get_highest_layer(state)) {
case _FN: case _FN:
writePinHigh(D3); gpio_write_pin_high(D3);
writePinLow(D2); gpio_write_pin_low(D2);
break; break;
case _FNCHAR: case _FNCHAR:
writePinLow(D3); gpio_write_pin_low(D3);
writePinHigh(D2); gpio_write_pin_high(D2);
break; break;
case _FKEYS: case _FKEYS:
writePinHigh(D3); gpio_write_pin_high(D3);
writePinHigh(D2); gpio_write_pin_high(D2);
break; break;
default: // for any other layers, or the default layer default: // for any other layers, or the default layer
writePinLow(D3); gpio_write_pin_low(D3);
writePinLow(D2); gpio_write_pin_low(D2);
break; break;
} }
return state; return state;
} }
bool led_update_user(led_t led_state) { bool led_update_user(led_t led_state) {
writePin(D0, led_state.caps_lock); gpio_write_pin(D0, led_state.caps_lock);
return false; return false;
} }

View File

@ -32,21 +32,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
void matrix_init_user(void) { void matrix_init_user(void) {
// set CapsLock LED to output and low // set CapsLock LED to output and low
setPinOutput(F6); gpio_set_pin_output(F6);
writePinLow(F6); gpio_write_pin_low(F6);
// set NumLock LED to output and low // set NumLock LED to output and low
setPinOutput(F5); gpio_set_pin_output(F5);
writePinLow(F5); gpio_write_pin_low(F5);
// set ScrollLock LED to output and low // set ScrollLock LED to output and low
setPinOutput(F4); gpio_set_pin_output(F4);
writePinLow(F4); gpio_write_pin_low(F4);
} }
layer_state_t layer_state_set_user(layer_state_t state) layer_state_t layer_state_set_user(layer_state_t state)
{ {
writePin(F4, (state & 0x1)); gpio_write_pin(F4, (state & 0x1));
writePin(F5, (state & 0x2)); gpio_write_pin(F5, (state & 0x2));
writePin(F6, (state & 0x4)); gpio_write_pin(F6, (state & 0x4));
return state; return state;
} }

View File

@ -42,22 +42,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
void matrix_init_user(void) { void matrix_init_user(void) {
// set CapsLock LED to output and off (active low) // set CapsLock LED to output and off (active low)
setPinOutput(F5); gpio_set_pin_output(F5);
writePinHigh(F5); gpio_write_pin_high(F5);
// set NumLock LED to output and off (active low) // set NumLock LED to output and off (active low)
setPinOutput(F6); gpio_set_pin_output(F6);
writePinHigh(F6); gpio_write_pin_high(F6);
// set ScrollLock LED to output and off (active low) // set ScrollLock LED to output and off (active low)
setPinOutput(F7); gpio_set_pin_output(F7);
writePinHigh(F7); gpio_write_pin_high(F7);
} }
// write to above indicators in a binary fashion based on current layer // write to above indicators in a binary fashion based on current layer
layer_state_t layer_state_set_user(layer_state_t state) layer_state_t layer_state_set_user(layer_state_t state)
{ {
writePin(F5, (state & 0x1)); gpio_write_pin(F5, (state & 0x1));
writePin(F6, (state & 0x2)); gpio_write_pin(F6, (state & 0x2));
writePin(F7, (state & 0x4)); gpio_write_pin(F7, (state & 0x4));
return state; return state;
} }

View File

@ -59,18 +59,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
void matrix_init_user(void) { void matrix_init_user(void) {
// set CapsLock LED to output and off (active high) // set CapsLock LED to output and off (active high)
setPinOutput(F5); gpio_set_pin_output(F5);
// set NumLock LED to output and off (active high) // set NumLock LED to output and off (active high)
setPinOutput(F6); gpio_set_pin_output(F6);
// set ScrollLock LED to output and off (active high) // set ScrollLock LED to output and off (active high)
setPinOutput(F7); gpio_set_pin_output(F7);
} }
// write to above indicators in a binary fashion based on current layer // write to above indicators in a binary fashion based on current layer
layer_state_t layer_state_set_user(layer_state_t state) layer_state_t layer_state_set_user(layer_state_t state)
{ {
writePin(F5, (state & 0x1)); gpio_write_pin(F5, (state & 0x1));
writePin(F6, (state & 0x2)); gpio_write_pin(F6, (state & 0x2));
writePin(F7, (state & 0x4)); gpio_write_pin(F7, (state & 0x4));
return state; return state;
} }

View File

@ -39,27 +39,27 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
void matrix_init_user(void) { void matrix_init_user(void) {
// set CapsLock LED to output and low // set CapsLock LED to output and low
setPinOutput(B2); gpio_set_pin_output(B2);
writePinLow(B2); gpio_write_pin_low(B2);
// set NumLock LED to output and low // set NumLock LED to output and low
setPinOutput(B6); gpio_set_pin_output(B6);
writePinLow(B6); gpio_write_pin_low(B6);
} }
layer_state_t layer_state_set_user(layer_state_t state) layer_state_t layer_state_set_user(layer_state_t state)
{ {
if (layer_state_cmp(state, 1)) { if (layer_state_cmp(state, 1)) {
writePinHigh(B2); gpio_write_pin_high(B2);
} else if (state & (1<<2)) { } else if (state & (1<<2)) {
writePinLow(B2); gpio_write_pin_low(B2);
writePinHigh(B6); gpio_write_pin_high(B6);
} else if (state & (1<<3)) { } else if (state & (1<<3)) {
writePinHigh(B2); gpio_write_pin_high(B2);
writePinHigh(B6); gpio_write_pin_high(B6);
} else { } else {
writePinLow(B2); gpio_write_pin_low(B2);
writePinLow(B6); gpio_write_pin_low(B6);
} }
return state; return state;
} }

View File

@ -116,7 +116,7 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) {
matrix_io_delay(); matrix_io_delay();
} }
// read col data // read col data
data = ((readPin(A0) << 0) | (readPin(A1) << 1) | (readPin(A2) << 2) | (readPin(A3) << 3) | (readPin(A6) << 4) | (readPin(A7) << 5) | (readPin(B0) << 6)); data = ((gpio_read_pin(A0) << 0) | (gpio_read_pin(A1) << 1) | (gpio_read_pin(A2) << 2) | (gpio_read_pin(A3) << 3) | (gpio_read_pin(A6) << 4) | (gpio_read_pin(A7) << 5) | (gpio_read_pin(B0) << 6));
// unstrobe row // unstrobe row
switch (row) { switch (row) {
case 0: case 0: