Closed
Description
I am trying to use the watchdog in an Mbed-OS way, but I am having problems. Any idea how to fix this?
// inspired from https://os.mbed.com/docs/mbed-os/v6.6/apis/watchdog.html
#include "mbed.h"
const uint32_t TIMEOUT_MS = 5000;
void setup() {
// put your setup code here, to run once:
}
int main()
{
Serial.begin(57600);
Serial.println(F("Start"));
Serial.end();
Watchdog &watchdog = Watchdog::get_instance();
watchdog.start(TIMEOUT_MS);
while (true) {
Serial.begin(57600);
if (true){
Serial.print(F("reset watchdog"));
Watchdog::get_instance().kick();
}
else{
Serial.println(F("do not reset watchdog; will bite in a few iterations..."));
}
ThisThread::sleep_for(TIMEOUT_MS / 10);
Serial.end();
}
}
Does not compile:
'Watchdog' was not declared in this scope
I also tried with a:
rtos::Watchdog &watchdog = rtos::Watchdog::get_instance();
similar to what is used for threads in the example provided, but with no success:
'Watchdog' is not a member of 'rtos'
Metadata
Metadata
Assignees
Labels
No labels