Skip to content

Commit

Permalink
Update GPIO macros in keymaps (qmk#23792)
Browse files Browse the repository at this point in the history
  • Loading branch information
fauxpark authored May 24, 2024
1 parent 8ff8e9e commit b8f29c3
Show file tree
Hide file tree
Showing 82 changed files with 402 additions and 402 deletions.
8 changes: 4 additions & 4 deletions keyboards/1upkeyboards/1up60rgb/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
setPinOutput(B2);
writePinLow(B2);
gpio_set_pin_output(B2);
gpio_write_pin_low(B2);
} else {
setPinInput(B2);
writePinLow(B2);
gpio_set_pin_input(B2);
gpio_write_pin_low(B2);
}
return false;
}
8 changes: 4 additions & 4 deletions keyboards/1upkeyboards/1up60rgb/keymaps/iso/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
setPinOutput(B2);
writePinLow(B2);
gpio_set_pin_output(B2);
gpio_write_pin_low(B2);
} else {
setPinInput(B2);
writePinLow(B2);
gpio_set_pin_input(B2);
gpio_write_pin_low(B2);
}
return false;
}
8 changes: 4 additions & 4 deletions keyboards/1upkeyboards/1up60rgb/keymaps/tsangan/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
setPinOutput(B2);
writePinLow(B2);
gpio_set_pin_output(B2);
gpio_write_pin_low(B2);
} else {
setPinInput(B2);
writePinLow(B2);
gpio_set_pin_input(B2);
gpio_write_pin_low(B2);
}
return false;
}
6 changes: 3 additions & 3 deletions keyboards/45_ats/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

//function for layer indicator LED
layer_state_t layer_state_set_user(layer_state_t state) {
writePin(D0, layer_state_cmp(state, 0));
writePin(D1, layer_state_cmp(state, 1));
writePin(D2, layer_state_cmp(state, 2));
gpio_write_pin(D0, layer_state_cmp(state, 0));
gpio_write_pin(D1, layer_state_cmp(state, 1));
gpio_write_pin(D2, layer_state_cmp(state, 2));
return state;
}

Expand Down
6 changes: 3 additions & 3 deletions keyboards/45_ats/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

//function for layer indicator LED
layer_state_t layer_state_set_user(layer_state_t state) {
writePin(D0, layer_state_cmp(state, 0));
writePin(D1, layer_state_cmp(state, 1));
writePin(D2, layer_state_cmp(state, 2));
gpio_write_pin(D0, layer_state_cmp(state, 0));
gpio_write_pin(D1, layer_state_cmp(state, 1));
gpio_write_pin(D2, layer_state_cmp(state, 2));
return state;
}

Expand Down
4 changes: 2 additions & 2 deletions keyboards/blu/vimclutch/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

/* Layer-specific lighting */
layer_state_t layer_state_set_user(layer_state_t state) {
writePin(F4, !layer_state_cmp(state, _VC));
writePin(F5, !layer_state_cmp(state, _VIM));
gpio_write_pin(F4, !layer_state_cmp(state, _VC));
gpio_write_pin(F5, !layer_state_cmp(state, _VIM));
return state;
};

Expand Down
2 changes: 1 addition & 1 deletion keyboards/bobpad/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};

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;
}
10 changes: 5 additions & 5 deletions keyboards/bobpad/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// C6 E6 D7

void matrix_scan_user(void) {
writePin(C6, layer_state_is(1));
writePin(E6, layer_state_is(2));
writePin(D7, layer_state_is(3));
writePin(D4, layer_state_is(4));
writePin(D0, layer_state_is(5));
gpio_write_pin(C6, layer_state_is(1));
gpio_write_pin(E6, layer_state_is(2));
gpio_write_pin(D7, layer_state_is(3));
gpio_write_pin(D4, layer_state_is(4));
gpio_write_pin(D0, layer_state_is(5));
if (is_alt_tab_active) {
if (timer_elapsed(alt_tab_timer) > 1000) {
unregister_code(KC_LWIN);
Expand Down
8 changes: 4 additions & 4 deletions keyboards/converter/siemens_tastatur/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}

void matrix_init_user(void) {
setPinOutput(B0);
writePinLow(B0);
gpio_set_pin_output(B0);
gpio_write_pin_low(B0);
}

bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
writePinHigh(B0);
gpio_write_pin_high(B0);
} else {
writePinLow(B0);
gpio_write_pin_low(B0);
}
return false;
}
4 changes: 2 additions & 2 deletions keyboards/cutie_club/wraith/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
void matrix_scan_user(void) {
// escape LED on layer 1
if (IS_LAYER_ON(1)) {
writePinLow(B0);
gpio_write_pin_low(B0);
} else {
writePinHigh(B0);
gpio_write_pin_high(B0);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
#endif

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;
};
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
#endif

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;
};
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};

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;
};
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};

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;
};
4 changes: 2 additions & 2 deletions keyboards/db/db63/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
bool led_update_user(led_t led_state) {
if (led_state.caps_lock) {
rgblight_sethsv(HSV_CYAN);
writePinHigh(D1);
gpio_write_pin_high(D1);
} else {
rgblight_sethsv(HSV_GREEN);
writePinLow(D1);
gpio_write_pin_low(D1);
}
return false;
}
32 changes: 16 additions & 16 deletions keyboards/dm9records/plaid/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,18 +215,18 @@ led_config_t led_config;
//Set leds to saved state during powerup
void keyboard_post_init_user(void) {
// set LED pin modes
setPinOutput(LED_RED);
setPinOutput(LED_GREEN);
gpio_set_pin_output(LED_RED);
gpio_set_pin_output(LED_GREEN);

// Call the post init code.
led_config.raw = eeconfig_read_user();

if(led_config.red_mode == LEDMODE_ON) {
writePinHigh(LED_RED);
gpio_write_pin_high(LED_RED);
}

if(led_config.green_mode == LEDMODE_ON) {
writePinHigh(LED_GREEN);
gpio_write_pin_high(LED_GREEN);
}
}

Expand All @@ -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++) {
if(keycode==modifiers[i]) {
if (record->event.pressed) {
writePinHigh(led);
gpio_write_pin_high(led);
}
else {
writePinLow(led);
gpio_write_pin_low(led);
}
}
}
Expand All @@ -260,30 +260,30 @@ void led_keypress_update(uint8_t led, uint8_t led_mode, uint16_t keycode, keyrec
if (record->event.pressed) {
if(rand() % 2 == 1) {
if(rand() % 2 == 0) {
writePinLow(led);
gpio_write_pin_low(led);
}
else {
writePinHigh(led);
gpio_write_pin_high(led);
}
}
}
break;
case LEDMODE_KEY:
if (record->event.pressed) {
writePinHigh(led);
gpio_write_pin_high(led);
return;
}
else {
writePinLow(led);
gpio_write_pin_low(led);
return;
}
break;
case LEDMODE_ENTER:
if (keycode==KC_ENT) {
writePinHigh(led);
gpio_write_pin_high(led);
}
else {
writePinLow(led);
gpio_write_pin_low(led);
}
break;

Expand Down Expand Up @@ -345,11 +345,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
if (led_config.red_mode==LEDMODE_ON) {
led_config.red_mode=LEDMODE_OFF;
writePinLow(LED_RED);
gpio_write_pin_low(LED_RED);
}
else {
led_config.red_mode=LEDMODE_ON;
writePinHigh(LED_RED);
gpio_write_pin_high(LED_RED);
}
}
eeconfig_update_user(led_config.raw);
Expand All @@ -359,11 +359,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
if (led_config.green_mode==LEDMODE_ON) {
led_config.green_mode=LEDMODE_OFF;
writePinLow(LED_GREEN);
gpio_write_pin_low(LED_GREEN);
}
else {
led_config.green_mode=LEDMODE_ON;
writePinHigh(LED_GREEN);
gpio_write_pin_high(LED_GREEN);
}
}
eeconfig_update_user(led_config.raw);
Expand Down
4 changes: 2 additions & 2 deletions keyboards/dm9records/plaid/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

};
bool led_update_user(led_t led_state) {
writePin(LED_RED, led_state.caps_lock);
writePin(LED_GREEN, led_state.scroll_lock);
gpio_write_pin(LED_RED, led_state.caps_lock);
gpio_write_pin(LED_GREEN, led_state.scroll_lock);
return false;
}
4 changes: 2 additions & 2 deletions keyboards/dtisaac/dosa40rgb/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ bool rgb_matrix_indicators_user(void) {
}

void keyboard_pre_init_user(void) {
setPinOutput(B5);
writePinLow(B5);
gpio_set_pin_output(B5);
gpio_write_pin_low(B5);
}
4 changes: 2 additions & 2 deletions keyboards/dyz/synthesis60/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

layer_state_t layer_state_set_user(layer_state_t state) {
if (get_highest_layer(state) != 0) {
writePinLow(C6);
gpio_write_pin_low(C6);
} else {
writePinHigh(C6);
gpio_write_pin_high(C6);
}
return state;
}
4 changes: 2 additions & 2 deletions keyboards/dyz/synthesis60/keymaps/default_arrow/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

layer_state_t layer_state_set_user(layer_state_t state) {
if (get_highest_layer(state) != 0) {
writePinLow(C6);
gpio_write_pin_low(C6);
} else {
writePinHigh(C6);
gpio_write_pin_high(C6);
}
return state;
}
4 changes: 2 additions & 2 deletions keyboards/dyz/synthesis60/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

layer_state_t layer_state_set_user(layer_state_t state) {
if (get_highest_layer(state) != 0) {
writePinLow(C6);
gpio_write_pin_low(C6);
} else {
writePinHigh(C6);
gpio_write_pin_high(C6);
}
return state;
}
6 changes: 3 additions & 3 deletions keyboards/evyd13/nt650/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};

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)) {
case _LOCK:
writePin(LOCK_LED_PIN, 0);
gpio_write_pin(LOCK_LED_PIN, 0);
break;
default: // for any other layers, or the default layer
writePin(LOCK_LED_PIN, 1);
gpio_write_pin(LOCK_LED_PIN, 1);
break;
}
return state;
Expand Down
6 changes: 3 additions & 3 deletions keyboards/evyd13/wonderland/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ layer_state_t layer_state_set_user(layer_state_t state) {

// override kb level function
bool led_update_user(led_t usb_led) {
writePin(B1, !top);
writePin(B2, !middle);
writePin(B3, !bottom);
gpio_write_pin(B1, !top);
gpio_write_pin(B2, !middle);
gpio_write_pin(B3, !bottom);
return false; // we are using LEDs for something else override kb
}
#endif
12 changes: 6 additions & 6 deletions keyboards/handwired/daishi/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ void matrix_init_user(void) {
// Call the keymap level matrix init.

// Set our LED pins as output
setPinOutput(C4);
setPinOutput(C5);
setPinOutput(C6);
gpio_set_pin_output(C4);
gpio_set_pin_output(C5);
gpio_set_pin_output(C6);
}

bool led_update_user(led_t led_state) {
writePin(C4, led_state.num_lock);
writePin(C5, led_state.caps_lock);
writePin(C6, led_state.scroll_lock);
gpio_write_pin(C4, led_state.num_lock);
gpio_write_pin(C5, led_state.caps_lock);
gpio_write_pin(C6, led_state.scroll_lock);

return false;
}
Loading

0 comments on commit b8f29c3

Please sign in to comment.