Skip to content

Commit

Permalink
Fix and use mgos_iram.h for ESP32
Browse files Browse the repository at this point in the history
  • Loading branch information
rojer committed Jan 13, 2021
1 parent e456939 commit 3aae00d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion include/mgos_iram.h
Expand Up @@ -25,10 +25,15 @@
#ifndef __ASSEMBLER__
#define _IRAM_STR_LIT(a) #a
#define _IRAM_STR(a) _IRAM_STR_LIT(a)
#if CS_PLATFORM == CS_P_ESP32
#define _IRAM_SECTION_PREFIX ".iram1"
#else
#define _IRAM_SECTION_PREFIX ".text.IRAM"
#endif

#define IRAM \
__attribute__( \
(section(".text.IRAM." _IRAM_STR(__LINE__) "." _IRAM_STR(__COUNTER__))))
(section(_IRAM_SECTION_PREFIX "." _IRAM_STR(__LINE__) "." _IRAM_STR(__COUNTER__))))

#define NOINLINE __attribute__((noinline))
#endif // __ASSEMBLER__
2 changes: 1 addition & 1 deletion platforms/esp32/src/esp32_src.mk
Expand Up @@ -64,7 +64,7 @@ APP_OBJS = $(addsuffix .o,$(APP_SRCS))
BUILD_INFO_OBJS = $(addsuffix .o,$(notdir $(BUILD_INFO_C)) $(notdir $(MG_BUILD_INFO_C)))

C_CXX_CFLAGS += -DMGOS_APP=\"$(APP)\" -DFW_ARCHITECTURE=$(APP_PLATFORM) \
-DIRAM='__attribute__((section(".iram1")))' \
-include mgos_iram.h \
$(MG_FEATURES_TINY) -DMG_NET_IF=MG_NET_IF_LWIP_LOW_LEVEL \
$(MGOS_FEATURES) -DMGOS_MAX_NUM_UARTS=3 \
-DMGOS_DEBUG_UART=$(MGOS_DEBUG_UART) \
Expand Down

0 comments on commit 3aae00d

Please sign in to comment.