From f3e47f679c5154908d3f869c1e9a4b5fcc29d4a5 Mon Sep 17 00:00:00 2001 From: Leo C Date: Mon, 21 Mar 2016 23:06:23 +0100 Subject: [PATCH] Add build configuration for ATmega2561 --- .gitignore | 3 +-- avr/Tupfile | 14 ++++++++++++-- avr/main.c | 2 +- configs/debug.config | 1 - configs/m1281-debug.config | 2 ++ configs/m2561-debug.config | 2 ++ 6 files changed, 18 insertions(+), 6 deletions(-) delete mode 100644 configs/debug.config create mode 100644 configs/m1281-debug.config create mode 100644 configs/m2561-debug.config diff --git a/.gitignore b/.gitignore index 1dc5864..a025d68 100644 --- a/.gitignore +++ b/.gitignore @@ -3,8 +3,7 @@ /.project /.settings /.tup -/build-debug +/build-* /doc /joe /scratch - diff --git a/avr/Tupfile b/avr/Tupfile index d73db12..331c11f 100644 --- a/avr/Tupfile +++ b/avr/Tupfile @@ -25,9 +25,19 @@ SRC_Z = ../z180/hdrom.c #TARGETS = $(PROG).elf -MCU_TARGET = atmega1281 +ifdef MCU + MCU_TARGET = @(MCU) +else + MCU_TARGET = atmega1281 +endif +ifeq ($(MCU_TARGET),atmega1281) + DEFS += -DMCU_STRING=\"ATmega1281\" +else + DEFS += -DMCU_STRING=\"ATmega2561\" +endif + F_CPU = 18432000UL -DEFS = -DF_CPU=$(F_CPU) +DEFS += -DF_CPU=$(F_CPU) INCLUDES += -I$(TOP)/include diff --git a/avr/main.c b/avr/main.c index 3852e75..b8ce26d 100644 --- a/avr/main.c +++ b/avr/main.c @@ -277,7 +277,7 @@ int main(void) setup_system_time(); setup_fatfs(); - printf_P(PSTR("\nATMEGA1281+Z8S180 Stamp Monitor\n\n")); + printf_P(PSTR("\n" MCU_STRING "+Z8S180 Stamp Monitor\n\n")); setup_z180_serv(); diff --git a/configs/debug.config b/configs/debug.config deleted file mode 100644 index 1a54f76..0000000 --- a/configs/debug.config +++ /dev/null @@ -1 +0,0 @@ -CONFIG_DEBUG=0 diff --git a/configs/m1281-debug.config b/configs/m1281-debug.config new file mode 100644 index 0000000..db4eb98 --- /dev/null +++ b/configs/m1281-debug.config @@ -0,0 +1,2 @@ +CONFIG_DEBUG=0 +CONFIG_MCU=atmega1281 diff --git a/configs/m2561-debug.config b/configs/m2561-debug.config new file mode 100644 index 0000000..2366681 --- /dev/null +++ b/configs/m2561-debug.config @@ -0,0 +1,2 @@ +CONFIG_DEBUG=0 +CONFIG_MCU=atmega2561 -- 2.39.2