forked from mirror/qmk_firmware
Update GPIO macros in keymaps (#23792)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -54,12 +54,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Show "Fun Lock" layer state via the "Fun Lock" LED */
|
||||
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))
|
||||
writePinHigh(LED_FUN_LOCK_PIN);
|
||||
gpio_write_pin_high(LED_FUN_LOCK_PIN);
|
||||
else
|
||||
writePinLow(LED_FUN_LOCK_PIN);
|
||||
gpio_write_pin_low(LED_FUN_LOCK_PIN);
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -25,15 +25,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
bool led_update_user(led_t led_state) {
|
||||
|
||||
if (led_state.caps_lock) {
|
||||
writePinHigh(F1);
|
||||
gpio_write_pin_high(F1);
|
||||
} else {
|
||||
writePinLow(F1);
|
||||
gpio_write_pin_low(F1);
|
||||
}
|
||||
|
||||
if (led_state.scroll_lock) {
|
||||
writePinHigh(F0);
|
||||
gpio_write_pin_high(F0);
|
||||
} else {
|
||||
writePinLow(F0);
|
||||
gpio_write_pin_low(F0);
|
||||
}
|
||||
|
||||
if (!led_state.num_lock) {
|
||||
@@ -46,13 +46,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (record->event.pressed) {
|
||||
if (sysreq_led) {
|
||||
sysreq_led = false;
|
||||
writePinLow(F4);
|
||||
gpio_write_pin_low(F4);
|
||||
}
|
||||
else {
|
||||
switch(keycode) {
|
||||
case KC_SYSTEM_REQUEST:
|
||||
sysreq_led = true;
|
||||
writePinHigh(F4);
|
||||
gpio_write_pin_high(F4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,15 +25,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
bool led_update_user(led_t led_state) {
|
||||
|
||||
if (led_state.caps_lock) {
|
||||
writePinHigh(F1);
|
||||
gpio_write_pin_high(F1);
|
||||
} else {
|
||||
writePinLow(F1);
|
||||
gpio_write_pin_low(F1);
|
||||
}
|
||||
|
||||
if (led_state.scroll_lock) {
|
||||
writePinHigh(F0);
|
||||
gpio_write_pin_high(F0);
|
||||
} else {
|
||||
writePinLow(F0);
|
||||
gpio_write_pin_low(F0);
|
||||
}
|
||||
|
||||
if (!led_state.num_lock) {
|
||||
@@ -46,13 +46,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (record->event.pressed) {
|
||||
if (sysreq_led) {
|
||||
sysreq_led = false;
|
||||
writePinLow(F4);
|
||||
gpio_write_pin_low(F4);
|
||||
}
|
||||
else {
|
||||
switch(keycode) {
|
||||
case KC_SYSTEM_REQUEST:
|
||||
sysreq_led = true;
|
||||
writePinHigh(F4);
|
||||
gpio_write_pin_high(F4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,16 +84,16 @@ layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
#ifdef JOTANCK_LEDS
|
||||
switch (get_highest_layer(state)) {
|
||||
case _LOWER:
|
||||
writePinHigh(JOTANCK_LED1);
|
||||
writePinLow(JOTANCK_LED2);
|
||||
gpio_write_pin_high(JOTANCK_LED1);
|
||||
gpio_write_pin_low(JOTANCK_LED2);
|
||||
break;
|
||||
case _RAISE:
|
||||
writePinLow(JOTANCK_LED1);
|
||||
writePinHigh(JOTANCK_LED2);
|
||||
gpio_write_pin_low(JOTANCK_LED1);
|
||||
gpio_write_pin_high(JOTANCK_LED2);
|
||||
break;
|
||||
default:
|
||||
writePinLow(JOTANCK_LED1);
|
||||
writePinLow(JOTANCK_LED2);
|
||||
gpio_write_pin_low(JOTANCK_LED1);
|
||||
gpio_write_pin_low(JOTANCK_LED2);
|
||||
break;
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -76,15 +76,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
}
|
||||
|
||||
void matrix_init_user(void) {
|
||||
setPinOutput(C7);
|
||||
writePinLow(C7);
|
||||
gpio_set_pin_output(C7);
|
||||
gpio_write_pin_low(C7);
|
||||
}
|
||||
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
if (get_highest_layer(state)) {
|
||||
writePinHigh(C7);
|
||||
gpio_write_pin_high(C7);
|
||||
} else {
|
||||
writePinLow(C7);
|
||||
gpio_write_pin_low(C7);
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
case LEDCHANGE:
|
||||
if (record->event.pressed) {
|
||||
led_state = !led_state;
|
||||
writePin(F6, led_state);
|
||||
gpio_write_pin(F6, led_state);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -59,6 +59,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
}
|
||||
|
||||
void matrix_init_user(void) {
|
||||
setPinOutput(F6);
|
||||
writePinLow(F6);
|
||||
gpio_set_pin_output(F6);
|
||||
gpio_write_pin_low(F6);
|
||||
}
|
||||
|
||||
@@ -67,16 +67,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
};
|
||||
|
||||
bool led_update_user(led_t led_state) {
|
||||
writePin(NUM_LOCK_LED_PIN, led_state.num_lock);
|
||||
writePin(CAPS_LOCK_LED_PIN, led_state.caps_lock);
|
||||
// writePin(SCROLL_LOCK_LED_PIN, led_state.scroll_lock);
|
||||
gpio_write_pin(NUM_LOCK_LED_PIN, led_state.num_lock);
|
||||
gpio_write_pin(CAPS_LOCK_LED_PIN, led_state.caps_lock);
|
||||
// gpio_write_pin(SCROLL_LOCK_LED_PIN, led_state.scroll_lock);
|
||||
return false;
|
||||
}
|
||||
|
||||
//function for layer indicator LED
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -52,16 +52,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
};
|
||||
|
||||
bool led_update_user(led_t led_state) {
|
||||
writePin(NUM_LOCK_LED_PIN, led_state.num_lock);
|
||||
writePin(CAPS_LOCK_LED_PIN, led_state.caps_lock);
|
||||
// writePin(SCROLL_LOCK_LED_PIN, led_state.scroll_lock);
|
||||
gpio_write_pin(NUM_LOCK_LED_PIN, led_state.num_lock);
|
||||
gpio_write_pin(CAPS_LOCK_LED_PIN, led_state.caps_lock);
|
||||
// gpio_write_pin(SCROLL_LOCK_LED_PIN, led_state.scroll_lock);
|
||||
return false;
|
||||
}
|
||||
|
||||
//function for layer indicator LED
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -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) */
|
||||
switch (get_highest_layer(state)) {
|
||||
case _FN:
|
||||
writePinLow(LED_KANA_PIN);
|
||||
gpio_write_pin_low(LED_KANA_PIN);
|
||||
break;
|
||||
case _MUS:
|
||||
writePinLow(LED_KB_LOCK_PIN);
|
||||
gpio_write_pin_low(LED_KB_LOCK_PIN);
|
||||
break;
|
||||
case _LOCK:
|
||||
writePinLow(LED_KANA_PIN);
|
||||
writePinLow(LED_KB_LOCK_PIN);
|
||||
gpio_write_pin_low(LED_KANA_PIN);
|
||||
gpio_write_pin_low(LED_KB_LOCK_PIN);
|
||||
break;
|
||||
default: // for any other layers, or the default layer
|
||||
writePinHigh(LED_KANA_PIN);
|
||||
writePinHigh(LED_KB_LOCK_PIN);
|
||||
gpio_write_pin_high(LED_KANA_PIN);
|
||||
gpio_write_pin_high(LED_KB_LOCK_PIN);
|
||||
break;
|
||||
}
|
||||
return state;
|
||||
|
||||
Reference in New Issue
Block a user