From 507208881ff5e52c00e68383fd7c2d4ae3399561 Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Sun, 1 Dec 2024 22:09:31 +0000 Subject: [PATCH] Make IRAM section name configurable --- mongoose.h | 6 +++++- src/config.h | 4 ++++ src/ota.h | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/mongoose.h b/mongoose.h index 0a72b2e0d5..7be2c11bda 100644 --- a/mongoose.h +++ b/mongoose.h @@ -896,6 +896,10 @@ struct timeval { #define MG_ENABLE_TCPIP_PRINT_DEBUG_STATS 0 #endif +#ifndef MG_IRAM_SECTION_NAME +#define MG_IRAM_SECTION_NAME ".iram" +#endif + @@ -2669,7 +2673,7 @@ void mg_rpc_list(struct mg_rpc_req *r); #else #ifndef MG_IRAM #if defined(__GNUC__) -#define MG_IRAM __attribute__((noinline, section(".iram"))) +#define MG_IRAM __attribute__((noinline, section(MG_IRAM_SECTION_NAME))) #else #define MG_IRAM #endif // compiler diff --git a/src/config.h b/src/config.h index b91cf450a0..491e6e68fc 100644 --- a/src/config.h +++ b/src/config.h @@ -177,3 +177,7 @@ #ifndef MG_ENABLE_TCPIP_PRINT_DEBUG_STATS #define MG_ENABLE_TCPIP_PRINT_DEBUG_STATS 0 #endif + +#ifndef MG_IRAM_SECTION_NAME +#define MG_IRAM_SECTION_NAME ".iram" +#endif diff --git a/src/ota.h b/src/ota.h index 3426a4b058..eaa4230dec 100644 --- a/src/ota.h +++ b/src/ota.h @@ -27,7 +27,7 @@ #else #ifndef MG_IRAM #if defined(__GNUC__) -#define MG_IRAM __attribute__((noinline, section(".iram"))) +#define MG_IRAM __attribute__((noinline, section(MG_IRAM_SECTION_NAME))) #else #define MG_IRAM #endif // compiler