From 4a4ea83121044c9b5d091aba3992a4bc57c162f3 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Tue, 24 Jan 2017 20:21:41 +0100 Subject: [PATCH] Cut the timers back to 8 bits, that's more than enough Signed-off-by: Gergely Nagy --- src/Akela/GhostInTheFirmware.cpp | 6 +++--- src/Akela/GhostInTheFirmware.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Akela/GhostInTheFirmware.cpp b/src/Akela/GhostInTheFirmware.cpp index e06c42dc..62c38ab6 100644 --- a/src/Akela/GhostInTheFirmware.cpp +++ b/src/Akela/GhostInTheFirmware.cpp @@ -22,8 +22,8 @@ namespace Akela { GhostInTheFirmware::GhostKey *GhostInTheFirmware::ghostKeys; bool GhostInTheFirmware::isActive; uint16_t GhostInTheFirmware::currentPos; - uint16_t GhostInTheFirmware::timer; - uint16_t GhostInTheFirmware::timeOut; + uint8_t GhostInTheFirmware::timer; + uint8_t GhostInTheFirmware::timeOut; GhostInTheFirmware::GhostInTheFirmware (void) { } @@ -49,7 +49,7 @@ namespace Akela { return; if (timeOut == 0) { - timeOut = pgm_read_word (&(ghostKeys[currentPos].delay)); + timeOut = pgm_read_byte (&(ghostKeys[currentPos].delay)); if (timeOut == 0) { currentPos = 0; diff --git a/src/Akela/GhostInTheFirmware.h b/src/Akela/GhostInTheFirmware.h index 9b0501b2..4c7cdf4f 100644 --- a/src/Akela/GhostInTheFirmware.h +++ b/src/Akela/GhostInTheFirmware.h @@ -26,7 +26,7 @@ namespace Akela { typedef struct { byte row; byte col; - uint16_t delay; + uint8_t delay; } GhostKey; GhostInTheFirmware (void); @@ -39,8 +39,8 @@ namespace Akela { static GhostKey *ghostKeys; static bool isActive; static uint16_t currentPos; - static uint16_t timer; - static uint16_t timeOut; + static uint8_t timer; + static uint8_t timeOut; static void loopHook (bool postClear); };