Skip to content

Commit 4519be5

Browse files
committed
Detect Cygwin Python or user installed Windows Python and use according device port
1 parent 360db6f commit 4519be5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Arduino.mk

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,13 +744,23 @@ ifndef RESET_CMD
744744
endif
745745
ifneq ($(CATERINA),)
746746
ifneq (,$(findstring CYGWIN,$(shell uname -s)))
747+
# confirm user is using default cygwin unix Python (which uses ttySx) and not Windows Python (which uses COMx)
748+
ifeq ($(shell which python),/usr/bin/python)
747749
RESET_CMD = $(ARD_RESET_ARDUINO) --caterina $(ARD_RESET_OPTS) $(DEVICE_PATH)
750+
else
751+
RESET_CMD = $(ARD_RESET_ARDUINO) --caterina $(ARD_RESET_OPTS) $(call get_monitor_port)
752+
endif
748753
else
749754
RESET_CMD = $(ARD_RESET_ARDUINO) --caterina $(ARD_RESET_OPTS) $(call get_monitor_port)
750755
endif
751756
else
752757
ifneq (,$(findstring CYGWIN,$(shell uname -s)))
758+
# confirm user is using default cygwin unix Python (which uses ttySx) and not Windows Python (which uses COMx)
759+
ifeq ($(shell which python),/usr/bin/python)
753760
RESET_CMD = $(ARD_RESET_ARDUINO) $(ARD_RESET_OPTS) $(DEVICE_PATH)
761+
else
762+
RESET_CMD = $(ARD_RESET_ARDUINO) $(ARD_RESET_OPTS) $(call get_monitor_port)
763+
endif
754764
else
755765
RESET_CMD = $(ARD_RESET_ARDUINO) $(ARD_RESET_OPTS) $(call get_monitor_port)
756766
endif

0 commit comments

Comments
 (0)