spi_flash: define spi_flash_guard_{start,stop} with IRAM_ATTR

These functions are marked as inline and are called from functions which are in IRAM.
In release (-Os) builds, the compiler may decide not to inline these functions.
Placing these functions into IRAM explicitly works around this.
This commit is contained in:
Ivan Grokhotkov 2017-01-17 00:42:55 +08:00
parent 48ae7ab500
commit 075446318d

View file

@ -103,16 +103,18 @@ SpiFlashOpResult IRAM_ATTR spi_flash_unlock()
return SPI_FLASH_RESULT_OK; return SPI_FLASH_RESULT_OK;
} }
static inline void spi_flash_guard_start() static inline void IRAM_ATTR spi_flash_guard_start()
{ {
if (s_flash_guard_ops) if (s_flash_guard_ops) {
s_flash_guard_ops->start(); s_flash_guard_ops->start();
}
} }
static inline void spi_flash_guard_end() static inline void IRAM_ATTR spi_flash_guard_end()
{ {
if (s_flash_guard_ops) if (s_flash_guard_ops) {
s_flash_guard_ops->end(); s_flash_guard_ops->end();
}
} }
esp_err_t IRAM_ATTR spi_flash_erase_sector(size_t sec) esp_err_t IRAM_ATTR spi_flash_erase_sector(size_t sec)