summaryrefslogtreecommitdiff
path: root/src/arch/arduino-nano
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-12-05 18:13:17 +0100
committerDaniel Friesel <derf@finalrewind.org>2018-12-05 18:13:17 +0100
commita827a8ad5a7b2ffdd83c0eeba82ec7468df321f9 (patch)
tree81c978083b385b9b93b654ffc18b98a15e76de6b /src/arch/arduino-nano
parentd0157ffa16adaf59d56148e39f9397b348e72f8e (diff)
support static analysis of stack usage
Diffstat (limited to 'src/arch/arduino-nano')
-rw-r--r--src/arch/arduino-nano/Makefile.inc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/arch/arduino-nano/Makefile.inc b/src/arch/arduino-nano/Makefile.inc
index b057680..28bbead 100644
--- a/src/arch/arduino-nano/Makefile.inc
+++ b/src/arch/arduino-nano/Makefile.inc
@@ -9,15 +9,21 @@ cpu_freq ?= 16000000
COMMON_FLAGS += -Werror=overflow
COMMON_FLAGS += -mmcu=${MCU} -DMULTIPASS_ARCH_arduino_nano
COMMON_FLAGS += -DF_CPU=${cpu_freq}UL
-COMMON_FLAGS += -flto
COMMON_FLAGS += -DMULTIPASS_ARCH_HAS_I2C
+ifeq (${stack_usage}, )
+ COMMON_FLAGS += -flto
+endif
+
CC = avr-gcc
CXX = avr-g++
NM = avr-nm
OBJCOPY = avr-objcopy
OBJDUMP = avr-objdump
+# On each function call, the 2-Byte return address is pushed onto the stack
+ARCH_CALL_COST = 2
+
ifeq (${aspectc}, 1)
CXX = ag++ -r build/repo.acp -v 0 --c_compiler avr-g++ -p . --Xcompiler
endif