esp_flash: fix the incorrect check_idle logic in LL and chip_driver

This commit is contained in:
Michael (XIAO Xufeng)
2020-09-21 10:59:07 +08:00
committed by bot
parent 92b72aa6c8
commit fe37db3271
5 changed files with 6 additions and 6 deletions

View File

@@ -287,7 +287,7 @@ esp_err_t spi_flash_chip_generic_get_write_protect(esp_flash_t *chip, bool *out_
esp_err_t spi_flash_generic_wait_host_idle(esp_flash_t *chip, uint32_t *timeout_us)
{
while (chip->host->driver->host_idle(chip->host) && *timeout_us > 0) {
while (!chip->host->driver->host_idle(chip->host) && *timeout_us > 0) {
#if HOST_DELAY_INTERVAL_US > 0
if (*timeout_us > 1) {
int delay = MIN(HOST_DELAY_INTERVAL_US, *timeout_us);