projects
/
pub
/
USBasp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
025e57b
)
Fixed broken AVR8 USART-SPI peripheral driver (thanks to Phil Zakielarz).
author
Dean Camera
<dean@fourwalledcubicle.com>
Sat, 13 Sep 2014 06:29:29 +0000
(16:29 +1000)
committer
Dean Camera
<dean@fourwalledcubicle.com>
Sat, 13 Sep 2014 06:29:29 +0000
(16:29 +1000)
BuildTests/ModuleTest/Modules.h
patch
|
blob
|
blame
|
history
LUFA/DoxygenPages/ChangeLog.txt
patch
|
blob
|
blame
|
history
LUFA/Drivers/Peripheral/AVR8/SerialSPI_AVR8.h
patch
|
blob
|
blame
|
history
diff --git
a/BuildTests/ModuleTest/Modules.h
b/BuildTests/ModuleTest/Modules.h
index
a027f80
..
cc16fd6
100644
(file)
--- a/
BuildTests/ModuleTest/Modules.h
+++ b/
BuildTests/ModuleTest/Modules.h
@@
-37,20
+37,20
@@
#include <LUFA/Drivers/Misc/TerminalCodes.h>
#if (ARCH == ARCH_AVR8)
#include <LUFA/Drivers/Misc/TerminalCodes.h>
#if (ARCH == ARCH_AVR8)
- #if defined(TWCR)
- #include <LUFA/Drivers/Peripheral/TWI.h>
- #endif
-
#if defined(ADC)
#include <LUFA/Drivers/Peripheral/ADC.h>
#endif
#include <LUFA/Drivers/Peripheral/Serial.h>
#if defined(ADC)
#include <LUFA/Drivers/Peripheral/ADC.h>
#endif
#include <LUFA/Drivers/Peripheral/Serial.h>
- #include <LUFA/Drivers/Peripheral/SPI.h>
#include <LUFA/Drivers/Peripheral/SerialSPI.h>
#include <LUFA/Drivers/Peripheral/SerialSPI.h>
+ #include <LUFA/Drivers/Peripheral/SPI.h>
+
+ #if defined(TWCR)
+ #include <LUFA/Drivers/Peripheral/TWI.h>
+ #endif
#elif (ARCH == ARCH_XMEGA)
#elif (ARCH == ARCH_XMEGA)
- #include <LUFA/Drivers/Peripheral/TWI.h>
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Peripheral/Serial.h>
- #include <LUFA/Drivers/Peripheral/SPI.h>
#include <LUFA/Drivers/Peripheral/SerialSPI.h>
#include <LUFA/Drivers/Peripheral/SerialSPI.h>
+ #include <LUFA/Drivers/Peripheral/SPI.h>
+ #include <LUFA/Drivers/Peripheral/TWI.h>
#endif
#endif
diff --git
a/LUFA/DoxygenPages/ChangeLog.txt
b/LUFA/DoxygenPages/ChangeLog.txt
index
075fb25
..
ef1fe6c
100644
(file)
--- a/
LUFA/DoxygenPages/ChangeLog.txt
+++ b/
LUFA/DoxygenPages/ChangeLog.txt
@@
-33,6
+33,7
@@
* FLASH memory devices (thanks to demultiplexer)
* - Fixed missing parenthesis in the MIDI_EVENT() macro which could cause incorrect results (thanks to hexwab)
* - Fixed mixed capitalization of TWI in the XMEGA TWI driver causing compilation failures (thanks to Jacob Schloss)
* FLASH memory devices (thanks to demultiplexer)
* - Fixed missing parenthesis in the MIDI_EVENT() macro which could cause incorrect results (thanks to hexwab)
* - Fixed mixed capitalization of TWI in the XMEGA TWI driver causing compilation failures (thanks to Jacob Schloss)
+ * - Fixed broken AVR8 USART-SPI peripheral driver (thanks to Phil Zakielarz)
* - Library Applications:
* - Fixed spurious 0xFE USART byte sent in the USBtoSerial project when the baud rate is changed (thanks to Carl Kjeldsen)
* - Fixed blocking USART reads causing low throughput on slow baud rates in the USBtoSerial project (thanks to Nevada Smith)
* - Library Applications:
* - Fixed spurious 0xFE USART byte sent in the USBtoSerial project when the baud rate is changed (thanks to Carl Kjeldsen)
* - Fixed blocking USART reads causing low throughput on slow baud rates in the USBtoSerial project (thanks to Nevada Smith)
diff --git
a/LUFA/Drivers/Peripheral/AVR8/SerialSPI_AVR8.h
b/LUFA/Drivers/Peripheral/AVR8/SerialSPI_AVR8.h
index
7afaf1b
..
8d58369
100644
(file)
--- a/
LUFA/Drivers/Peripheral/AVR8/SerialSPI_AVR8.h
+++ b/
LUFA/Drivers/Peripheral/AVR8/SerialSPI_AVR8.h
@@
-52,7
+52,7
@@
*
* \code
* // Initialize the Master SPI mode USART driver before first use, with 1Mbit baud
*
* \code
* // Initialize the Master SPI mode USART driver before first use, with 1Mbit baud
- * SerialSPI_Init((USART_SPI_SCK_LEAD_RISING |
SPI_SAMPLE_LEADING |
SPI_ORDER_MSB_FIRST), 1000000);
+ * SerialSPI_Init((USART_SPI_SCK_LEAD_RISING |
USART_SPI_SAMPLE_LEADING | USART_
SPI_ORDER_MSB_FIRST), 1000000);
*
* // Send several bytes, ignoring the returned data
* SerialSPI_SendByte(0x01);
*
* // Send several bytes, ignoring the returned data
* SerialSPI_SendByte(0x01);
@@
-90,37
+90,45
@@
#endif
/* Private Interface - For use in library only: */
#endif
/* Private Interface - For use in library only: */
- #if !defined(__DOXYGEN__)
- #define SERIAL_SPI_UBBRVAL(Baud) ((Baud < (F_CPU / 2)) ? ((F_CPU / (2 * Baud)) - 1) : 0)
- #endif
+ #if !defined(__DOXYGEN__)
+ #define SERIAL_SPI_UBBRVAL(Baud) ((Baud < (F_CPU / 2)) ? ((F_CPU / (2 * Baud)) - 1) : 0)
+
+ /* Master USART SPI mode flag definitions missing in the AVR8 toolchain */
+ #if !defined(UCPHA1)
+ #define UCPHA1 1
+ #endif
+ #if !defined(UDORD1)
+ #define UDORD1 2
+ #endif
+ #endif
/* Public Interface - May be used in end-application: */
/* Macros: */
/** \name SPI SCK Polarity Configuration Masks */
//@{
/** SPI clock polarity mask for \ref SPI_Init(). Indicates that the SCK should lead on the rising edge. */
/* Public Interface - May be used in end-application: */
/* Macros: */
/** \name SPI SCK Polarity Configuration Masks */
//@{
/** SPI clock polarity mask for \ref SPI_Init(). Indicates that the SCK should lead on the rising edge. */
- #define USART_SPI_SCK_LEAD_RISING (0 << UCPOL)
+ #define USART_SPI_SCK_LEAD_RISING (0 << UCPOL
1
)
/** SPI clock polarity mask for \ref SPI_Init(). Indicates that the SCK should lead on the falling edge. */
/** SPI clock polarity mask for \ref SPI_Init(). Indicates that the SCK should lead on the falling edge. */
- #define USART_SPI_SCK_LEAD_FALLING (1 << UCPOL)
+ #define USART_SPI_SCK_LEAD_FALLING (1 << UCPOL
1
)
//@}
/** \name SPI Sample Edge Configuration Masks */
//@{
/** SPI data sample mode mask for \ref SerialSPI_Init(). Indicates that the data should sampled on the leading edge. */
//@}
/** \name SPI Sample Edge Configuration Masks */
//@{
/** SPI data sample mode mask for \ref SerialSPI_Init(). Indicates that the data should sampled on the leading edge. */
- #define USART_SPI_SAMPLE_LEADING (0 << U
PCHA
)
+ #define USART_SPI_SAMPLE_LEADING (0 << U
CPHA1
)
/** SPI data sample mode mask for \ref SerialSPI_Init(). Indicates that the data should be sampled on the trailing edge. */
/** SPI data sample mode mask for \ref SerialSPI_Init(). Indicates that the data should be sampled on the trailing edge. */
- #define USART_SPI_SAMPLE_TRAILING (1 << U
PCHA
)
+ #define USART_SPI_SAMPLE_TRAILING (1 << U
CPHA1
)
//@}
/** \name SPI Data Ordering Configuration Masks */
//@{
/** SPI data order mask for \ref SerialSPI_Init(). Indicates that data should be shifted out MSB first. */
//@}
/** \name SPI Data Ordering Configuration Masks */
//@{
/** SPI data order mask for \ref SerialSPI_Init(). Indicates that data should be shifted out MSB first. */
- #define USART_SPI_ORDER_MSB_FIRST (0 << UDORD)
+ #define USART_SPI_ORDER_MSB_FIRST (0 << UDORD
1
)
/** SPI data order mask for \ref SerialSPI_Init(). Indicates that data should be shifted out LSB first. */
/** SPI data order mask for \ref SerialSPI_Init(). Indicates that data should be shifted out LSB first. */
- #define USART_SPI_ORDER_LSB_FIRST (1 << UDORD)
+ #define USART_SPI_ORDER_LSB_FIRST (1 << UDORD
1
)
//@}
/* Inline Functions: */
//@}
/* Inline Functions: */