Convert some AVR GPIO operations to macros (#23424)

This commit is contained in:
Ryan 2024-05-02 19:48:49 +10:00 committed by GitHub
parent 7220715dd1
commit 61c7c1f74c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
71 changed files with 877 additions and 840 deletions

View file

@ -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;
}