Skip to content

Commit a7dec46

Browse files
committed
Add monitor commands using less and cat.
Use `less` as the default `MONITOR_CMD`. Change comment explenation about `# Serial Monitor`.
1 parent 6008a09 commit a7dec46

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

Arduino.mk

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -860,11 +860,11 @@ ifndef ARDUINO_LIBS
860860
endif
861861

862862
########################################################################
863-
# Serial monitor (just a screen wrapper)
863+
# Serial monitor
864864

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

869869
ifeq ($(strip $(NO_CORE)),)
870870
ifndef MONITOR_BAUDRATE
@@ -882,9 +882,8 @@ ifeq ($(strip $(NO_CORE)),)
882882
else
883883
$(call show_config_variable,MONITOR_BAUDRATE, [USER])
884884
endif
885-
886885
ifndef MONITOR_CMD
887-
MONITOR_CMD = screen
886+
MONITOR_CMD = less
888887
endif
889888
endif
890889

@@ -1598,6 +1597,10 @@ else ifeq ($(MONITOR_CMD), picocom)
15981597
$(MONITOR_CMD) -b $(MONITOR_BAUDRATE) $(MONITOR_PARAMS) $(call get_monitor_port)
15991598
else ifeq ($(MONITOR_CMD), cu)
16001599
$(MONITOR_CMD) -l $(call get_monitor_port) -s $(MONITOR_BAUDRATE)
1600+
else ifeq ($(MONITOR_CMD), less)
1601+
$(MONITOR_CMD) -f $(call get_monitor_port)
1602+
else ifeq ($(MONITOR_CMD), cat)
1603+
$(MONITOR_CMD) $(call get_monitor_port)
16011604
else
16021605
$(MONITOR_CMD) $(call get_monitor_port) $(MONITOR_BAUDRATE)
16031606
endif

0 commit comments

Comments
 (0)