From a4a6958524adab55b5306df7c9a5de70b359dfa1 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Mon, 12 Aug 2013 16:27:06 +0200 Subject: Fix broken USART SPI driver for the AVR8 architecture. --- LUFA/Drivers/Peripheral/AVR8/SerialSPI_AVR8.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'LUFA/Drivers/Peripheral') diff --git a/LUFA/Drivers/Peripheral/AVR8/SerialSPI_AVR8.h b/LUFA/Drivers/Peripheral/AVR8/SerialSPI_AVR8.h index f12aa77f7..e449a8f5e 100644 --- a/LUFA/Drivers/Peripheral/AVR8/SerialSPI_AVR8.h +++ b/LUFA/Drivers/Peripheral/AVR8/SerialSPI_AVR8.h @@ -133,13 +133,13 @@ static inline void SerialSPI_Init(const uint8_t SPIOptions, const uint32_t BaudRate) { - UBRR1 = SERIAL_SPI_UBBRVAL(BaudRate); + DDRD |= ((1 << 3) | (1 << 5)); + PORTD |= (1 << 2); UCSR1C = ((1 << UMSEL11) | (1 << UMSEL10) | SPIOptions); UCSR1B = ((1 << TXEN1) | (1 << RXEN1)); - DDRD |= (1 << 3); - PORTD |= (1 << 2); + UBRR1 = SERIAL_SPI_UBBRVAL(BaudRate); } /** Turns off the USART driver, disabling and returning used hardware to their default configuration. */ @@ -151,7 +151,7 @@ UBRR1 = 0; - DDRD &= ~(1 << 3); + DDRD &= ~((1 << 3) | (1 << 5)); PORTD &= ~(1 << 2); } -- cgit v1.2.3