From a7dec465ca5dd088d64c6d2197e8186d3da225e1 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 25 Sep 2017 22:28:34 +0300 Subject: [PATCH] Add `monitor` commands using `less` and `cat`. Use `less` as the default `MONITOR_CMD`. Change comment explenation about `# Serial Monitor`. --- Arduino.mk | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Arduino.mk b/Arduino.mk index 2988b738..c651ac92 100644 --- a/Arduino.mk +++ b/Arduino.mk @@ -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 @@ -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 @@ -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