Penn Electric Racing / Mbed 2 deprecated SystemManagement

Dependencies:   mbed CANBuffer Watchdog MODSERIAL mbed-rtos xbeeRelay IAP

Fork of SystemManagement by Martin Deng

Revision:
20:3dfa7e9461a0
Parent:
19:3a817d2cef11
Child:
29:f148490b5f65
--- a/SysMngmt.cpp	Sat Oct 25 16:48:09 2014 +0000
+++ b/SysMngmt.cpp	Fri Nov 07 01:26:13 2014 +0000
@@ -1,19 +1,21 @@
-/*
-    Reads CAN Messages and various data inputs, outputs using Xbee radio modules
-
-    Revised Oct 19, 2014: First team repository version
-*/
-
 #include "mbed.h"
+#include "rtos.h"
+#include "IOobjects.h"
+#include "SerialDiagnostics.h"
 
-DigitalOut myled(LED1);
-
-int main(){
-
-    while(1){
-        myled = 1;
-        wait(0.2);
-        myled = 0;
-        wait(0.2);
+int main() {
+    wdt.kick();                         // Kick the watchdog timer
+    pc.baud(921600);
+    pc.printf("\r\n\r\nPCM Reset\r\n");
+    
+    // Did a watchdog reset occur since last power cycle?
+    if (wdt.checkFlag()) {
+        pc.printf("Watchdog Reset\r\n");
+    }
+    
+    Thread serialThread(SerialDiagnostics::thread_serialOut, 0, osPriorityNormal, 6000);
+    
+    while(1) {
+        wdt.kick();
     }
 }