Basic implementation of watchdog
Dependencies: STM_ResetSupervisor USBDevice
main.cpp@0:975e02a70882, 2019-06-25 (annotated)
- Committer:
- JesiMiranda
- Date:
- Tue Jun 25 23:31:34 2019 +0000
- Revision:
- 0:975e02a70882
- Child:
- 1:38b385f34687
Basic watchdog implementation for ST Nucleo boards;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
JesiMiranda | 0:975e02a70882 | 1 | #include "mbed.h" |
JesiMiranda | 0:975e02a70882 | 2 | #include <ros.h> |
JesiMiranda | 0:975e02a70882 | 3 | #include <nav_msgs/Odometry.h> //contains both the twist and pose |
JesiMiranda | 0:975e02a70882 | 4 | #include "Watchdog.h" |
JesiMiranda | 0:975e02a70882 | 5 | |
JesiMiranda | 0:975e02a70882 | 6 | |
JesiMiranda | 0:975e02a70882 | 7 | Serial pc(USBTX, USBRX, 57600); //Serial Monitor |
JesiMiranda | 0:975e02a70882 | 8 | |
JesiMiranda | 0:975e02a70882 | 9 | int main(void) |
JesiMiranda | 0:975e02a70882 | 10 | { |
JesiMiranda | 0:975e02a70882 | 11 | Watchdog dog; |
JesiMiranda | 0:975e02a70882 | 12 | dog.Configure(1); |
JesiMiranda | 0:975e02a70882 | 13 | pc.print("is it caused ",dog.WatchdogCausedReset()); |
JesiMiranda | 0:975e02a70882 | 14 | |
JesiMiranda | 0:975e02a70882 | 15 | while(1) |
JesiMiranda | 0:975e02a70882 | 16 | { |
JesiMiranda | 0:975e02a70882 | 17 | pc.printf("hello \r\n"); |
JesiMiranda | 0:975e02a70882 | 18 | wait(1.6); |
JesiMiranda | 0:975e02a70882 | 19 | dog.Service(); |
JesiMiranda | 0:975e02a70882 | 20 | //return 0; |
JesiMiranda | 0:975e02a70882 | 21 | } |
JesiMiranda | 0:975e02a70882 | 22 | } |