Skip to content

Commit 32d35da

Browse files
EAGMnorsudar
authored andcommitted
Tweak AVRdude conf file detection in windows
On windows the AVRdude configuration file is now detected properly. The comments and `README` are updated as well. Fix #187
1 parent 87129f1 commit 32d35da

File tree

3 files changed

+51
-1
lines changed

3 files changed

+51
-1
lines changed

Arduino.mk

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,24 @@
5656
# ARDMK_DIR = /usr/share/arduino
5757
# AVR_TOOLS_DIR = /usr
5858
#
59+
# On Windows declare this environmental variables using the windows
60+
# configuration options. Control Panel > System > Advanced system settings
61+
# Also take into account that when you set them you have to add '\' on
62+
# all spaces and special characters.
63+
# ARDUINO_DIR and AVR_TOOLS_DIR have to be relative and not absolute.
64+
# This are just examples, you have to adapt this variables accordingly to
65+
# your system.
66+
#
67+
# ARDUINO_DIR =../../../../../Arduino
68+
# AVR_TOOLS_DIR =../../../../../Arduino/hardware/tools/avr
69+
# ARDMK_DIR = /cygdrive/c/Users/"YourUser"/Arduino-Makefile
70+
#
71+
# On Windows it is highly recommended that you create a symbolic link directory
72+
# for avoiding using the normal directories name of windows such as
73+
# c:\Program Files (x86)\Arduino
74+
# For this use the command mklink on the console.
75+
#
76+
#
5977
# You can either set these up in the Makefile, or put them in your
6078
# environment e.g. in your .bashrc
6179
#
@@ -395,6 +413,15 @@ ifndef AVR_TOOLS_DIR
395413

396414
else
397415
$(call show_config_variable,AVR_TOOLS_DIR,[USER])
416+
417+
# Check in Windows as Cygwin is being used, that the configuration file for the AVRDUDE is set
418+
# Check if it works on MAC
419+
ifeq ($(CURRENT_OS),WINDOWS)
420+
ifndef AVRDUDE_CONF
421+
AVRDUDE_CONF = $(AVR_TOOLS_DIR)/etc/avrdude.conf
422+
endif
423+
endif
424+
398425
endif #ndef AVR_TOOLS_DIR
399426

400427
ifndef AVR_TOOLS_PATH

HISTORY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ I tried to give credit whenever possible. If I have missed anyone, kindly add it
1919
- Tweak: Replace perl reset script with Python script. (https://github.com/sej7278)
2020
- Tweak: Made choice of Python2/3 interpreter up to the OS. (https://github.com/peplin)
2121
- Tweak: Simplified packaging dependencies. (https://github.com/sej7278)
22+
- Tweak: Tweak AVRDUDE conf detection in windows. (https://github.com/EAGMnor)
2223

2324
### 1.3.1 (2014-02-04)
2425
- Fix: BUNDLED_AVR_TOOLS_DIR is now set properly when using only arduino-core and not the whole arduino package. (https://github.com/sej7278)

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ On Mac using MacPorts:
5555

5656
On Windows:
5757

58+
You need to install Cygwin and its packages for Make, Perl and the next Serial library.
59+
5860
pySerial can be downloaded from PyPi
5961

6062
On other systems:
@@ -93,12 +95,32 @@ On Windows (using cygwin), you might want to set:
9395
MONITOR_PORT = com3
9496
BOARD_TAG = mega2560
9597

98+
It is recommended in Windows that you create a symbolic link directory for avoiding problem with folder naming conventions on Windows. Specially if your your Arduino folder is in:
99+
100+
c:\Program Files (x86)\Arduino
101+
102+
You will get problem for the special characters on the folder name. More details about this can be found on https://github.com/sudar/Arduino-Makefile/issues/94
103+
104+
For creating a symbolic link you have to use the command “mklink” on Windows, e.g.
105+
106+
mklink /d c:\Arduino c:\Program Files (x86)\Arduino
107+
108+
At the end the variables end up being.
109+
110+
ARDUINO_DIR=../../../../../Arduino
111+
112+
Instead of
113+
114+
ARDUINO_DIR=../../../../../Program\ Files\ \(x86\)/Arduino
115+
116+
117+
96118
- `BOARD_TAG` - Type of board, for a list see boards.txt or `make show_boards`
97119
- `MONITOR_PORT` - The port where your Arduino is plugged in, usually `/dev/ttyACM0` or `/dev/ttyUSB0` in Linux or Mac OS X and `com3`, `com4`, etc. in Windows.
98120
- `ARDUINO_DIR` - Path to Arduino installation. In Cygwin in Windows this path must be
99121
relative, not absolute (e.g. "../../arduino" and not "/c/cygwin/Arduino").
100122
- `ARDMK_DIR` - Path where the `*.mk` are present. If you installed the package, then it is usually `/usr/share/arduino`
101-
- `AVR_TOOLS_DIR` - Path where the avr tools chain binaries are present. If you are going to use the binaries that came with Arduino installation, then you don't have to set it.
123+
- `AVR_TOOLS_DIR` - Path where the avr tools chain binaries are present. If you are going to use the binaries that came with Arduino installation, then you don't have to set it. Otherwise set it realtive and not absolute.
102124

103125
The list of all variables that can be overridden is available at [arduino-mk-vars.md](arduino-mk-vars.md) file.
104126

0 commit comments

Comments
 (0)