Skip to content

Commit cbd2bd6

Browse files
committed
Revert "ESP8266: Disable interrupts while reading/writing flash"
This reverts commit 83c0929. Not needed after all
1 parent 83c0929 commit cbd2bd6

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/esp8266/esp_vfs_dev_sysflash.c

+2-8
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ static enum mgos_vfs_dev_err esp_spi_flash_readwrite_128(size_t addr,
4646
uint32_t aligned_addr = addr & (-FLASH_UNIT_SIZE);
4747
size_t aligned_size =
4848
((size + (FLASH_UNIT_SIZE - 1)) & -FLASH_UNIT_SIZE) + FLASH_UNIT_SIZE;
49-
mgos_ints_disable();
49+
5050
int sres = spi_flash_read(aligned_addr, (uint32 *) tmp_buf, aligned_size);
51-
mgos_ints_enable();
5251
if (sres != 0) {
5352
LOG(LL_ERROR, ("spi_flash_read failed: %d (%d, %d)", sres,
5453
(int) aligned_addr, (int) aligned_size));
@@ -62,9 +61,7 @@ static enum mgos_vfs_dev_err esp_spi_flash_readwrite_128(size_t addr,
6261

6362
memcpy(((uint8_t *) tmp_buf) + (addr - aligned_addr), data, size);
6463

65-
mgos_ints_disable();
6664
sres = spi_flash_write(aligned_addr, (uint32 *) tmp_buf, aligned_size);
67-
mgos_ints_enable();
6865
if (sres != 0) {
6966
LOG(LL_ERROR, ("spi_flash_write failed: %d (%d, %d)", sres,
7067
(int) aligned_addr, (int) aligned_size));
@@ -118,10 +115,7 @@ static enum mgos_vfs_dev_err esp_vfs_dev_sysflash_erase(
118115
}
119116
u32_t sector = (offset / FLASH_SECTOR_SIZE);
120117
while (sector * FLASH_SECTOR_SIZE < offset + len) {
121-
mgos_ints_disable();
122-
int ret = spi_flash_erase_sector(sector);
123-
mgos_ints_enable();
124-
if (ret != SPI_FLASH_RESULT_OK) {
118+
if (spi_flash_erase_sector(sector) != SPI_FLASH_RESULT_OK) {
125119
res = MGOS_VFS_DEV_ERR_IO;
126120
goto out;
127121
}

0 commit comments

Comments
 (0)