Skip to content

Commit

Permalink
Add monitor commands using less and cat.
Browse files Browse the repository at this point in the history
Use `less` as the default `MONITOR_CMD`.
Change comment explenation about `# Serial Monitor`.
  • Loading branch information
doronbehar committed Sep 25, 2017
1 parent 6008a09 commit a7dec46
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Arduino.mk
Original file line number Diff line number Diff line change
Expand Up @@ -860,11 +860,11 @@ ifndef ARDUINO_LIBS
endif

########################################################################
# Serial monitor (just a screen wrapper)
# Serial monitor

# Quite how to construct the monitor command seems intimately tied
# to the command we're using (here screen). So, read the screen docs
# for more information (search for 'character special device').
# In order to construct a monitor command, we need to use either `less`,
# `screen` or `cat`. With `less`, as the default fallback, we will use
# `-f` flag. Read it's man page to get a better understanding.

ifeq ($(strip $(NO_CORE)),)
ifndef MONITOR_BAUDRATE
Expand All @@ -882,9 +882,8 @@ ifeq ($(strip $(NO_CORE)),)
else
$(call show_config_variable,MONITOR_BAUDRATE, [USER])
endif

ifndef MONITOR_CMD
MONITOR_CMD = screen
MONITOR_CMD = less
endif
endif

Expand Down Expand Up @@ -1598,6 +1597,10 @@ else ifeq ($(MONITOR_CMD), picocom)
$(MONITOR_CMD) -b $(MONITOR_BAUDRATE) $(MONITOR_PARAMS) $(call get_monitor_port)
else ifeq ($(MONITOR_CMD), cu)
$(MONITOR_CMD) -l $(call get_monitor_port) -s $(MONITOR_BAUDRATE)
else ifeq ($(MONITOR_CMD), less)
$(MONITOR_CMD) -f $(call get_monitor_port)
else ifeq ($(MONITOR_CMD), cat)
$(MONITOR_CMD) $(call get_monitor_port)
else
$(MONITOR_CMD) $(call get_monitor_port) $(MONITOR_BAUDRATE)
endif
Expand Down

0 comments on commit a7dec46

Please sign in to comment.