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:
2025-05-14 13:02:17 +02:00
parent 82dba30e18
commit 5f154cb20f
+10 -8
View File
@@ -31,14 +31,16 @@ void setup(void) {
watchdogs();
}
void loop(void) {
if (readSensors) {
int16_t result = readMoisture();
if (result != -1) {
Serial.println(result);
readSensors = false;
int main(void) {
while(true) {
if (readSensors) {
int16_t result = readMoisture();
if (result != -1) {
Serial.println(result);
readSensors = false;
}
}
enterSleep();
}
enterSleep();
return 0;
}