Fix watchdog code in repeater

This commit is contained in:
Quency-D 2026-02-09 11:43:41 +08:00
parent 9df34e09d0
commit 53ff4ed57f
3 changed files with 29 additions and 6 deletions

View file

@ -141,11 +141,16 @@ void SolarExWatchdog::loop() {
}
unsigned long SolarExWatchdog::getIntervalMs() const {
return next_feed_watchdog - millis();
unsigned long interval_ms = 0;
interval_ms = next_feed_watchdog - millis();
if(interval_ms > EX_WATCHDOG_TIMEOUT_MS) {
interval_ms = EX_WATCHDOG_TIMEOUT_MS;
}
return interval_ms;
}
void SolarExWatchdog::feed() {
digitalWrite(EX_WATCHDOG_DONE_PIN, HIGH);
delay(1);
digitalWrite(EX_WATCHDOG_DONE_PIN, LOW);
}
}