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.
This commit is contained in:
@@ -30,7 +30,7 @@ bool TouchControllerWS::loadCalibration() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
f.close();
|
f.close();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TouchControllerWS::saveCalibration() {
|
bool TouchControllerWS::saveCalibration() {
|
||||||
@@ -40,6 +40,7 @@ bool TouchControllerWS::saveCalibration() {
|
|||||||
File f = SPIFFS.open("/calibration.txt", "w");
|
File f = SPIFFS.open("/calibration.txt", "w");
|
||||||
if (!f) {
|
if (!f) {
|
||||||
Serial.println("file creation failed");
|
Serial.println("file creation failed");
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
// now write two lines in key/value style with end-of-line characters
|
// now write two lines in key/value style with end-of-line characters
|
||||||
f.println(dx);
|
f.println(dx);
|
||||||
@@ -48,6 +49,7 @@ bool TouchControllerWS::saveCalibration() {
|
|||||||
f.println(ay);
|
f.println(ay);
|
||||||
|
|
||||||
f.close();
|
f.close();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TouchControllerWS::startCalibration(CalibrationCallback *calibrationCallback) {
|
void TouchControllerWS::startCalibration(CalibrationCallback *calibrationCallback) {
|
||||||
|
|||||||
Reference in New Issue
Block a user