From 6c37fee7a189371401e384834ab98ec1da226ff8 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Thu, 10 Mar 2016 14:13:09 +0300 Subject: [PATCH] Update interrupts to be masked when accessing flash (#1388) --- cores/esp8266/Esp.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cores/esp8266/Esp.cpp b/cores/esp8266/Esp.cpp index 3416c9b91..6dcc6d4df 100644 --- a/cores/esp8266/Esp.cpp +++ b/cores/esp8266/Esp.cpp @@ -466,7 +466,15 @@ bool EspClass::updateSketch(Stream& in, uint32_t size, bool restartOnFail, bool return true; } -static const int FLASH_INT_MASK = ((B10 << 8) | B00111010); +// Interrupts which are masked by flash access routines +static const int FLASH_INT_MASK = + (1 << ETS_SLC_INUM) | + (1 << ETS_SPI_INUM) | + (1 << ETS_GPIO_INUM) | + (1 << ETS_UART_INUM) | + (1 << ETS_CCOMPARE0_INUM) | + (1 << ETS_FRC_TIMER1_INUM); + bool EspClass::flashEraseSector(uint32_t sector) { ets_isr_mask(FLASH_INT_MASK);