Reset watchdog for long operations.
authorbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 26 Oct 2004 08:35:31 +0000 (08:35 +0000)
committerbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 26 Oct 2004 08:35:31 +0000 (08:35 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@260 38d2e660-2303-0410-9eaa-f027e97ec537

drv/eeprom.c

index 81b295888e195e02a1b15a59580161c90097e846..0f301effa709c41d463398d9f45d5033ed69e849 100755 (executable)
@@ -16,6 +16,9 @@
 
 /*#*
  *#* $Log$
+ *#* Revision 1.11  2004/10/26 08:35:31  bernie
+ *#* Reset watchdog for long operations.
+ *#*
  *#* Revision 1.10  2004/09/20 03:31:22  bernie
  *#* Sanitize for C++.
  *#*
@@ -50,6 +53,7 @@
 
 #include "eeprom.h"
 
+#include <drv/wdt.h>
 #include <mware/byteorder.h> /* cpu_to_be16() */
 #include <debug.h>
 #include <hw.h>
@@ -292,6 +296,8 @@ bool eeprom_write(e2addr_t addr, const void *buf, size_t count)
 /*!
  * Copy \c count bytes at address \c addr
  * from eeprom to RAM to buffer \c buf.
+ *
+ * \return true on success.
  */
 bool eeprom_read(e2addr_t addr, void *buf, size_t count)
 {
@@ -370,6 +376,9 @@ void eeprom_erase(e2addr_t addr, size_t count)
        // Clear all but struct hw_info at start of eeprom
        while (count)
        {
+               // Long operation, reset watchdog
+               wdt_reset();
+
                size_t size = MIN(count, sizeof buf);
                eeprom_write(addr, buf, size);
                addr += size;