From 100aa4e493e240729d27619fa19c04729cc7919c Mon Sep 17 00:00:00 2001 From: rljonesau Date: Thu, 22 Nov 2018 05:46:02 +1100 Subject: [PATCH] removed test code from keypad handling --- Arduino/BTCDieselHeater/BTCDieselHeater.ino | 20 ++++++++++---------- Arduino/BTCDieselHeater/display.cpp | 3 --- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/Arduino/BTCDieselHeater/BTCDieselHeater.ino b/Arduino/BTCDieselHeater/BTCDieselHeater.ino index 254b17d..7034061 100644 --- a/Arduino/BTCDieselHeater/BTCDieselHeater.ino +++ b/Arduino/BTCDieselHeater/BTCDieselHeater.ino @@ -138,7 +138,6 @@ const CProtocol* pRxFrame = NULL; const CProtocol* pTxFrame = NULL; unsigned long moderator; -int TestKeys = 0; //////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -762,7 +761,7 @@ bool validateFrame(const CProtocol& frame, const char* name) // Bad CRC - restart blue wire Serial port DebugPort.print("\007Bad CRC detected for "); DebugPort.print(name); - DebugPort.println(" frame - restarting Serial1"); + DebugPort.println(" frame - restarting blue wire's serial port"); char header[16]; sprintf(header, "[CRC_%s]", name); DebugReportFrame(header, frame, "\r\n"); @@ -789,36 +788,37 @@ void doKeyPad() lastKey = newKey; if(Press) { - Serial.println("PRESS"); +#ifdef DBG_KEYPAD + DebugPort.println("PRESS"); +#endif lastHoldTime = millis(); holdTimeout = 350; // initial hold delay } if(Release) { - Serial.println("RELEASE"); +#ifdef DBG_KEYPAD + DebugPort.println("RELEASE"); +#endif holdTimeout = 0; // cancel repeat } if(holdTimeout && ((millis() - lastHoldTime) > holdTimeout)) { +#ifdef DBG_KEYPAD + DebugPort.println("REPEAT"); +#endif lastHoldTime += holdTimeout; - Serial.println("REPEAT"); holdTimeout = 150; // repeat delay Repeat = newKey; } if((Press | Repeat) & keyPress_Left) { - TestKeys--; } if((Press | Repeat) & keyPress_Right) { - TestKeys++; } if((Press | Repeat) & keyPress_Up) { - TestKeys += 10; } if((Press | Repeat) & keyPress_Down) { - TestKeys -= 10; } if((Press | Repeat) & keyPress_Centre) { - TestKeys = 0; } } diff --git a/Arduino/BTCDieselHeater/display.cpp b/Arduino/BTCDieselHeater/display.cpp index 612ddfc..fb89f94 100644 --- a/Arduino/BTCDieselHeater/display.cpp +++ b/Arduino/BTCDieselHeater/display.cpp @@ -143,9 +143,6 @@ void updateOLED(const CProtocol& CtlFrame, const CProtocol& HtrFrame) showRunState(runstate, errstate); - display.setCursor(20,45); - display.print(TestKeys); - #ifdef DEMO_LARGEFONT display.fillRect(20,20, 80,16, BLACK); display.setCursor(20,20);