spi_flash: make {get,release}_temp_buffer OS functions optional

Fixes a crash when calling a NULL release_temp_buffer pointer throug
esp_flash_noos_functions, when doing a core dump.
This commit is contained in:
Ivan Grokhotkov
2020-07-29 12:42:26 +02:00
parent ef3280295d
commit 75a874d4fd
2 changed files with 10 additions and 11 deletions
@@ -70,19 +70,14 @@ static IRAM_ATTR esp_err_t delay_us(void *arg, unsigned us)
return ESP_OK;
}
// Currently when the os is not up yet, the caller is supposed to call esp_flash APIs with proper
// buffers.
IRAM_ATTR void* get_temp_buffer_not_supported(void* arg, size_t reqest_size, size_t* out_size)
{
return NULL;
}
const DRAM_ATTR esp_flash_os_functions_t esp_flash_noos_functions = {
.start = start,
.end = end,
.delay_us = delay_us,
.region_protected = NULL,
.get_temp_buffer = get_temp_buffer_not_supported,
/* the caller is supposed to call esp_flash_read/esp_flash_write APIs with buffers in DRAM */
.get_temp_buffer = NULL,
.release_temp_buffer = NULL,
.yield = NULL,
};