mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +03:00
Make sure WDT is re-enabled in eboot even in case of error (#517)
This commit is contained in:
parent
481cee6460
commit
91ca9ba75b
@ -90,8 +90,6 @@ int copy_raw(const uint32_t src_addr,
|
|||||||
uint32_t saddr = src_addr;
|
uint32_t saddr = src_addr;
|
||||||
uint32_t daddr = dst_addr;
|
uint32_t daddr = dst_addr;
|
||||||
|
|
||||||
ets_wdt_disable();
|
|
||||||
|
|
||||||
while (left) {
|
while (left) {
|
||||||
if (SPIEraseSector(daddr/buffer_size)) {
|
if (SPIEraseSector(daddr/buffer_size)) {
|
||||||
return 2;
|
return 2;
|
||||||
@ -107,8 +105,6 @@ int copy_raw(const uint32_t src_addr,
|
|||||||
left -= buffer_size;
|
left -= buffer_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
ets_wdt_enable();
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,7 +126,9 @@ void main()
|
|||||||
|
|
||||||
if (cmd.action == ACTION_COPY_RAW) {
|
if (cmd.action == ACTION_COPY_RAW) {
|
||||||
ets_putc('c'); ets_putc('p'); ets_putc(':');
|
ets_putc('c'); ets_putc('p'); ets_putc(':');
|
||||||
|
ets_wdt_disable();
|
||||||
res = copy_raw(cmd.args[0], cmd.args[1], cmd.args[2]);
|
res = copy_raw(cmd.args[0], cmd.args[1], cmd.args[2]);
|
||||||
|
ets_wdt_enable();
|
||||||
ets_putc('0'+res); ets_putc('\n');
|
ets_putc('0'+res); ets_putc('\n');
|
||||||
if (res == 0) {
|
if (res == 0) {
|
||||||
cmd.action = ACTION_LOAD_APP;
|
cmd.action = ACTION_LOAD_APP;
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user