This shows you the differences between two versions of the page.
20b:defeating_the_watchdog_timer [2009/10/22 20:17] bruceb created |
20b:defeating_the_watchdog_timer [2009/10/22 20:17] (current) bruceb created |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== Defeating the watchdog timer ===== | ||
+ | |||
+ | To defeat the watchdog, use the **Watchdog()** function or the **watchdog** inline function (one is inlined, one is a function call). | ||
+ | |||
+ | If that isn't defined in your version of the SDK, use the following code snippit: | ||
+ | |||
+ | < | ||
+ | #ifdef _ARM_ | ||
+ | |||
+ | #include " | ||
+ | |||
+ | TMyApplication *const MyApplication = (TMyApplication*) 0x300000; | ||
+ | |||
+ | // restart the watchdog | ||
+ | | ||
+ | inline void Watchdog() { | ||
+ | AT91C_BASE_WDTC-> | ||
+ | } | ||
+ | |||
+ | void watchdog(); | ||
+ | |||
+ | // same function as above, but not inlined... | ||
+ | |||
+ | #else | ||
+ | |||
+ | extern TMyApplication MYAPPLICATION; | ||
+ | |||
+ | TMyApplication *const MyApplication= & | ||
+ | |||
+ | inline void Watchdog() { } | ||
+ | |||
+ | #endif | ||
+ | </ | ||
+ | |||
+ | Don't forget to define MYAPPLICATION in the Windows-only part of the code somewhere. | ||
+ | |||