Refactor loop to main and add explicit while(true)
This change transitions from the Arduino-specific `loop()` to a standard C++ `main()` function as the program's entry point and primary execution cycle.
This commit is contained in:
+10
-8
@@ -31,14 +31,16 @@ void setup(void) {
|
|||||||
watchdogs();
|
watchdogs();
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop(void) {
|
int main(void) {
|
||||||
if (readSensors) {
|
while(true) {
|
||||||
int16_t result = readMoisture();
|
if (readSensors) {
|
||||||
if (result != -1) {
|
int16_t result = readMoisture();
|
||||||
Serial.println(result);
|
if (result != -1) {
|
||||||
readSensors = false;
|
Serial.println(result);
|
||||||
|
readSensors = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
enterSleep();
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
enterSleep();
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user