Disable the watchdog during the whole erase operation.

This commit is contained in:
nvt-se 2008-01-21 10:40:26 +00:00
parent a4d5ca833c
commit 6005437b27

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* @(#)$Id: xmem.c,v 1.4 2008/01/21 10:28:44 nvt-se Exp $ * @(#)$Id: xmem.c,v 1.5 2008/01/21 10:40:26 nvt-se Exp $
*/ */
/** /**
@ -251,11 +251,14 @@ xmem_erase(long size, off_t addr)
return -1; return -1;
} }
watchdog_stop();
for (; addr < end; addr += XMEM_ERASE_UNIT_SIZE) { for (; addr < end; addr += XMEM_ERASE_UNIT_SIZE) {
watchdog_periodic();
erase_sector(addr); erase_sector(addr);
} }
watchdog_start();
return size; return size;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/