Merge branch 'fix/esp_flash_idle_logic' into 'master'

esp_flash: fix the incorrect check_idle logic in LL and chip_driver

See merge request espressif/esp-idf!10530
This commit is contained in:
Michael (XIAO Xufeng) 2020-10-03 09:18:41 +08:00
commit a263d9a8e4
5 changed files with 6 additions and 6 deletions

View File

@ -224,7 +224,7 @@ static inline void spi_flash_ll_user_start(spi_dev_t *dev)
*/
static inline bool spi_flash_ll_host_idle(const spi_dev_t *dev)
{
return dev->ext2.st != 0;
return dev->ext2.st == 0;
}
/*------------------------------------------------------------------------------
@ -390,4 +390,4 @@ static inline void spi_flash_ll_set_dummy(spi_dev_t *dev, uint32_t dummy_n)
#ifdef __cplusplus
}
#endif
#endif

View File

@ -156,7 +156,7 @@ static inline void gpspi_flash_ll_user_start(spi_dev_t *dev)
*/
static inline bool gpspi_flash_ll_host_idle(const spi_dev_t *dev)
{
return dev->fsm.st != 0;
return dev->fsm.st == 0;
}
/**

View File

@ -202,7 +202,7 @@ static inline void spimem_flash_ll_user_start(spi_mem_dev_t *dev)
*/
static inline bool spimem_flash_ll_host_idle(const spi_mem_dev_t *dev)
{
return dev->fsm.st != 0;
return dev->fsm.st == 0;
}
/**

View File

@ -202,7 +202,7 @@ static inline void spimem_flash_ll_user_start(spi_mem_dev_t *dev)
*/
static inline bool spimem_flash_ll_host_idle(const spi_mem_dev_t *dev)
{
return dev->fsm.st != 0;
return dev->fsm.st == 0;
}
/**

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);