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

@@ -341,6 +341,10 @@ typedef void (*spi_flash_op_unlock_func_t)(void);
* @brief Function to protect SPI flash critical regions corruption.
*/
typedef bool (*spi_flash_is_safe_write_address_t)(size_t addr, size_t size);
/**
* @brief Function to yield to the OS during erase operation.
*/
typedef void (*spi_flash_os_yield_t)(void);
/**
* Structure holding SPI flash access critical sections management functions.
@@ -381,6 +385,7 @@ typedef struct {
#if !CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED
spi_flash_is_safe_write_address_t is_safe_write_address; /**< checks flash write addresses.*/
#endif
spi_flash_os_yield_t yield; /**< yield to the OS during flash erase */
} spi_flash_guard_funcs_t;
/**