Skip to content

Commit

Permalink
Add stty_params target.
Browse files Browse the repository at this point in the history
Make it run a command according to arch wiki article on Arduino #stty.
Make `monitor` target depend on `stty_params`.
  • Loading branch information
doronbehar committed Sep 30, 2018
1 parent fe84c59 commit 8ff6f8a
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions Arduino.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1687,6 +1687,28 @@ reset_stty:
(sleep 0.1 2>/dev/null || sleep 1) ; \
$$STTYF $(call get_monitor_port) -hupcl

stty_params:
stty -F $(call get_monitor_port) \
cs8 \
$(MONITOR_BAUDRATE) \
ignbrk \
-brkint \
-icrnl \
-imaxbel \
-opost \
-onlcr \
-isig \
-icanon \
-iexten \
-echo \
-echoe \
-echok \
-echoctl \
-echoke \
noflsh \
-ixon \
-crtscts

ispload: $(TARGET_EEP) $(TARGET_HEX) verify_size
$(AVRDUDE) $(AVRDUDE_COM_OPTS) $(AVRDUDE_ISP_OPTS) -e \
$(AVRDUDE_ISPLOAD_OPTS)
Expand Down Expand Up @@ -1730,8 +1752,8 @@ show_boards:
show_submenu:
@$(CAT) $(BOARDS_TXT) | grep -E '[a-zA-Z0-9_\-]+.menu.(cpu|chip).[a-zA-Z0-9_\-]+=' | sort -uf | sed 's/.menu.\(cpu\|chip\)./:/' | sed 's/=/:/' | column -s: -t

monitor:
ifeq ($(notdir $(MONITOR_CMD)), putty)
monitor: stty_params
ifeq ($(MONITOR_CMD), 'putty')
ifneq ($(strip $(MONITOR_PARAMS)),)
$(MONITOR_CMD) -serial -sercfg $(MONITOR_BAUDRATE),$(MONITOR_PARAMS) $(call get_monitor_port)
else
Expand Down

0 comments on commit 8ff6f8a

Please sign in to comment.