Skip to content

Commit 6c37fee

Browse files
committed
Update interrupts to be masked when accessing flash (#1388)
1 parent 6b0a117 commit 6c37fee

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

cores/esp8266/Esp.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,15 @@ bool EspClass::updateSketch(Stream& in, uint32_t size, bool restartOnFail, bool
466466
return true;
467467
}
468468

469-
static const int FLASH_INT_MASK = ((B10 << 8) | B00111010);
469+
// Interrupts which are masked by flash access routines
470+
static const int FLASH_INT_MASK =
471+
(1 << ETS_SLC_INUM) |
472+
(1 << ETS_SPI_INUM) |
473+
(1 << ETS_GPIO_INUM) |
474+
(1 << ETS_UART_INUM) |
475+
(1 << ETS_CCOMPARE0_INUM) |
476+
(1 << ETS_FRC_TIMER1_INUM);
477+
470478

471479
bool EspClass::flashEraseSector(uint32_t sector) {
472480
ets_isr_mask(FLASH_INT_MASK);

0 commit comments

Comments
 (0)