spi_flash: don't call vTaskDelay in non-os context

Fixes regression in core dump, when a crash happens in interrupt
context.
This commit is contained in:
Ivan Grokhotkov
2020-05-29 21:52:48 +02:00
parent e1ec6c86e6
commit 03bb2774d9
6 changed files with 42 additions and 7 deletions

View File

@@ -372,7 +372,9 @@ esp_err_t IRAM_ATTR esp_flash_erase_region(esp_flash_t *chip, uint32_t start, ui
no_yield_time_us += (esp_timer_get_time() - start_time_us);
if (no_yield_time_us / 1000 >= CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS) {
no_yield_time_us = 0;
vTaskDelay(CONFIG_SPI_FLASH_ERASE_YIELD_TICKS);
if (chip->os_func->yield) {
chip->os_func->yield(chip->os_func_data);
}
}
#endif
}