Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Watchdog.cpp
00001 #include "Watchdog.h" 00002 #include "mbed.h" 00003 00004 void Watchdog::kick(float s) 00005 { 00006 LPC_WDT->WDCLKSEL = 0x1; // Set CLK src to PCLK 00007 uint32_t clk = SystemCoreClock / 16; // WD has a fixed /4 prescaler, PCLK default is /4 00008 LPC_WDT->WDTC = s * (float)clk; 00009 LPC_WDT->WDMOD = 0x3; // Enabled and Reset 00010 kick(); 00011 } 00012 void Watchdog::kick() 00013 { 00014 LPC_WDT->WDFEED = 0xAA; 00015 LPC_WDT->WDFEED = 0x55; 00016 }
Generated on Tue Jul 19 2022 01:26:58 by
1.7.2