diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2010-09-05 08:24:56 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2010-09-05 08:24:56 +0000 |
commit | ebdb1b37ca578d0086a77b62ab9159004232c349 (patch) | |
tree | 777029946a3aeecdfe105f359cf7b4716296d1a8 /LUFA | |
parent | 18cbd31605dae070f00900161090a72d3eb0f8ab (diff) | |
download | lufa-ebdb1b37ca578d0086a77b62ab9159004232c349.tar.gz lufa-ebdb1b37ca578d0086a77b62ab9159004232c349.tar.bz2 lufa-ebdb1b37ca578d0086a77b62ab9159004232c349.zip |
Fix bug in Pipe_ConfigurePipe() breaking already configured pipes that was accidentally clearing the pipe's IN mode.
Diffstat (limited to 'LUFA')
-rw-r--r-- | LUFA/Drivers/USB/LowLevel/Pipe.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/LUFA/Drivers/USB/LowLevel/Pipe.c b/LUFA/Drivers/USB/LowLevel/Pipe.c index 5f1090245..79c21f24e 100644 --- a/LUFA/Drivers/USB/LowLevel/Pipe.c +++ b/LUFA/Drivers/USB/LowLevel/Pipe.c @@ -46,16 +46,25 @@ bool Pipe_ConfigurePipe(const uint8_t Number, { uint8_t UPCFG0XTemp[PIPE_TOTAL_PIPES]; uint8_t UPCFG1XTemp[PIPE_TOTAL_PIPES]; + uint8_t UPCFG2XTemp[PIPE_TOTAL_PIPES]; + uint8_t UPCONXTemp[PIPE_TOTAL_PIPES]; + uint8_t UPINRQXTemp[PIPE_TOTAL_PIPES]; for (uint8_t PNum = 0; PNum < PIPE_TOTAL_PIPES; PNum++) { Pipe_SelectPipe(PNum); UPCFG0XTemp[PNum] = UPCFG0X; UPCFG1XTemp[PNum] = UPCFG1X; + UPCFG2XTemp[PNum] = UPCFG2X; + UPCONXTemp[PNum] = UPCONX; + UPINRQXTemp[PNum] = UPINRQX; } UPCFG0XTemp[Number] = ((Type << EPTYPE0) | Token | ((EndpointNumber & PIPE_EPNUM_MASK) << PEPNUM0)); UPCFG1XTemp[Number] = ((1 << ALLOC) | Banks | Pipe_BytesToEPSizeMask(Size)); + UPCFG2XTemp[Number] = 0; + UPCONXTemp[Number] = (1 << INMODE); + UPINRQXTemp[Number] = 0; for (uint8_t PNum = 0; PNum < PIPE_TOTAL_PIPES; PNum++) { @@ -74,16 +83,17 @@ bool Pipe_ConfigurePipe(const uint8_t Number, Pipe_SelectPipe(PNum); Pipe_EnablePipe(); - UPCFG0X = UPCFG0XTemp[PNum]; - UPCFG1X = UPCFG1XTemp[PNum]; - + UPCFG0X = UPCFG0XTemp[PNum]; + UPCFG1X = UPCFG1XTemp[PNum]; + UPCFG2X = UPCFG2XTemp[PNum]; + UPCONX |= UPCONXTemp[PNum]; + UPINRQX = UPINRQXTemp[PNum]; + if (!(Pipe_IsConfigured())) return false; } - - Pipe_SelectPipe(Number); - Pipe_SetInfiniteINRequests(); - + + Pipe_SelectPipe(Number); return true; } |