From: bernie Date: Tue, 26 Oct 2004 08:35:31 +0000 (+0000) Subject: Reset watchdog for long operations. X-Git-Tag: 1.0.0~981 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=8ff088ff4cf0ddbff09c6630e36370bf25f33535;p=bertos.git Reset watchdog for long operations. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@260 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/drv/eeprom.c b/drv/eeprom.c index 81b29588..0f301eff 100755 --- a/drv/eeprom.c +++ b/drv/eeprom.c @@ -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 #include /* cpu_to_be16() */ #include #include @@ -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;