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

@ -100,21 +100,19 @@ bool led_update_user(led_t led_state)
{
if (led_state.caps_lock) {
// output high
DDRD |= (1<<6);
PORTD |= (1<<6);
gpio_set_pin_output(D6);
gpio_write_pin_high(D6);
} else {
// Hi-Z
DDRD &= ~(1<<6);
PORTD &= ~(1<<6);
gpio_set_pin_input(D6);
}
if (led_state.num_lock) {
// output low
DDRC |= (1<<7);
PORTC |= ~(1<<7);
gpio_set_pin_output(C7);
gpio_write_pin_low(C7);
} else {
// Hi-Z
DDRC &= ~(1<<7);
PORTC &= ~(1<<7);
gpio_set_pin_input(C7);
}
return false;
}