From 4519be5bac8d90ce2964595dc7df7ca9434e0207 Mon Sep 17 00:00:00 2001 From: John Whittington Date: Tue, 5 Sep 2017 14:18:03 +0100 Subject: Detect Cygwin Python or user installed Windows Python and use according device port --- Arduino.mk | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Arduino.mk') diff --git a/Arduino.mk b/Arduino.mk index c83ad0d..0b4ed61 100644 --- a/Arduino.mk +++ b/Arduino.mk @@ -744,13 +744,23 @@ ifndef RESET_CMD endif ifneq ($(CATERINA),) ifneq (,$(findstring CYGWIN,$(shell uname -s))) + # confirm user is using default cygwin unix Python (which uses ttySx) and not Windows Python (which uses COMx) + ifeq ($(shell which python),/usr/bin/python) RESET_CMD = $(ARD_RESET_ARDUINO) --caterina $(ARD_RESET_OPTS) $(DEVICE_PATH) + else + RESET_CMD = $(ARD_RESET_ARDUINO) --caterina $(ARD_RESET_OPTS) $(call get_monitor_port) + endif else RESET_CMD = $(ARD_RESET_ARDUINO) --caterina $(ARD_RESET_OPTS) $(call get_monitor_port) endif else ifneq (,$(findstring CYGWIN,$(shell uname -s))) + # confirm user is using default cygwin unix Python (which uses ttySx) and not Windows Python (which uses COMx) + ifeq ($(shell which python),/usr/bin/python) RESET_CMD = $(ARD_RESET_ARDUINO) $(ARD_RESET_OPTS) $(DEVICE_PATH) + else + RESET_CMD = $(ARD_RESET_ARDUINO) $(ARD_RESET_OPTS) $(call get_monitor_port) + endif else RESET_CMD = $(ARD_RESET_ARDUINO) $(ARD_RESET_OPTS) $(call get_monitor_port) endif -- cgit v1.2.3 From 11e2059009f7f3dfa7f1b2b6a8743c17f148691d Mon Sep 17 00:00:00 2001 From: John Whittington Date: Tue, 5 Sep 2017 17:12:22 +0100 Subject: Documentation changes for Windows usage --- Arduino.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Arduino.mk') diff --git a/Arduino.mk b/Arduino.mk index 0b4ed61..8c79015 100644 --- a/Arduino.mk +++ b/Arduino.mk @@ -65,12 +65,12 @@ # configuration options. Control Panel > System > Advanced system settings # Also take into account that when you set them you have to add '\' on # all spaces and special characters. -# ARDUINO_DIR and AVR_TOOLS_DIR have to be relative and not absolute. # This are just examples, you have to adapt this variables accordingly to -# your system. +# your system. Note the difference between ARDMK_DIR, which can use /cygdrive/ +# and USER_LIB_PATH, which cannnot due to invoking with the build tools # -# ARDUINO_DIR =../../../../../Arduino -# AVR_TOOLS_DIR =../../../../../Arduino/hardware/tools/avr +# ARDUINO_DIR = C:/Arduino +# AVR_TOOLS_DIR = C:/Arduino/hardware/tools/avr # ARDMK_DIR = /cygdrive/c/Users/"YourUser"/Arduino-Makefile # # On Windows it is highly recommended that you create a symbolic link directory -- cgit v1.2.3 From 42b5d2dbd85ab7a51f3bc301a74a00862433ac2a Mon Sep 17 00:00:00 2001 From: John Whittington Date: Wed, 6 Sep 2017 10:34:07 +0100 Subject: Auto detect Windows sketchbook path using USERPROFILE not HOME and spelling --- Arduino.mk | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'Arduino.mk') diff --git a/Arduino.mk b/Arduino.mk index 8c79015..c6fb5be 100644 --- a/Arduino.mk +++ b/Arduino.mk @@ -62,12 +62,15 @@ # AVR_TOOLS_DIR = /usr # # On Windows declare this environmental variables using the windows -# configuration options. Control Panel > System > Advanced system settings -# Also take into account that when you set them you have to add '\' on -# all spaces and special characters. +# configuration options or Cygwin .bashrc. Control Panel > System > Advanced system settings +# The paths must use Unix style forward slash and not have any spaces +# or escape charactors. One must use a symbolic link if the path does +# contain spaces. +# # This are just examples, you have to adapt this variables accordingly to # your system. Note the difference between ARDMK_DIR, which can use /cygdrive/ -# and USER_LIB_PATH, which cannnot due to invoking with the build tools +# and USER_LIB_PATH, which cannnot due to invoking with the build tools. +# It is best practice to avoid cygdrive all together. # # ARDUINO_DIR = C:/Arduino # AVR_TOOLS_DIR = C:/Arduino/hardware/tools/avr @@ -75,7 +78,7 @@ # # On Windows it is highly recommended that you create a symbolic link directory # for avoiding using the normal directories name of windows such as -# c:\Program Files (x86)\Arduino +# C:\Program Files (x86)\Arduino # For this use the command mklink on the console. # # @@ -364,9 +367,15 @@ ifndef ARDUINO_SKETCHBOOK ifneq ($(ARDUINO_SKETCHBOOK),) $(call show_config_variable,ARDUINO_SKETCHBOOK,[AUTODETECTED],(from arduino preferences file)) else - ARDUINO_SKETCHBOOK := $(firstword \ - $(call dir_if_exists,$(HOME)/sketchbook) \ - $(call dir_if_exists,$(HOME)/Documents/Arduino) ) + ifeq ($(CURRENT_OS), WINDOWS) + ARDUINO_SKETCHBOOK := $(firstword \ + $(call dir_if_exists,$(USERPROFILE)/sketchbook) \ + $(call dir_if_exists,$(USERPROFILE)/Documents/Arduino) ) + else + ARDUINO_SKETCHBOOK := $(firstword \ + $(call dir_if_exists,$(HOME)/sketchbook) \ + $(call dir_if_exists,$(HOME)/Documents/Arduino) ) + endif $(call show_config_variable,ARDUINO_SKETCHBOOK,[DEFAULT]) endif else -- cgit v1.2.3 From 770d3a7080c1216a46a1d0c334692ee31dd7de0f Mon Sep 17 00:00:00 2001 From: John Whittington Date: Wed, 6 Sep 2017 09:48:04 +0000 Subject: Fix indenting --- Arduino.mk | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Arduino.mk') diff --git a/Arduino.mk b/Arduino.mk index c6fb5be..107bdc3 100644 --- a/Arduino.mk +++ b/Arduino.mk @@ -367,15 +367,15 @@ ifndef ARDUINO_SKETCHBOOK ifneq ($(ARDUINO_SKETCHBOOK),) $(call show_config_variable,ARDUINO_SKETCHBOOK,[AUTODETECTED],(from arduino preferences file)) else - ifeq ($(CURRENT_OS), WINDOWS) - ARDUINO_SKETCHBOOK := $(firstword \ - $(call dir_if_exists,$(USERPROFILE)/sketchbook) \ - $(call dir_if_exists,$(USERPROFILE)/Documents/Arduino) ) - else - ARDUINO_SKETCHBOOK := $(firstword \ - $(call dir_if_exists,$(HOME)/sketchbook) \ - $(call dir_if_exists,$(HOME)/Documents/Arduino) ) - endif + ifeq ($(CURRENT_OS), WINDOWS) + ARDUINO_SKETCHBOOK := $(firstword \ + $(call dir_if_exists,$(USERPROFILE)/sketchbook) \ + $(call dir_if_exists,$(USERPROFILE)/Documents/Arduino) ) + else + ARDUINO_SKETCHBOOK := $(firstword \ + $(call dir_if_exists,$(HOME)/sketchbook) \ + $(call dir_if_exists,$(HOME)/Documents/Arduino) ) + endif $(call show_config_variable,ARDUINO_SKETCHBOOK,[DEFAULT]) endif else -- cgit v1.2.3