@@ -46,9 +46,8 @@ static enum mgos_vfs_dev_err esp_spi_flash_readwrite_128(size_t addr,
46
46
uint32_t aligned_addr = addr & (- FLASH_UNIT_SIZE );
47
47
size_t aligned_size =
48
48
((size + (FLASH_UNIT_SIZE - 1 )) & - FLASH_UNIT_SIZE ) + FLASH_UNIT_SIZE ;
49
- mgos_ints_disable ();
49
+
50
50
int sres = spi_flash_read (aligned_addr , (uint32 * ) tmp_buf , aligned_size );
51
- mgos_ints_enable ();
52
51
if (sres != 0 ) {
53
52
LOG (LL_ERROR , ("spi_flash_read failed: %d (%d, %d)" , sres ,
54
53
(int ) aligned_addr , (int ) aligned_size ));
@@ -62,9 +61,7 @@ static enum mgos_vfs_dev_err esp_spi_flash_readwrite_128(size_t addr,
62
61
63
62
memcpy (((uint8_t * ) tmp_buf ) + (addr - aligned_addr ), data , size );
64
63
65
- mgos_ints_disable ();
66
64
sres = spi_flash_write (aligned_addr , (uint32 * ) tmp_buf , aligned_size );
67
- mgos_ints_enable ();
68
65
if (sres != 0 ) {
69
66
LOG (LL_ERROR , ("spi_flash_write failed: %d (%d, %d)" , sres ,
70
67
(int ) aligned_addr , (int ) aligned_size ));
@@ -118,10 +115,7 @@ static enum mgos_vfs_dev_err esp_vfs_dev_sysflash_erase(
118
115
}
119
116
u32_t sector = (offset / FLASH_SECTOR_SIZE );
120
117
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 ) {
125
119
res = MGOS_VFS_DEV_ERR_IO ;
126
120
goto out ;
127
121
}
0 commit comments