Chypsylon 0 Posted April 16, 2013 Share Posted April 16, 2013 Is there any watchdog functionality implemented in Energia? Quote Link to post Share on other sites
Chypsylon 0 Posted April 18, 2013 Author Share Posted April 18, 2013 I was able to get it working using the functions from the original Stellarisware driver. #include "inc/hw_types.h" #include "inc/hw_ints.h" #include "driverlib/sysctl.h" #include "driverlib/eeprom.h" #include "driverlib/watchdog.h" #include "driverlib/interrupt.h" void setup() {} void loop() { //Watchdog Stuff SysCtlPeripheralEnable(SYSCTL_PERIPH_WDOG0); SysCtlPeripheralReset(SYSCTL_PERIPH_WDOG0); if(WatchdogLockState(WATCHDOG0_BASE) == true) { WatchdogUnlock(WATCHDOG0_BASE); } WatchdogReloadSet(WATCHDOG0_BASE, ROM_SysCtlClockGet()); WatchdogResetEnable(WATCHDOG0_BASE); WatchdogEnable(WATCHDOG0_BASE); //IntMasterEnable(); //IntEnable(INT_WATCHDOG); while(1) { WatchdogIntClear(WATCHDOG0_BASE); //do stuff } } My only remaining problem is that I need to know when the watchdog triggered a reset. There must be some way to read the Reset Source at startup but I couldn't find anything on that :/ Alternatively I could use the Watchdog ISR, but as far as I understand it, it has to be defined in the vector table in "startup_gcc.c" and implemented in "WInterrupts.c". But these files are compiled at startup of Energia (I'm running on the latest git version), so I've got no way to pass variables between it and my main file :? Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.