diff options
author | Ryan <[email protected]> | 2024-05-02 19:48:49 +1000 |
---|---|---|
committer | GitHub <[email protected]> | 2024-05-02 10:48:49 +0100 |
commit | 61c7c1f74cc5365501a3038181df551df11f719e (patch) | |
tree | 67b134bfd3ba45660765f5c2c46b8d3f535b5b69 /keyboards/gboards | |
parent | 7220715dd1619dfb073db78cfc23998a67994655 (diff) | |
download | qmk_firmware-61c7c1f74cc5365501a3038181df551df11f719e.tar.gz qmk_firmware-61c7c1f74cc5365501a3038181df551df11f719e.zip |
Convert some AVR GPIO operations to macros (#23424)
Diffstat (limited to 'keyboards/gboards')
-rw-r--r-- | keyboards/gboards/ergotaco/ergotaco.c | 37 | ||||
-rw-r--r-- | keyboards/gboards/georgi/georgi.c | 17 | ||||
-rw-r--r-- | keyboards/gboards/gergo/gergo.c | 17 |
3 files changed, 37 insertions, 34 deletions
diff --git a/keyboards/gboards/ergotaco/ergotaco.c b/keyboards/gboards/ergotaco/ergotaco.c index 6795dfde4f..1e526f15e2 100644 --- a/keyboards/gboards/ergotaco/ergotaco.c +++ b/keyboards/gboards/ergotaco/ergotaco.c @@ -5,25 +5,30 @@ i2c_status_t mcp23018_status = 0x20; void matrix_init_kb(void) { // (tied to Vcc for hardware convenience) - //DDRB &= ~(1<<4); // set B(4) as input - //PORTB &= ~(1<<4); // set B(4) internal pull-up disabled + //gpio_set_pin_input(B4); // set B(4) as input, internal pull-up disabled // unused pins // set as input with internal pull-up enabled - DDRB &= ~(1<<4 | 1<<5 | 1<<6 | 1<<7); - PORTB |= (1<<4 | 1<<5 | 1<<6 | 1<<7); - - DDRC &= ~(1<<7 | 1<<6); - PORTC |= (1<<7 | 1<<6); - - DDRD &= ~(1<<4 | 1<<5 | 1<<6 | 1<<7); - PORTD |= (1<<4 | 1<<5 | 1<<6 | 1<<7); - - DDRE &= ~(1<<6); - PORTE |= (1<<6); - - DDRF &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6 | 1<<7); - PORTF |= (1<<0 | 1<<1 | 1<<4 | 1<<6 | 1<<7); + gpio_set_pin_input_high(B4); + gpio_set_pin_input_high(B5); + gpio_set_pin_input_high(B6); + gpio_set_pin_input_high(B7); + + gpio_set_pin_input_high(C6); + gpio_set_pin_input_high(C7); + + gpio_set_pin_input_high(D4); + gpio_set_pin_input_high(D5); + gpio_set_pin_input_high(D6); + gpio_set_pin_input_high(D7); + + gpio_set_pin_input_high(E6); + + gpio_set_pin_input_high(D0); + gpio_set_pin_input_high(D1); + gpio_set_pin_input_high(D4); + gpio_set_pin_input_high(D6); + gpio_set_pin_input_high(D7); matrix_init_user(); } diff --git a/keyboards/gboards/georgi/georgi.c b/keyboards/gboards/georgi/georgi.c index 44b7067b47..da88e6ed8b 100644 --- a/keyboards/gboards/georgi/georgi.c +++ b/keyboards/gboards/georgi/georgi.c @@ -7,17 +7,16 @@ void matrix_init_kb(void) { steno_set_mode(STENO_MODE_GEMINI); // or STENO_MODE_BOLT // (tied to Vcc for hardware convenience) - //DDRB &= ~(1<<4); // set B(4) as input - //PORTB &= ~(1<<4); // set B(4) internal pull-up disabled + //gpio_set_pin_input(B4); // set B(4) as input, internal pull-up disabled - // unused pins - C7, D4, D5, D7, E6 + // unused pins - C7, D4, D5, D6, D7, E6 // set as input with internal pull-up enabled - DDRC &= ~(1<<7); - DDRD &= ~(1<<5 | 1<<4 | 1<<6 | 1<<7); - DDRE &= ~(1<<6); - PORTC |= (1<<7); - PORTD |= (1<<5 | 1<<4 | 1<<6 | 1<<7); - PORTE |= (1<<6); + gpio_set_pin_input_high(C7); + gpio_set_pin_input_high(D4); + gpio_set_pin_input_high(D5); + gpio_set_pin_input_high(D6); + gpio_set_pin_input_high(D7); + gpio_set_pin_input_high(E6); matrix_init_user(); } diff --git a/keyboards/gboards/gergo/gergo.c b/keyboards/gboards/gergo/gergo.c index fa73c4b42f..1ec6105eeb 100644 --- a/keyboards/gboards/gergo/gergo.c +++ b/keyboards/gboards/gergo/gergo.c @@ -5,17 +5,16 @@ i2c_status_t mcp23018_status = 0x20; void matrix_init_kb(void) { // (tied to Vcc for hardware convenience) - //DDRB &= ~(1<<4); // set B(4) as input - //PORTB &= ~(1<<4); // set B(4) internal pull-up disabled + //gpio_set_pin_input(B4); // set B(4) as input, internal pull-up disabled - // unused pins - C7, D4, D5, D7, E6 + // unused pins - C7, D4, D5, D6, D7, E6 // set as input with internal pull-up enabled - DDRC &= ~(1<<7); - DDRD &= ~(1<<5 | 1<<4 | 1<<6 | 1<<7); - DDRE &= ~(1<<6); - PORTC |= (1<<7); - PORTD |= (1<<5 | 1<<4 | 1<<6 | 1<<7); - PORTE |= (1<<6); + gpio_set_pin_input_high(C7); + gpio_set_pin_input_high(D4); + gpio_set_pin_input_high(D5); + gpio_set_pin_input_high(D6); + gpio_set_pin_input_high(D7); + gpio_set_pin_input_high(E6); matrix_init_user(); } |