Skip to content

Commit

Permalink
esp32/Makefile: Allow auto-port selection if not passed on cmdline.
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Leech <[email protected]>
  • Loading branch information
pi-anl committed Jul 18, 2024
1 parent 2a395ef commit c80ed32
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ports/esp32/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit c80ed32

Please sign in to comment.