From f62c0f631bffb137bafc5be2118dcb5d86057817 Mon Sep 17 00:00:00 2001 From: Michael Richters Date: Tue, 7 May 2019 11:13:25 -0500 Subject: [PATCH] Use standard timeout checker for GhostInTheFirmware Signed-off-by: Michael Richters --- src/kaleidoscope/plugin/GhostInTheFirmware.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/kaleidoscope/plugin/GhostInTheFirmware.cpp b/src/kaleidoscope/plugin/GhostInTheFirmware.cpp index 14566f19..8e5edf7e 100644 --- a/src/kaleidoscope/plugin/GhostInTheFirmware.cpp +++ b/src/kaleidoscope/plugin/GhostInTheFirmware.cpp @@ -46,11 +46,11 @@ EventHandlerResult GhostInTheFirmware::beforeReportingState() { return EventHandlerResult::OK; } is_pressed_ = true; - start_time_ = millis(); + start_time_ = Kaleidoscope.millisAtCycleStart(); } else { - if (is_pressed_ && ((millis() - start_time_) > press_timeout_)) { + if (is_pressed_ && Kaleidoscope.hasTimeExpired(start_time_, press_timeout_)) { is_pressed_ = false; - start_time_ = millis(); + start_time_ = Kaleidoscope.millisAtCycleStart(); byte row = pgm_read_byte(&(ghost_keys[current_pos_].row)); byte col = pgm_read_byte(&(ghost_keys[current_pos_].col)); @@ -61,7 +61,7 @@ EventHandlerResult GhostInTheFirmware::beforeReportingState() { byte col = pgm_read_byte(&(ghost_keys[current_pos_].col)); handleKeyswitchEvent(Key_NoKey, row, col, IS_PRESSED); - } else if ((millis() - start_time_) > delay_timeout_) { + } else if (Kaleidoscope.hasTimeExpired(start_time_, delay_timeout_)) { current_pos_++; press_timeout_ = 0; }