Dodge/Chrysler Radio Emulator Connect to Interior CAN bus
Dependencies: mbed SDFileSystem
WatchDogTimer.cpp
- Committer:
- rtgree01
- Date:
- 2011-01-31
- Revision:
- 0:9bc41d70bdd3
File content as of revision 0:9bc41d70bdd3:
#include "WatchDogTimer.h" void WatchDogTimer::kick(float s) { LPC_WDT->WDCLKSEL = 0x1; // Set CLK src to PCLK uint32_t clk = SystemCoreClock / 16; // WD has a fixed /4 prescaler, PCLK default is /4 LPC_WDT->WDTC = s * (float)clk; LPC_WDT->WDMOD = 0x3; // Enabled and Reset kick(); } // "kick" or "feed" the dog - reset the watchdog timer // by writing this required bit pattern void WatchDogTimer::kick() { LPC_WDT->WDFEED = 0xAA; LPC_WDT->WDFEED = 0x55; }