Skip to content

Commit a9f0f95

Browse files
Remove interrupt disable around flash operations
All interrupt service routines are supposed to be in IRAM now, so there is no need to keep interrupts disabled while doing flash operations. Remove the IRQ disable/enable from the ESP.flash* methods. Related to esp8266#5568
1 parent b26c19e commit a9f0f95

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

cores/esp8266/Esp.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -572,9 +572,7 @@ bool EspClass::updateSketch(Stream& in, uint32_t size, bool restartOnFail, bool
572572
static const int FLASH_INT_MASK = ((B10 << 8) | B00111010);
573573

574574
bool EspClass::flashEraseSector(uint32_t sector) {
575-
ets_isr_mask(FLASH_INT_MASK);
576575
int rc = spi_flash_erase_sector(sector);
577-
ets_isr_unmask(FLASH_INT_MASK);
578576
return rc == 0;
579577
}
580578

@@ -622,7 +620,6 @@ static int spi_flash_write_puya(uint32_t offset, uint32_t *data, size_t size) {
622620
#endif
623621

624622
bool EspClass::flashWrite(uint32_t offset, uint32_t *data, size_t size) {
625-
ets_isr_mask(FLASH_INT_MASK);
626623
int rc = 0;
627624
#if PUYA_SUPPORT
628625
if (getFlashChipVendorId() == SPI_FLASH_VENDOR_PUYA) {
@@ -633,14 +630,11 @@ bool EspClass::flashWrite(uint32_t offset, uint32_t *data, size_t size) {
633630
{
634631
rc = spi_flash_write(offset, data, size);
635632
}
636-
ets_isr_unmask(FLASH_INT_MASK);
637633
return rc == 0;
638634
}
639635

640636
bool EspClass::flashRead(uint32_t offset, uint32_t *data, size_t size) {
641-
ets_isr_mask(FLASH_INT_MASK);
642637
int rc = spi_flash_read(offset, (uint32_t*) data, size);
643-
ets_isr_unmask(FLASH_INT_MASK);
644638
return rc == 0;
645639
}
646640

0 commit comments

Comments
 (0)