Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ff4bc12

Browse files
ports/esp32/Makefile: Now supports BOARD_DIR.
ports/esp32/CMakeLists.txt: Now accepts relative path for BOARD_DIR.
1 parent ed58d6e commit ff4bc12

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

ports/esp32/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ endif()
1313
# Set the board directory and check that it exists.
1414
if(NOT MICROPY_BOARD_DIR)
1515
set(MICROPY_BOARD_DIR ${MICROPY_PORT_DIR}/boards/${MICROPY_BOARD})
16+
else()
17+
if(NOT IS_ABSOLUTE "${MICROPY_BOARD_DIR}")
18+
set(MICROPY_BOARD_DIR "${MICROPY_PORT_DIR}/${MICROPY_BOARD_DIR}")
19+
endif()
1620
endif()
1721
if(NOT EXISTS ${MICROPY_BOARD_DIR}/mpconfigboard.cmake)
1822
message(FATAL_ERROR "Invalid MICROPY_BOARD specified: ${MICROPY_BOARD}")

ports/esp32/Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
# Select the board to build for, defaulting to GENERIC.
66
BOARD ?= GENERIC
77

8+
BOARD_DIR ?= boards/$(BOARD)
9+
ifeq ($(wildcard $(BOARD_DIR)/.),)
10+
$(error Invalid BOARD specified: $(BOARD_DIR))
11+
endif
12+
813
# If the build directory is not given, make it reflect the board name.
914
BUILD ?= build-$(BOARD)
1015

@@ -28,7 +33,7 @@ ifdef USER_C_MODULES
2833
CMAKE_ARGS += -DUSER_C_MODULES=${USER_C_MODULES}
2934
endif
3035

31-
IDFPY_FLAGS += -D MICROPY_BOARD=$(BOARD) -B $(BUILD) $(CMAKE_ARGS)
36+
IDFPY_FLAGS += -D MICROPY_BOARD_DIR=$(BOARD_DIR) -D MICROPY_BOARD=$(BOARD) -B $(BUILD) $(CMAKE_ARGS)
3237

3338
ifdef FROZEN_MANIFEST
3439
IDFPY_FLAGS += -D MICROPY_FROZEN_MANIFEST=$(FROZEN_MANIFEST)

0 commit comments

Comments
 (0)