Skip to content

Commit

Permalink
cpu/esp32: set CONFIG_ESPTOOL_FLASH_FREQ from FLASH_FREQ
Browse files Browse the repository at this point in the history
CONFIG_ESPTOOL_FLASH_FREQ_* defines are used in ESP-IDF to select the right SPI clock speed for flash.
  • Loading branch information
gschorcht committed Aug 1, 2022
1 parent d9e55a9 commit d3ec4bc
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 @@ -115,6 +115,19 @@ CFLAGS += -DCONFIG_IDF_TARGET_$(call uppercase_and_underscore,$(CPU_FAM))
CFLAGS += -DESP_PLATFORM
CFLAGS += -DLOG_TAG_IN_BRACKETS

# extend CFLAGS by the corresponding FLASH_FREQ
ifeq (20m,$(FLASH_FREQ))
CFLAGS += -DCONFIG_ESPTOOLPY_FLASHFREQ_20M
else ifeq (26m,$(FLASH_FREQ))
CFLAGS += -DCONFIG_ESPTOOLPY_FLASHFREQ_26M
else ifeq (40m,$(FLASH_FREQ))
CFLAGS += -DCONFIG_ESPTOOLPY_FLASHFREQ_40M
else ifeq (80m,$(FLASH_FREQ))
CFLAGS += -DCONFIG_ESPTOOLPY_FLASHFREQ_80M
else ifeq (120m,$(FLASH_FREQ))
CFLAGS += -DCONFIG_ESPTOOLPY_FLASHFREQ_120M
endif

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

0 comments on commit d3ec4bc

Please sign in to comment.