mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +03:00
Disable WDT in eboot while copying new sketch (#517)
This commit is contained in:
parent
973ae3986b
commit
481cee6460
@ -14,6 +14,8 @@
|
||||
|
||||
#define SWRST do { (*((volatile uint32_t*) 0x60000700)) |= 0x80000000; } while(0);
|
||||
|
||||
extern void ets_wdt_enable(void);
|
||||
extern void ets_wdt_disable(void);
|
||||
|
||||
int load_app_from_flash_raw(const uint32_t flash_addr)
|
||||
{
|
||||
@ -87,7 +89,9 @@ int copy_raw(const uint32_t src_addr,
|
||||
uint32_t left = ((size+buffer_size-1) & ~(buffer_size-1));
|
||||
uint32_t saddr = src_addr;
|
||||
uint32_t daddr = dst_addr;
|
||||
|
||||
|
||||
ets_wdt_disable();
|
||||
|
||||
while (left) {
|
||||
if (SPIEraseSector(daddr/buffer_size)) {
|
||||
return 2;
|
||||
@ -103,6 +107,8 @@ int copy_raw(const uint32_t src_addr,
|
||||
left -= buffer_size;
|
||||
}
|
||||
|
||||
ets_wdt_enable();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user