aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2013-04-21 19:06:34 +0000
committerDean Camera <dean@fourwalledcubicle.com>2013-04-21 19:06:34 +0000
commit8232721102b7dee4be98e54687457b28b8318a58 (patch)
tree1dc6919958bdf665e2dd2268a6ab0ca9864d6d23 /LUFA/Drivers
parent2fe1d7d1701535e0a28acec8c30a788147549a41 (diff)
downloadlufa-8232721102b7dee4be98e54687457b28b8318a58.tar.gz
lufa-8232721102b7dee4be98e54687457b28b8318a58.tar.bz2
lufa-8232721102b7dee4be98e54687457b28b8318a58.zip
Fixed possible register corruption in USB Host mode on AVR8 devices when ORDERED_EP_CONFIG is used (thanks to Martin Aakerberg).
Diffstat (limited to 'LUFA/Drivers')
-rw-r--r--LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c b/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c
index 45b4bddc6..bd285db55 100644
--- a/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c
+++ b/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c
@@ -47,13 +47,13 @@ bool Pipe_ConfigurePipeTable(const USB_Pipe_Table_t* const Table,
{
if (!(Table[i].Address))
continue;
-
+
if (!(Pipe_ConfigurePipe(Table[i].Address, Table[i].Type, Table[i].EndpointAddress, Table[i].Size, Table[i].Banks)))
{
return false;
}
}
-
+
return true;
}
@@ -65,7 +65,7 @@ bool Pipe_ConfigurePipe(const uint8_t Address,
{
uint8_t Number = (Address & PIPE_EPNUM_MASK);
uint8_t Token = (Address & PIPE_DIR_IN) ? PIPE_TOKEN_IN : PIPE_TOKEN_OUT;
-
+
if (Number >= PIPE_TOTAL_PIPES)
return false;
@@ -97,7 +97,7 @@ bool Pipe_ConfigurePipe(const uint8_t Address,
if (PNum == Number)
{
UPCFG0XTemp = ((Type << EPTYPE0) | Token | ((EndpointAddress & PIPE_EPNUM_MASK) << PEPNUM0));
- UPCFG1XTemp = ((1 << ALLOC) | Banks | Pipe_BytesToEPSizeMask(Size));
+ UPCFG1XTemp = ((1 << ALLOC) | ((Banks > 1) ? (1 << EPBK0) : 0) | Pipe_BytesToEPSizeMask(Size));
UPCFG2XTemp = 0;
UPIENXTemp = 0;
}