bootloader: move some functions out of IRAM when building in bootloader mode

Fixes https://github.com/espressif/esp-idf/issues/80
pull/89/merge
Ivan Grokhotkov 2016-11-08 11:25:40 +08:00
rodzic 1e4f185d29
commit 81b18aa8d5
2 zmienionych plików z 18 dodań i 7 usunięć

Wyświetl plik

@ -284,7 +284,15 @@ static inline void heap_swap(int i, int j)
} }
#endif //BOOTLOADER_BUILD #endif //BOOTLOADER_BUILD
IRAM_ATTR uint32_t esp_log_early_timestamp()
#ifndef BOOTLOADER_BUILD
#define ATTR IRAM_ATTR
#else
#define ATTR
#endif // BOOTLOADER_BUILD
uint32_t ATTR esp_log_early_timestamp()
{ {
return xthal_get_ccount() / (CPU_CLK_FREQ_ROM / 1000); return xthal_get_ccount() / (CPU_CLK_FREQ_ROM / 1000);
} }
@ -305,9 +313,6 @@ uint32_t IRAM_ATTR esp_log_timestamp()
#else #else
uint32_t IRAM_ATTR esp_log_timestamp() uint32_t esp_log_timestamp() __attribute__((alias("esp_log_early_timestamp")));
{
return esp_log_early_timestamp();
}
#endif //BOOTLOADER_BUILD #endif //BOOTLOADER_BUILD

Wyświetl plik

@ -19,9 +19,15 @@ static const uint32_t STATUS_QIE_BIT = (1 << 9); /* Quad Enable */
#define SPI_IDX 1 #define SPI_IDX 1
#define OTH_IDX 0 #define OTH_IDX 0
#ifndef BOOTLOADER_BUILD
#define ATTR IRAM_ATTR
#else
#define ATTR
#endif // BOOTLOADER_BUILD
extern SpiFlashChip SPI_flashchip_data; extern SpiFlashChip SPI_flashchip_data;
static void IRAM_ATTR Wait_SPI_Idle(void) static void ATTR Wait_SPI_Idle(void)
{ {
/* Wait for SPI state machine to be idle */ /* Wait for SPI state machine to be idle */
while((REG_READ(SPI_EXT2_REG(SPI_IDX)) & SPI_ST)) { while((REG_READ(SPI_EXT2_REG(SPI_IDX)) & SPI_ST)) {
@ -42,7 +48,7 @@ static void IRAM_ATTR Wait_SPI_Idle(void)
about interrupts, CPU coordination, flash mapping. However some of about interrupts, CPU coordination, flash mapping. However some of
the functions in esp_spi_flash.c call it. the functions in esp_spi_flash.c call it.
*/ */
SpiFlashOpResult IRAM_ATTR SPIUnlock(void) SpiFlashOpResult ATTR SPIUnlock(void)
{ {
uint32_t status; uint32_t status;