Skip to content

Commit 2f79854

Browse files
andrewleechdpgeorge
authored andcommitted
esp32/Makefile: Only set port & baud for jobs that access hardware.
In idf v5.2.1 if the port flag is set it's validated even on jobs that don't access hardware like clean. This causes the job to fail if device isn't connected. Signed-off-by: Andrew Leech <andrew@alelec.net>
1 parent 5aa115a commit 2f79854

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ports/esp32/Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ endif
3535
ifneq ($(BAUD),)
3636
BAUD_ARG := -b $(BAUD)
3737
endif
38+
DEVICE += $(PORT_ARG) $(BAUD_ARG)
3839

3940
PYTHON ?= python3
4041

@@ -63,7 +64,7 @@ endif
6364
HELP_BUILD_ERROR ?= "See \033[1;31mhttps://github.com/micropython/micropython/wiki/Build-Troubleshooting\033[0m"
6465

6566
define RUN_IDF_PY
66-
idf.py $(IDFPY_FLAGS) -B $(BUILD) $(PORT_ARG) $(BAUD_ARG) $(1)
67+
idf.py $(IDFPY_FLAGS) -B $(BUILD) $(1)
6768
endef
6869

6970
all:
@@ -82,13 +83,13 @@ clean:
8283
$(call RUN_IDF_PY,fullclean)
8384

8485
deploy:
85-
$(call RUN_IDF_PY,flash)
86+
$(call RUN_IDF_PY,$(DEVICE) flash)
8687

8788
erase:
88-
$(call RUN_IDF_PY,erase-flash)
89+
$(call RUN_IDF_PY,$(DEVICE) erase-flash)
8990

9091
monitor:
91-
$(call RUN_IDF_PY,monitor)
92+
$(call RUN_IDF_PY,$(DEVICE) monitor)
9293

9394
size:
9495
$(call RUN_IDF_PY,size)

0 commit comments

Comments
 (0)