From eea6dad0aef56aea4687f680eb3c8773ec8ec650 Mon Sep 17 00:00:00 2001 From: WestfW Date: Sat, 6 Oct 2018 23:02:05 -0700 Subject: [PATCH] Fix ATtiny828; proper USART conditionals in pin_defs.h, remove infinite recursion for "make attiny828at8" --- optiboot/bootloaders/optiboot/Makefile.tiny | 2 +- optiboot/bootloaders/optiboot/makeall.tiny.sh | 2 ++ optiboot/bootloaders/optiboot/pin_defs.h | 24 ++++++++++++------- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/optiboot/bootloaders/optiboot/Makefile.tiny b/optiboot/bootloaders/optiboot/Makefile.tiny index 8cc8452fa..27920a2e9 100644 --- a/optiboot/bootloaders/optiboot/Makefile.tiny +++ b/optiboot/bootloaders/optiboot/Makefile.tiny @@ -346,7 +346,7 @@ endif attiny828at8: - $(MAKE) attiny828at8 AVR_FREQ=8000000L BAUD_RATE=57600 + $(MAKE) attiny828 AVR_FREQ=8000000L BAUD_RATE=57600 mv $(PROGRAM)_attiny828.hex $(PROGRAM)_$@.hex ifndef PRODUCTION mv $(PROGRAM)_attiny828.lst $(PROGRAM)_$@.lst diff --git a/optiboot/bootloaders/optiboot/makeall.tiny.sh b/optiboot/bootloaders/optiboot/makeall.tiny.sh index 94cf9554e..79c74866c 100755 --- a/optiboot/bootloaders/optiboot/makeall.tiny.sh +++ b/optiboot/bootloaders/optiboot/makeall.tiny.sh @@ -42,3 +42,5 @@ make attiny841at8ser1 $* make attiny841at20noLED $* make attiny841at16noLED $* make attiny841at8noLED $* + +make attiny828at8 $* diff --git a/optiboot/bootloaders/optiboot/pin_defs.h b/optiboot/bootloaders/optiboot/pin_defs.h index c34eaeda2..5e9520f81 100644 --- a/optiboot/bootloaders/optiboot/pin_defs.h +++ b/optiboot/bootloaders/optiboot/pin_defs.h @@ -43,19 +43,27 @@ * differently. */ #if UART == 0 - #if defined(LINDAT) -#define LIN_UART 1 -#define UART_SRA UCSRA -#define UART_SRB UCSRB -#define UART_SRC UCSRC -#define UART_SRL UBRRL -#define UART_UDR LINDAT - #else +#if defined(UDR0) # define UART_SRA UCSR0A # define UART_SRB UCSR0B # define UART_SRC UCSR0C # define UART_SRL UBRR0L # define UART_UDR UDR0 +#elif defined(UDR) +# define UART_SRA UCSRA +# define UART_SRB UCSRB +# define UART_SRC UCSRC +# define UART_SRL UBRRL +# define UART_UDR UDR +#elif defined(LINDAT) +# define LIN_UART 1 +# define UART_SRA UCSRA +# define UART_SRB UCSRB +# define UART_SRC UCSRC +# define UART_SRL UBRRL +# define UART_UDR LINDAT +#else +# error UART == 0, but no UART0 on device #endif #elif UART == 1 #if !defined(UDR1)