8000 esp32/Makefile: Allow auto-port selection if not passed on cmdline. · micropython/micropython@c7d8651 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c7d8651

Browse files
committed
esp32/Makefile: Allow auto-port selection if not passed on cmdline.
Signed-off-by: Andrew Leech <andrew@alelec.net>
1 parent fe27410 commit c7d8651

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ports/esp32/Makefile

Lines changed: 7 additions & 3 deletions
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)
0