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.
Dependents: Orange_Ferrari_board_functional
Diff: main.h
- Revision:
- 1:6a820a0ca03b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.h Mon Oct 21 22:36:51 2013 +0000
@@ -0,0 +1,27 @@
+#ifndef MAIN_H
+#define MAIN_H
+
+extern "C" void mbed_reset();
+extern "C" void HardFault_Handler() { mbed_reset(); }
+class Watchdog {
+public:
+// Load timeout value in watchdog timer and enable
+ void 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 kick() {
+ LPC_WDT->WDFEED = 0xAA;
+ LPC_WDT->WDFEED = 0x55;
+ }
+};
+Watchdog wdt;
+
+void DDRO_Sensor(JTAG &jtag);
+int check_FFT_Freq(JTAG &jtag, int fMHz);
+#endif
\ No newline at end of file