Skip to content

Commit

Permalink
better UPLOAD_PORT assumption
Browse files Browse the repository at this point in the history
  • Loading branch information
mkellner committed Oct 2, 2023
1 parent f018dfe commit aec7d8b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 26 deletions.
7 changes: 2 additions & 5 deletions tools/mcconfig/make.esp.mk
Expand Up @@ -50,11 +50,8 @@ endif
UPLOAD_SPEED ?= 921600
DEBUGGER_SPEED ?= 921600
ifeq ($(HOST_OS),Darwin)
ifeq ($(findstring _13.,_$(shell sw_vers -productVersion)),_13.)
UPLOAD_PORT ?= /dev/cu.usbserial-0001
else ifeq ($(findstring _12.,_$(shell sw_vers -productVersion)),_12.)
UPLOAD_PORT ?= /dev/cu.usbserial-0001
else ifeq ($(findstring _11.,_$(shell sw_vers -productVersion)),_11.)
VERS = $(shell sw_vers -productVersion | cut -f1 -d.)
ifeq ($(shell test $(VERS) -gt 10; echo $$?), 0)
UPLOAD_PORT ?= /dev/cu.usbserial-0001
else
UPLOAD_PORT ?= /dev/cu.SLAB_USBtoUART
Expand Down
19 changes: 8 additions & 11 deletions tools/mcconfig/make.nrf52.mk
Expand Up @@ -48,13 +48,16 @@ else
BOOTLOADER_HEX ?= $(PLATFORM_DIR)/bootloader/moddable_nrf52_bootloader-0.2.13-21-g454b281_s140_6.1.1.hex
endif

PLATFORM_DIR = $(MODDABLE)/build/devices/nrf52

UF2_VOLUME_NAME ?= MODDABLE4
M4_VID ?= beef
M4_PID ?= cafe

ifeq ($(USE_USB),0)
ifeq ($(HOST_OS),Darwin)
ifeq ($(findstring _13.,_$(shell sw_vers -productVersion)),_13.)
UPLOAD_PORT ?= /dev/cu.usbserial-0001
else ifeq ($(findstring _12.,_$(shell sw_vers -productVersion)),_12.)
UPLOAD_PORT ?= /dev/cu.usbserial-0001
else ifeq ($(findstring _11.,_$(shell sw_vers -productVersion)),_11.)
VERS = $(shell sw_vers -productVersion | cut -f1 -d.)
ifeq ($(shell test $(VERS) -gt 10; echo $$?), 0)
UPLOAD_PORT ?= /dev/cu.usbserial-0001
else
UPLOAD_PORT ?= /dev/cu.SLAB_USBtoUART
Expand All @@ -64,12 +67,6 @@ ifeq ($(USE_USB),0)
endif
endif

PLATFORM_DIR = $(MODDABLE)/build/devices/nrf52

UF2_VOLUME_NAME ?= MODDABLE4
M4_VID ?= beef
M4_PID ?= cafe

KILL_SERIAL2XSBUG = $(shell pkill serial2xsbug)

CONNECT_XSBUG =
Expand Down
7 changes: 2 additions & 5 deletions tools/mcrun/make.esp.mk
Expand Up @@ -19,11 +19,8 @@

HOST_OS := $(shell uname)
ifeq ($(HOST_OS),Darwin)
ifeq ($(findstring _13.,_$(shell sw_vers -productVersion)),_13.)
UPLOAD_PORT ?= /dev/cu.usbserial-0001
else ifeq ($(findstring _12.,_$(shell sw_vers -productVersion)),_12.)
UPLOAD_PORT ?= /dev/cu.usbserial-0001
else ifeq ($(findstring _11.,_$(shell sw_vers -productVersion)),_11.)
VERS = $(shell sw_vers -productVersion | cut -f1 -d.)
ifeq ($(shell test $(VERS) -gt 10; echo $$?), 0)
UPLOAD_PORT ?= /dev/cu.usbserial-0001
else
UPLOAD_PORT ?= /dev/cu.SLAB_USBtoUART
Expand Down
7 changes: 2 additions & 5 deletions tools/mcrun/make.esp32.mk
Expand Up @@ -19,12 +19,9 @@

HOST_OS := $(shell uname)

PROJ_DIR_TEMPLATE = $(BUILD_DIR)/devices/esp32/xsProj-$(ESP32_SUBCLASS)

UPLOAD_PORT ?= $(shell bash -c "python $(PROJ_DIR_TEMPLATE)/getPort.py")

ifeq ($(HOST_OS),Darwin)
ifeq ($(findstring _11.,_$(shell sw_vers -productVersion)),_11.)
VERS = $(shell sw_vers -productVersion | cut -f1 -d.)
ifeq ($(shell test $(VERS) -gt 10; echo $$?), 0)
UPLOAD_PORT ?= /dev/cu.usbserial-0001
else
UPLOAD_PORT ?= /dev/cu.SLAB_USBtoUART
Expand Down

0 comments on commit aec7d8b

Please sign in to comment.