diff options
author | Ryan <[email protected]> | 2024-05-02 19:48:49 +1000 |
---|---|---|
committer | GitHub <[email protected]> | 2024-05-02 10:48:49 +0100 |
commit | 61c7c1f74cc5365501a3038181df551df11f719e (patch) | |
tree | 67b134bfd3ba45660765f5c2c46b8d3f535b5b69 /keyboards/viktus | |
parent | 7220715dd1619dfb073db78cfc23998a67994655 (diff) | |
download | qmk_firmware-61c7c1f74cc5365501a3038181df551df11f719e.tar.gz qmk_firmware-61c7c1f74cc5365501a3038181df551df11f719e.zip |
Convert some AVR GPIO operations to macros (#23424)
Diffstat (limited to 'keyboards/viktus')
-rw-r--r-- | keyboards/viktus/omnikey_bh/keymaps/default/keymap.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/keyboards/viktus/omnikey_bh/keymaps/default/keymap.c b/keyboards/viktus/omnikey_bh/keymaps/default/keymap.c index e5fb6bf902..ad63d05023 100644 --- a/keyboards/viktus/omnikey_bh/keymaps/default/keymap.c +++ b/keyboards/viktus/omnikey_bh/keymaps/default/keymap.c @@ -23,24 +23,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; bool led_update_user(led_t led_state) { - DDRB |= (1 << 4) | (1 << 5) | (1 << 6); + gpio_set_pin_output(B4); + gpio_set_pin_output(B5); + gpio_set_pin_output(B6); - if (led_state.num_lock) { - PORTB |= (1 << 4); - } else { - PORTB &= ~(1 << 4); - } + gpio_write_pin(B4, led_state.num_lock); + gpio_write_pin(B5, led_state.caps_lock); + gpio_write_pin(B6, led_state.scroll_lock); - if (led_state.caps_lock) { - PORTB |= (1 << 5); - } else { - PORTB &= ~(1 << 5); - } - - if (led_state.scroll_lock) { - PORTB |= (1 << 6); - } else { - PORTB &= ~(1 << 6); - } return false; } |