Skip to content

Commit 386771e

Browse files
pi-anldpgeorge
authored andcommitted
esp32/Makefile: Allow auto-port selection if not passed on cmdline.
Signed-off-by: Andrew Leech <[email protected]>
1 parent 5ae622e commit 386771e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ports/esp32/Makefile

+7-3
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@ BUILD ?= build-$(BOARD)
2929
endif
3030

3131
# Device serial settings.
32-
PORT ?= /dev/ttyUSB0
33-
BAUD ?= 460800
32+
ifneq ($(PORT),)
33+
PORT_ARG := -p $(PORT)
34+
endif
35+
ifneq ($(BAUD),)
36+
BAUD_ARG := -b $(BAUD)
37+
endif
3438

3539
PYTHON ?= python3
3640

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

6165
define RUN_IDF_PY
62-
idf.py $(IDFPY_FLAGS) -B $(BUILD) -p $(PORT) -b $(BAUD) $(1)
66+
idf.py $(IDFPY_FLAGS) -B $(BUILD) $(PORT_ARG) $(BAUD_ARG) $(1)
6367
endef
6468

6569
all:

0 commit comments

Comments
 (0)