From ac36c7d46699d0a40e7c34b23baed80be0cea65c Mon Sep 17 00:00:00 2001 From: Eren Tekbas Date: Wed, 7 May 2025 13:39:28 -0400 Subject: [PATCH 1/2] added watchdog commands for motor microcontroller --- src/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index d9184ff..7ee252b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -103,7 +103,7 @@ void setup() { pinMode(speedFreqLPin, INPUT_PULLDOWN); attachInterrupt(digitalPinToInterrupt(speedFreqRPin), pulse_handler_1, RISING); attachInterrupt(digitalPinToInterrupt(speedFreqLPin), pulse_handler_2, RISING); - + watchdog_enable(3000, 1); // updating the watchdog// set the watchdog to run at 8s interval @@ -132,7 +132,7 @@ void setup() { } void loop() { - + watchdog_update(); //updating the watchdog #if defined(ROS) || defined(ROS_DEBUG) microRosTick(); refSpeedSensors = getRefSpeed(); @@ -227,4 +227,4 @@ void loop() { #ifdef ROS_DEBUG transmitDac(refSpeedL, refSpeedR); #endif -} +} \ No newline at end of file From 0ee9f3cd7721b3ec143fb44b0f5ad2c6b9d9acf4 Mon Sep 17 00:00:00 2001 From: Robbie Leslie Date: Sun, 18 May 2025 18:21:04 -0400 Subject: [PATCH 2/2] Added watchdog include --- src/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.cpp b/src/main.cpp index 7ee252b..a88b247 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -9,6 +9,7 @@ It will also read the speed of the motor and send it to the onboard computer. #include #include "RefSpeed.h" #include "BatteryFunctions.h" +#include "hardware/watchdog.h" #if defined(ROS) || defined(ROS_DEBUG) #include