summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Leech <andrew.leech@planetinnovation.com.au>2024-06-04 13:46:00 +1000
committerDamien George <damien@micropython.org>2024-10-07 11:06:57 +1100
commit386771e052cd0396031705f22bd2ecab5cc30ea5 (patch)
tree2ce97672659c34d8e4f7a9499262f24a2ed9f49f
parent5ae622ef7b31881cb38b56baa66d8aec3d132cf9 (diff)
esp32/Makefile: Allow auto-port selection if not passed on cmdline.
Signed-off-by: Andrew Leech <andrew@alelec.net>
-rw-r--r--ports/esp32/Makefile10
1 files changed, 7 insertions, 3 deletions
diff --git a/ports/esp32/Makefile b/ports/esp32/Makefile
index 3df2af471..62b1faa57 100644
--- a/ports/esp32/Makefile
+++ b/ports/esp32/Makefile
@@ -29,8 +29,12 @@ BUILD ?= build-$(BOARD)
endif
# Device serial settings.
-PORT ?= /dev/ttyUSB0
-BAUD ?= 460800
+ifneq ($(PORT),)
+PORT_ARG := -p $(PORT)
+endif
+ifneq ($(BAUD),)
+BAUD_ARG := -b $(BAUD)
+endif
PYTHON ?= python3
@@ -59,7 +63,7 @@ endif
HELP_BUILD_ERROR ?= "See \033[1;31mhttps://github.com/micropython/micropython/wiki/Build-Troubleshooting\033[0m"
define RUN_IDF_PY
- idf.py $(IDFPY_FLAGS) -B $(BUILD) -p $(PORT) -b $(BAUD) $(1)
+ idf.py $(IDFPY_FLAGS) -B $(BUILD) $(PORT_ARG) $(BAUD_ARG) $(1)
endef
all: