forked from mirror/qmk_firmware
Convert some AVR GPIO operations to macros (#23424)
This commit is contained in:
@@ -27,18 +27,40 @@ uint8_t init_mcp23018(void);
|
||||
#define LED_BRIGHTNESS_LO 15
|
||||
#define LED_BRIGHTNESS_HI 255
|
||||
|
||||
#define FRENCHDEV_BOARD_LED_PIN D6
|
||||
#define FRENCHDEV_LED_1_PIN B5
|
||||
#define FRENCHDEV_LED_2_PIN B6
|
||||
#define FRENCHDEV_LED_3_PIN B7
|
||||
|
||||
inline void frenchdev_board_led_on(void) { DDRD |= (1<<6); PORTD |= (1<<6); }
|
||||
inline void frenchdev_led_1_on(void) { DDRB |= (1<<5); PORTB |= (1<<5); }
|
||||
inline void frenchdev_led_2_on(void) { DDRB |= (1<<6); PORTB |= (1<<6); }
|
||||
inline void frenchdev_led_3_on(void) { DDRB |= (1<<7); PORTB |= (1<<7); }
|
||||
inline void frenchdev_led_on(uint8_t led) { DDRB |= (1<<(led+4)); PORTB |= (1<<(led+4)); }
|
||||
inline void frenchdev_board_led_on(void) {
|
||||
gpio_set_pin_output(FRENCHDEV_BOARD_LED_PIN);
|
||||
gpio_write_pin_high(FRENCHDEV_BOARD_LED_PIN);
|
||||
}
|
||||
inline void frenchdev_led_1_on(void) {
|
||||
gpio_set_pin_output(FRENCHDEV_LED_1_PIN);
|
||||
gpio_write_pin_high(FRENCHDEV_LED_1_PIN);
|
||||
}
|
||||
inline void frenchdev_led_2_on(void) {
|
||||
gpio_set_pin_output(FRENCHDEV_LED_2_PIN);
|
||||
gpio_write_pin_high(FRENCHDEV_LED_2_PIN);
|
||||
}
|
||||
inline void frenchdev_led_3_on(void) {
|
||||
gpio_set_pin_output(FRENCHDEV_LED_3_PIN);
|
||||
gpio_write_pin_high(FRENCHDEV_LED_3_PIN);
|
||||
}
|
||||
|
||||
inline void frenchdev_board_led_off(void) { DDRD &= ~(1<<6); PORTD &= ~(1<<6); }
|
||||
inline void frenchdev_led_1_off(void) { DDRB &= ~(1<<5); PORTB &= ~(1<<5); }
|
||||
inline void frenchdev_led_2_off(void) { DDRB &= ~(1<<6); PORTB &= ~(1<<6); }
|
||||
inline void frenchdev_led_3_off(void) { DDRB &= ~(1<<7); PORTB &= ~(1<<7); }
|
||||
inline void frenchdev_led_off(uint8_t led) { DDRB &= ~(1<<(led+4)); PORTB &= ~(1<<(led+4)); }
|
||||
inline void frenchdev_board_led_off(void) {
|
||||
gpio_set_pin_input(FRENCHDEV_BOARD_LED_PIN);
|
||||
}
|
||||
inline void frenchdev_led_1_off(void) {
|
||||
gpio_set_pin_input(FRENCHDEV_LED_1_PIN);
|
||||
}
|
||||
inline void frenchdev_led_2_off(void) {
|
||||
gpio_set_pin_input(FRENCHDEV_LED_2_PIN);
|
||||
}
|
||||
inline void frenchdev_led_3_off(void) {
|
||||
gpio_set_pin_input(FRENCHDEV_LED_3_PIN);
|
||||
}
|
||||
|
||||
inline void frenchdev_led_all_on(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user