summaryrefslogtreecommitdiff
path: root/src/arch/arduino-nano/Makefile.inc
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-10-19 09:01:36 +0200
committerDaniel Friesel <derf@finalrewind.org>2018-10-19 09:01:36 +0200
commit255085d06a75c424cd6b95aaac10056e5de65876 (patch)
tree345a6bb1772089e4928e88f5035648f82b51531e /src/arch/arduino-nano/Makefile.inc
parent458c89d71c3aa22eb5e83d4e34930a8978c0ef7e (diff)
arduino nano: support additional CPU frequencies
Diffstat (limited to 'src/arch/arduino-nano/Makefile.inc')
-rw-r--r--src/arch/arduino-nano/Makefile.inc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/arch/arduino-nano/Makefile.inc b/src/arch/arduino-nano/Makefile.inc
index bb51b6c..08dd6c1 100644
--- a/src/arch/arduino-nano/Makefile.inc
+++ b/src/arch/arduino-nano/Makefile.inc
@@ -7,7 +7,7 @@ BAUD = 57600
cpu_freq ?= 16000000
COMMON_FLAGS += -Werror=overflow
-COMMON_FLAGS += -mmcu=${MCU} -DF_CPU=16000000UL -DMULTIPASS_ARCH_arduino_nano
+COMMON_FLAGS += -mmcu=${MCU} -DMULTIPASS_ARCH_arduino_nano
COMMON_FLAGS += -flto
COMMON_FLAGS += -DMULTIPASS_ARCH_HAS_I2C
@@ -39,6 +39,12 @@ ifneq ($(findstring timer,${arch_drivers}), )
TARGETS += src/arch/arduino-nano/driver/timer.cc
endif
+ifneq (${cpu_freq}, )
+ COMMON_FLAGS += -DF_CPU=${cpu_freq}UL
+else
+ COMMON_FLAGS += -DF_CPU=16000000UL
+endif
+
OBJECTS = ${TARGETS:.cc=.o}
.cc.o:
@@ -58,7 +64,7 @@ arch_clean:
${QUIET}rm -f ${OBJECTS} build/system.hex
monitor:
- ${QUIET}screen ${PORT} 115200
+ ${QUIET}screen ${PORT} 19200
arch_help:
@echo "arduino-nano specific flags:"