From 2306bcac783751b073babef1bf60dd196cfef73d Mon Sep 17 00:00:00 2001 From: henryk Date: Wed, 7 Nov 2007 15:00:46 +0000 Subject: Add watchdog reset to dfu git-svn-id: https://svn.openpcd.org:2342/trunk@314 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- firmware/src/dfu/dfu.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'firmware/src/dfu') 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 = { -- cgit v1.2.3