From 850f8fd13e59ccc7221ab76ca692eac6576e0251 Mon Sep 17 00:00:00 2001 From: WJCarpenter Date: Mon, 11 Feb 2019 01:20:04 -0800 Subject: [PATCH] Return explicit booleans (#98) I was being prompted to calibrate on every power-up or reset. Returning explicit boolean values from these methods fixed it for me. --- TouchControllerWS.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/TouchControllerWS.cpp b/TouchControllerWS.cpp index e249554..13078b4 100644 --- a/TouchControllerWS.cpp +++ b/TouchControllerWS.cpp @@ -30,7 +30,7 @@ bool TouchControllerWS::loadCalibration() { } f.close(); - + return true; } bool TouchControllerWS::saveCalibration() { @@ -40,6 +40,7 @@ bool TouchControllerWS::saveCalibration() { File f = SPIFFS.open("/calibration.txt", "w"); if (!f) { Serial.println("file creation failed"); + return false; } // now write two lines in key/value style with end-of-line characters f.println(dx); @@ -48,6 +49,7 @@ bool TouchControllerWS::saveCalibration() { f.println(ay); f.close(); + return true; } void TouchControllerWS::startCalibration(CalibrationCallback *calibrationCallback) {