Skip to content

Commit

Permalink
cpu/esp32: export FLASH_SIZE to SDK configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
gschorcht committed Dec 31, 2022
1 parent a71f457 commit a0715b2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cpu/esp32/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,19 @@ else ifeq (120m,$(FLASH_FREQ))
CFLAGS += -DCONFIG_ESPTOOLPY_FLASHFREQ_120M
endif

#extend CFLAGS by the corresponding FLASH_SIZE
ifeq (1,$(FLASH_SIZE))
CFLAGS += -DCONFIG_ESPTOOLPY_FLASHSIZE_1MB
else ifeq (2,$(FLASH_SIZE))
CFLAGS += -DCONFIG_ESPTOOLPY_FLASHSIZE_2MB
else ifeq (4,$(FLASH_SIZE))
CFLAGS += -DCONFIG_ESPTOOLPY_FLASHSIZE_4MB
else ifeq (8,$(FLASH_SIZE))
CFLAGS += -DCONFIG_ESPTOOLPY_FLASHSIZE_8MB
else ifeq (16,$(FLASH_SIZE))
CFLAGS += -DCONFIG_ESPTOOLPY_FLASHSIZE_16MB
endif

# shortcuts used by ESP-IDF
CFLAGS += -Dasm=__asm
CFLAGS += -Dtypeof=__typeof__
Expand Down

0 comments on commit a0715b2

Please sign in to comment.