Convert some AVR GPIO operations to macros (#23424)
This commit is contained in:
parent
7220715dd1
commit
61c7c1f74c
71 changed files with 877 additions and 840 deletions
|
@ -4,26 +4,26 @@
|
|||
void backlight_init_ports(void) {
|
||||
print("init_backlight_pin()\n");
|
||||
// Set our LED pins as output
|
||||
DDRD |= (1<<6); // Esc
|
||||
DDRB |= (1<<7); // Page Up
|
||||
DDRD |= (1<<4); // Arrows
|
||||
gpio_set_pin_output(D6); // Esc
|
||||
gpio_set_pin_output(B7); // Page Up
|
||||
gpio_set_pin_output(D4); // Arrows
|
||||
|
||||
// Set our LED pins low
|
||||
PORTD &= ~(1<<6); // Esc
|
||||
PORTB &= ~(1<<7); // Page Up
|
||||
PORTD &= ~(1<<4); // Arrows
|
||||
gpio_write_pin_low(D6); // Esc
|
||||
gpio_write_pin_low(B7); // Page Up
|
||||
gpio_write_pin_low(D4); // Arrows
|
||||
}
|
||||
|
||||
void backlight_set(uint8_t level) {
|
||||
if ( level == 0 ) {
|
||||
// Turn off light
|
||||
PORTD |= (1<<6); // Esc
|
||||
PORTB |= (1<<7); // Page Up
|
||||
PORTD |= (1<<4); // Arrows
|
||||
gpio_write_pin_high(D6); // Esc
|
||||
gpio_write_pin_high(B7); // Page Up
|
||||
gpio_write_pin_high(D4); // Arrows
|
||||
} else {
|
||||
// Turn on light
|
||||
PORTD &= ~(1<<6); // Esc
|
||||
PORTB &= ~(1<<7); // Page Up
|
||||
PORTD &= ~(1<<4); // Arrows
|
||||
gpio_write_pin_low(D6); // Esc
|
||||
gpio_write_pin_low(B7); // Page Up
|
||||
gpio_write_pin_low(D4); // Arrows
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,26 +4,26 @@
|
|||
void backlight_init_ports(void) {
|
||||
print("init_backlight_pin()\n");
|
||||
// Set our LED pins as output
|
||||
DDRD |= (1<<6); // Esc
|
||||
DDRB |= (1<<7); // Page Up
|
||||
DDRD |= (1<<4); // Arrows
|
||||
gpio_set_pin_output(D6); // Esc
|
||||
gpio_set_pin_output(B7); // Page Up
|
||||
gpio_set_pin_output(D4); // Arrows
|
||||
|
||||
// Set our LED pins low
|
||||
PORTD &= ~(1<<6); // Esc
|
||||
PORTB &= ~(1<<7); // Page Up
|
||||
PORTD &= ~(1<<4); // Arrows
|
||||
gpio_write_pin_low(D6); // Esc
|
||||
gpio_write_pin_low(B7); // Page Up
|
||||
gpio_write_pin_low(D4); // Arrows
|
||||
}
|
||||
|
||||
void backlight_set(uint8_t level) {
|
||||
if ( level == 0 ) {
|
||||
// Turn off light
|
||||
PORTD |= (1<<6); // Esc
|
||||
PORTB |= (1<<7); // Page Up
|
||||
PORTD |= (1<<4); // Arrows
|
||||
gpio_write_pin_high(D6); // Esc
|
||||
gpio_write_pin_high(B7); // Page Up
|
||||
gpio_write_pin_high(D4); // Arrows
|
||||
} else {
|
||||
// Turn on light
|
||||
PORTD &= ~(1<<6); // Esc
|
||||
PORTB &= ~(1<<7); // Page Up
|
||||
PORTD &= ~(1<<4); // Arrows
|
||||
gpio_write_pin_low(D6); // Esc
|
||||
gpio_write_pin_low(B7); // Page Up
|
||||
gpio_write_pin_low(D4); // Arrows
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,26 +4,26 @@
|
|||
void backlight_init_ports(void) {
|
||||
print("init_backlight_pin()\n");
|
||||
// Set our LED pins as output
|
||||
DDRD |= (1<<0); // Esc
|
||||
DDRD |= (1<<4); // Page Up
|
||||
DDRD |= (1<<1); // Arrows
|
||||
gpio_set_pin_output(D0); // Esc
|
||||
gpio_set_pin_output(D4); // Page Up
|
||||
gpio_set_pin_output(D1); // Arrows
|
||||
|
||||
// Set our LED pins low
|
||||
PORTD &= ~(1<<0); // Esc
|
||||
PORTD &= ~(1<<4); // Page Up
|
||||
PORTD &= ~(1<<1); // Arrows
|
||||
gpio_write_pin_low(D0); // Esc
|
||||
gpio_write_pin_low(D4); // Page Up
|
||||
gpio_write_pin_low(D1); // Arrows
|
||||
}
|
||||
|
||||
void backlight_set(uint8_t level) {
|
||||
if ( level == 0 ) {
|
||||
// Turn off light
|
||||
PORTD |= (1<<0); // Esc
|
||||
PORTD |= (1<<4); // Page Up
|
||||
PORTD |= (1<<1); // Arrows
|
||||
gpio_write_pin_high(D0); // Esc
|
||||
gpio_write_pin_high(D4); // Page Up
|
||||
gpio_write_pin_high(D1); // Arrows
|
||||
} else {
|
||||
// Turn on light
|
||||
PORTD &= ~(1<<0); // Esc
|
||||
PORTD &= ~(1<<4); // Page Up
|
||||
PORTD &= ~(1<<1); // Arrows
|
||||
gpio_write_pin_low(D0); // Esc
|
||||
gpio_write_pin_low(D4); // Page Up
|
||||
gpio_write_pin_low(D1); // Arrows
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue