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:
+4
-2
@@ -31,7 +31,8 @@ void setup(void) {
|
|||||||
watchdogs();
|
watchdogs();
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop(void) {
|
int main(void) {
|
||||||
|
while(true) {
|
||||||
if (readSensors) {
|
if (readSensors) {
|
||||||
int16_t result = readMoisture();
|
int16_t result = readMoisture();
|
||||||
if (result != -1) {
|
if (result != -1) {
|
||||||
@@ -39,6 +40,7 @@ void loop(void) {
|
|||||||
readSensors = false;
|
readSensors = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enterSleep();
|
enterSleep();
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user