aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSudar <sudar@sudarmuthu.com>2013-08-09 21:36:22 +0530
committerSudar <sudar@sudarmuthu.com>2013-08-09 21:39:15 +0530
commitc92d6724d711acccacf917a63b683fa10812e876 (patch)
treec8bd479b37eea094799ae62614f9bd3b6b1ef8ff
parent5ea10b3e197458b6209d65dfd552215905efdc81 (diff)
Autodetect baudrate only if either a .ino/.pde is present
Because of the way the autodetect code works, if no .ino/.pde file is present, then the makefile hangs
-rw-r--r--HISTORY.md1
-rw-r--r--arduino-mk/Arduino.mk6
2 files changed, 5 insertions, 2 deletions
diff --git a/HISTORY.md b/HISTORY.md
index d4802cb..1fec2cd 100644
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -17,6 +17,7 @@ The following is the rough list of changes that went into different versions. I
- Implement ard-parse-boards with shell scripting instead of Perl (https://github.com/peplin)
- Compile with debugging symbols only when DEBUG=1 (https://github.com/peplin)
- Replace Leonardo detection with Caterina detection (https://github.com/sej7278)
+- Autodetect baudrate only if either a .ino/.pde is present
### 0.12.0 (2013-06-20)
- Fix "generated_assembly" target, which got broken earlier. Fix issue #76 (https://github.com/matthijskooijman)
diff --git a/arduino-mk/Arduino.mk b/arduino-mk/Arduino.mk
index 62ef75b..23e621b 100644
--- a/arduino-mk/Arduino.mk
+++ b/arduino-mk/Arduino.mk
@@ -657,8 +657,10 @@ endif
#
ifeq ($(strip $(NO_CORE)),)
ifndef MONITOR_BAUDRATE
- SPEED = $(shell egrep -h 'Serial.begin\([0-9]+\)' $(LOCAL_PDE_SRCS) $(LOCAL_INO_SRCS) | sed -e 's/[^0-9]//g'| head -n1)
- MONITOR_BAUDRATE = $(findstring $(SPEED),300 1200 2400 4800 9600 14400 19200 28800 38400 57600 115200)
+ ifeq ($(words $(LOCAL_PDE_SRCS) $(LOCAL_INO_SRCS)), 1)
+ SPEED = $(shell egrep -h 'Serial.begin\([0-9]+\)' $(LOCAL_PDE_SRCS) $(LOCAL_INO_SRCS) | sed -e 's/[^0-9]//g'| head -n1)
+ MONITOR_BAUDRATE = $(findstring $(SPEED),300 1200 2400 4800 9600 14400 19200 28800 38400 57600 115200)
+ endif
ifeq ($(MONITOR_BAUDRATE),)
MONITOR_BAUDRATE = 9600