diff options
author | henryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2007-11-07 15:00:46 +0000 |
---|---|---|
committer | henryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2007-11-07 15:00:46 +0000 |
commit | 2306bcac783751b073babef1bf60dd196cfef73d (patch) | |
tree | 79f9ef895b9a63be28a702cb55fc28d08988ae1e | |
parent | 76fb5c0409d42adb21c86e171231561c0a718054 (diff) |
Add watchdog reset to dfu
git-svn-id: https://svn.openpcd.org:2342/trunk@314 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
-rw-r--r-- | firmware/src/dfu/dfu.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/firmware/src/dfu/dfu.c b/firmware/src/dfu/dfu.c index 58062a0..07b7401 100644 --- a/firmware/src/dfu/dfu.c +++ b/firmware/src/dfu/dfu.c @@ -912,7 +912,14 @@ void __dfufunc dfu_main(void) AT91F_DBGU_Printk("You may now start the DFU up/download process\r\n"); /* do nothing, since all of DFU is interrupt driven */ - while (1) ; + int i = 0; + while (1) { + /* Occasionally reset watchdog */ + i = (i+1) % 10000; + if( i== 0) { + AT91F_WDTRestart(AT91C_BASE_WDTC); + } + } } const struct dfuapi __dfufunctab dfu_api = { |