fix(spi_flash): Fix no exit critical after enter critical

This commit is contained in:
Zhang Jun Hao
2018-07-05 11:27:40 +08:00
parent 510a4ad345
commit 383244dbc2

View File

@@ -287,10 +287,14 @@ static esp_err_t IRAM_ATTR spi_flash_write_status(uint32_t status_value)
Cache_Read_Disable_2();
Wait_SPI_Idle(&flashchip);
if(ESP_OK != SPI_write_enable(&flashchip))
if(ESP_OK != SPI_write_enable(&flashchip)){
FLASH_INTR_UNLOCK(c_tmp);
return ESP_ERR_FLASH_OP_FAIL;
if(ESP_OK != SPI_write_status(&flashchip,status_value))
}
if(ESP_OK != SPI_write_status(&flashchip,status_value)){
FLASH_INTR_UNLOCK(c_tmp);
return ESP_ERR_FLASH_OP_FAIL;
}
Wait_SPI_Idle(&flashchip);
Cache_Read_Enable_2();