From 46b5193d8dccff25b29066ff82dd3207e04a1f7b Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Wed, 7 Nov 2018 09:15:25 +0100 Subject: [PATCH] hardware/Atreus: Unroll the row initialization Unroll the row initialization in `setup()`, saving quite a bit on code size. Signed-off-by: Gergely Nagy --- src/kaleidoscope/hardware/Atreus.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/kaleidoscope/hardware/Atreus.cpp b/src/kaleidoscope/hardware/Atreus.cpp index 4c999cf6..5ed09fd5 100644 --- a/src/kaleidoscope/hardware/Atreus.cpp +++ b/src/kaleidoscope/hardware/Atreus.cpp @@ -52,11 +52,9 @@ void Atreus::setup(void) { wdt_disable(); delay(100); - for (uint8_t i = 0; i < ROWS; i++) { - DDRD |= _BV(row_pins[i]); - PORTD |= _BV(row_pins[i]); - keyState_[i] = previousKeyState_[i] = 0; - } + // Initialize rows + DDRD |= _BV(0) | _BV(1) | _BV(3) | _BV(2); + PORTD |= _BV(0) | _BV(1) | _BV(3) | _BV(2); // Initialize columns DDRB &= ~(_BV(5) | _BV(4) | _BV(6) | _BV(7));