Penn Electric Racing / Mbed 2 deprecated SystemManagement

Dependencies:   mbed CANBuffer Watchdog MODSERIAL mbed-rtos xbeeRelay IAP

Fork of SystemManagement by Martin Deng

SysMngmt.cpp

Committer:
pspatel321
Date:
2014-11-08
Revision:
29:f148490b5f65
Parent:
20:3dfa7e9461a0

File content as of revision 29:f148490b5f65:

#include "mbed.h"
#include "rtos.h"
#include "IOobjects.h"
#include "SerialDiagnostics.h"

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();
    }
}