Call watchdog_periodic before erasing each sector, because this operation
takes approximately 1s.
This commit is contained in:
parent
685de41feb
commit
bed0963769
|
@ -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.3 2007/11/10 20:45:29 adamdunkels Exp $
|
* @(#)$Id: xmem.c,v 1.4 2008/01/21 10:28:44 nvt-se Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -49,6 +49,7 @@
|
||||||
|
|
||||||
#include "dev/spi.h"
|
#include "dev/spi.h"
|
||||||
#include "dev/xmem.h"
|
#include "dev/xmem.h"
|
||||||
|
#include "dev/watchdog.h"
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
#define PRINTF(...) printf(__VA_ARGS__)
|
#define PRINTF(...) printf(__VA_ARGS__)
|
||||||
|
@ -250,8 +251,10 @@ xmem_erase(long size, off_t addr)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (; addr < end; addr += XMEM_ERASE_UNIT_SIZE)
|
for (; addr < end; addr += XMEM_ERASE_UNIT_SIZE) {
|
||||||
|
watchdog_periodic();
|
||||||
erase_sector(addr);
|
erase_sector(addr);
|
||||||
|
}
|
||||||
|
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue