Add a new target for opening a serial monitor.

This commit is contained in:
Christopher Peplin 2012-04-02 12:02:14 -04:00
parent f437ea63eb
commit 060abab51f
2 changed files with 31 additions and 0 deletions

View file

@ -8,3 +8,11 @@ documentation](http://mjo.tc/atelier/2009/02/arduino-cli.html
"Documentation") exists. "Documentation") exists.
If you're using Debian or Ubuntu, you can find this in the arduino-core package. If you're using Debian or Ubuntu, you can find this in the arduino-core package.
## Commands
### Serial Monitor
If you have minicom installed, you can run `make monitor` to open the serial
output. You can use a different serial monitoring tool (e.g. screen) by
overriding the `SERIAL_MONITOR_BINARY` and `SERIAL_MONITOR_FLAGS` variables.

View file

@ -448,6 +448,26 @@ endif
AVRDUDE_ISP_OPTS = -P $(ISP_PORT) $(ISP_PROG) AVRDUDE_ISP_OPTS = -P $(ISP_PORT) $(ISP_PROG)
#######################################################################
#
# Serial monitoring
#
ifndef SERIAL_MONITOR_BAUDRATE
SERIAL_MONITOR_BAUDRATE = 9600
endif
ifndef SERIAL_MONITOR_BINARY
SERIAL_MONITOR_BINARY = minicom
endif
ifndef SERIAL_MONITOR_FLAGS
SERIAL_MONITOR_FLAGS = -b $(SERIAL_MONITOR_BAUDRATE) -D $(ARDUINO_PORT)
endif
ifndef SERIAL_MONITOR_COMMAND
SERIAL_MONITOR_COMMAND = $(SERIAL_MONITOR_BINARY) $(SERIAL_MONITOR_FLAGS)
endif
######################################################################## ########################################################################
# #
@ -505,6 +525,9 @@ depends: $(DEPS)
size: $(OBJDIR) $(TARGET_HEX) size: $(OBJDIR) $(TARGET_HEX)
$(SIZE) $(TARGET_HEX) $(SIZE) $(TARGET_HEX)
monitor:
$(SERIAL_MONITOR_COMMAND)
show_boards: show_boards:
$(PARSE_BOARD) --boards $(PARSE_BOARD) --boards