This commit is contained in:
2024-05-14 17:17:27 +02:00
parent 8f35f4f914
commit 2258c5a8be
3 changed files with 34 additions and 12 deletions

View File

@ -11,12 +11,14 @@ public class WatchdogTimer {
public static void testAndTrigger() {
watchdogTime = getTimeFromRegister() * 1000;
if (enabled && (Commands.getTotalExecutionTime() >= (watchdogTime + lastReset - 1))){
DataRegister.resetPC();
System.err.println("Watchdog Timer triggered");
DataRegister.clearBit(3, 4);
lastReset = Commands.getTotalExecutionTime();
Controller_Frontend.stopRunFromBackend();
if (enabled) {
System.err.println("Remaining: " + ((watchdogTime + lastReset - 1) - Commands.getTotalExecutionTime()));
if (Commands.getTotalExecutionTime() >= (watchdogTime + lastReset - 1)) {
System.err.println("Watchdog Timer triggered");
DataRegister.clearBit(3, 4);
lastReset = Commands.getTotalExecutionTime();
Controller_Frontend.stopRunFromBackend();
}
}
}