Skip to content

Commit 850f8fd

Browse files
wjcarpentermarcelstoer
authored andcommitted
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.
1 parent 086416b commit 850f8fd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

TouchControllerWS.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ bool TouchControllerWS::loadCalibration() {
3030

3131
}
3232
f.close();
33-
33+
return true;
3434
}
3535

3636
bool TouchControllerWS::saveCalibration() {
@@ -40,6 +40,7 @@ bool TouchControllerWS::saveCalibration() {
4040
File f = SPIFFS.open("/calibration.txt", "w");
4141
if (!f) {
4242
Serial.println("file creation failed");
43+
return false;
4344
}
4445
// now write two lines in key/value style with end-of-line characters
4546
f.println(dx);
@@ -48,6 +49,7 @@ bool TouchControllerWS::saveCalibration() {
4849
f.println(ay);
4950

5051
f.close();
52+
return true;
5153
}
5254

5355
void TouchControllerWS::startCalibration(CalibrationCallback *calibrationCallback) {

0 commit comments

Comments
 (0)