From 61c7c1f74cc5365501a3038181df551df11f719e Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 2 May 2024 19:48:49 +1000 Subject: Convert some AVR GPIO operations to macros (#23424) --- .../viktus/omnikey_bh/keymaps/default/keymap.c | 23 ++++++---------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'keyboards/viktus') 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; } -- cgit v1.2.3