From e644e2f9b18308797a1645b24ffb4326354cc74c Mon Sep 17 00:00:00 2001 From: Simon John Date: Thu, 13 Jun 2013 14:55:40 +0200 Subject: [PATCH] fix for issue #52 - serial monitor baudrate detection new regex tested on debian and mountain lion --- arduino-mk/Arduino.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arduino-mk/Arduino.mk b/arduino-mk/Arduino.mk index efa3bd6..6577563 100644 --- a/arduino-mk/Arduino.mk +++ b/arduino-mk/Arduino.mk @@ -561,7 +561,7 @@ endif ifndef MONITOR_BAUDRATE # This works only in linux. TODO: Port it to MAC OS also # https://github.com/sudar/Arduino-Makefile/issues/52 - SPEED = $(shell grep --max-count=1 --regexp="Serial.begin" $(LOCAL_PDE_SRCS) $(LOCAL_INO_SRCS) | sed -e 's/\t//g' -e 's/\/\/.*$$//g' -e 's/(/\t/' -e 's/)/\t/' | awk -F '\t' '{print $$2}' ) + 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 ($(MONITOR_BAUDRATE),)