Merge pull request #2951 from cesanta/inline

MG_IRAM -> noinline
This commit is contained in:
Sergio R. Caprile 2024-11-01 16:26:05 -03:00 committed by GitHub
commit 67e17d3bc3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 10 additions and 9 deletions

View File

@ -6118,8 +6118,9 @@ MG_IRAM static bool flash_page_start(volatile uint32_t *dst) {
if ((p - base) % (16 * 1024 * flash_config) == 0) return true;
} else if (p == base + 16 * 1024 * 4 * flash_config) {
return true;
} else if ((p - base) % (128 * 1024 * flash_config) == 0)
} else if ((p - base) % (128 * 1024 * flash_config) == 0) {
return true;
}
}
return false;
}
@ -6166,7 +6167,7 @@ MG_IRAM static void flash_clear_err(void) {
MG_REG(MG_FLASH_BASE + MG_FLASH_SR) = 0xf2; // Clear all errors
}
__attribute__((noinline)) MG_IRAM static bool mg_stm32f_erase(void *addr) {
MG_IRAM static bool mg_stm32f_erase(void *addr) {
bool ok = false;
if (flash_page_start(addr) == false) {
MG_ERROR(("%p is not on a sector boundary", addr));
@ -6207,7 +6208,7 @@ MG_IRAM static bool mg_stm32f_swap(void) {
static bool s_flash_irq_disabled;
__attribute__((noinline)) MG_IRAM static bool mg_stm32f_write(void *addr,
MG_IRAM static bool mg_stm32f_write(void *addr,
const void *buf,
size_t len) {
if ((len % s_mg_flash_stm32f.align) != 0) {
@ -6240,7 +6241,7 @@ __attribute__((noinline)) MG_IRAM static bool mg_stm32f_write(void *addr,
}
// just overwrite instead of swap
__attribute__((noinline)) MG_IRAM void single_bank_swap(char *p1, char *p2,
MG_IRAM void single_bank_swap(char *p1, char *p2,
size_t size) {
// no stdlib calls here
mg_stm32f_write(p1, p2, size);

View File

@ -2657,7 +2657,7 @@ void mg_rpc_list(struct mg_rpc_req *r);
#else
#ifndef MG_IRAM
#if defined(__GNUC__)
#define MG_IRAM __attribute__((section(".iram")))
#define MG_IRAM __attribute__((noinline, section(".iram")))
#else
#define MG_IRAM
#endif // compiler

View File

@ -23,7 +23,7 @@
#else
#ifndef MG_IRAM
#if defined(__GNUC__)
#define MG_IRAM __attribute__((section(".iram")))
#define MG_IRAM __attribute__((noinline, section(".iram")))
#else
#define MG_IRAM
#endif // compiler

View File

@ -120,7 +120,7 @@ MG_IRAM static void flash_clear_err(void) {
MG_REG(MG_FLASH_BASE + MG_FLASH_SR) = 0xf2; // Clear all errors
}
__attribute__((noinline)) MG_IRAM static bool mg_stm32f_erase(void *addr) {
MG_IRAM static bool mg_stm32f_erase(void *addr) {
bool ok = false;
if (flash_page_start(addr) == false) {
MG_ERROR(("%p is not on a sector boundary", addr));
@ -161,7 +161,7 @@ MG_IRAM static bool mg_stm32f_swap(void) {
static bool s_flash_irq_disabled;
__attribute__((noinline)) MG_IRAM static bool mg_stm32f_write(void *addr,
MG_IRAM static bool mg_stm32f_write(void *addr,
const void *buf,
size_t len) {
if ((len % s_mg_flash_stm32f.align) != 0) {
@ -194,7 +194,7 @@ __attribute__((noinline)) MG_IRAM static bool mg_stm32f_write(void *addr,
}
// just overwrite instead of swap
__attribute__((noinline)) MG_IRAM void single_bank_swap(char *p1, char *p2,
MG_IRAM void single_bank_swap(char *p1, char *p2,
size_t size) {
// no stdlib calls here
mg_stm32f_write(p1, p2, size);