From 365ff332362822a2742a5d6653310f6e9eb4f96d Mon Sep 17 00:00:00 2001 From: HampusM Date: Wed, 22 Dec 2021 20:01:13 +0100 Subject: build: add serial monitor logging --- Makefile | 3 +++ make-scripts/Arduino.mk | 12 ++---------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 703ffef..0b03594 100644 --- a/Makefile +++ b/Makefile @@ -10,8 +10,11 @@ OPTIMIZATION_LEVEL=s DEBUG_FLAGS = -O0 -g MCU_FLAG_NAME = mmcu +# Flags +LOG_MONITOR = 0 # Paths +MONITOR_LOG_FILE = monitor.log ARDUINO_DIR = $(HOME).arduino15/packages/arduino ARDMK_DIR = make-scripts AVRDUDE_CONF = /etc/avrdude.conf diff --git a/make-scripts/Arduino.mk b/make-scripts/Arduino.mk index b272332..f25c577 100644 --- a/make-scripts/Arduino.mk +++ b/make-scripts/Arduino.mk @@ -734,16 +734,8 @@ 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) -ifneq ($(strip $(MONITOR_PARAMS)),) - $(MONITOR_CMD) -serial -sercfg $(MONITOR_BAUDRATE),$(MONITOR_PARAMS) $(call get_monitor_port) -else - $(MONITOR_CMD) -serial -sercfg $(MONITOR_BAUDRATE) $(call get_monitor_port) -endif -else ifeq ($(notdir $(MONITOR_CMD)), picocom) - $(MONITOR_CMD) -b $(MONITOR_BAUDRATE) $(MONITOR_PARAMS) $(call get_monitor_port) -else ifeq ($(notdir $(MONITOR_CMD)), cu) - $(MONITOR_CMD) -l $(call get_monitor_port) -s $(MONITOR_BAUDRATE) +ifeq ($(LOG_MONITOR),1) + $(MONITOR_CMD) -L -Logfile $(MONITOR_LOG_FILE) $(call get_monitor_port) $(MONITOR_BAUDRATE) else $(MONITOR_CMD) $(call get_monitor_port) $(MONITOR_BAUDRATE) endif -- cgit v1.2.3-18-g5258