Fixed MassStorage demo not clearing the reset flag when a Mass Storage Reset is issue...
authorDean Camera <dean@fourwalledcubicle.com>
Tue, 23 Jun 2009 08:45:46 +0000 (08:45 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Tue, 23 Jun 2009 08:45:46 +0000 (08:45 +0000)
Demos/Device/LowLevel/MassStorage/MassStorage.c
Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.c
LUFA/Drivers/USB/Class/Device/MassStorage.c
LUFA/Drivers/USB/LowLevel/Pipe.c
LUFA/ManPages/ChangeLog.txt

index 3f992c2..f0984a2 100644 (file)
@@ -218,9 +218,6 @@ void MassStorage_Task(void)
                                        Endpoint_ClearStall();\r
                                        Endpoint_SelectEndpoint(MASS_STORAGE_IN_EPNUM);\r
                                        Endpoint_ClearStall();\r
                                        Endpoint_ClearStall();\r
                                        Endpoint_SelectEndpoint(MASS_STORAGE_IN_EPNUM);\r
                                        Endpoint_ClearStall();\r
-\r
-                                       /* Clear the abort transfer flag */\r
-                                       IsMassStoreReset = false;\r
                                }\r
 \r
                                /* Indicate ready */\r
                                }\r
 \r
                                /* Indicate ready */\r
@@ -232,6 +229,9 @@ void MassStorage_Task(void)
                                LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
                        }\r
                }\r
                                LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
                        }\r
                }\r
+\r
+               /* Clear the abort transfer flag */\r
+               IsMassStoreReset = false;\r
        }\r
 }\r
 \r
        }\r
 }\r
 \r
index c524b53..b89ad19 100644 (file)
@@ -90,6 +90,7 @@ static uint8_t MassStore_SendCommand(void)
        /* Send the data in the OUT pipe to the attached device */\r
        Pipe_ClearOUT();\r
        \r
        /* Send the data in the OUT pipe to the attached device */\r
        Pipe_ClearOUT();\r
        \r
+       /* Wait until command has been sent */\r
        while(!(Pipe_IsOUTReady()));\r
 \r
        /* Freeze pipe after use */\r
        while(!(Pipe_IsOUTReady()));\r
 \r
        /* Freeze pipe after use */\r
index a70ed68..073111e 100644 (file)
@@ -131,11 +131,11 @@ void MS_Device_USBTask(USB_ClassInfo_MS_Device_t* MSInterfaceInfo)
                                Endpoint_ClearStall();\r
                                Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataINEndpointNumber);\r
                                Endpoint_ClearStall();\r
                                Endpoint_ClearStall();\r
                                Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataINEndpointNumber);\r
                                Endpoint_ClearStall();\r
-\r
-                               MSInterfaceInfo->State.IsMassStoreReset = false;\r
                        }\r
                }\r
        }\r
                        }\r
                }\r
        }\r
+       \r
+       MSInterfaceInfo->State.IsMassStoreReset = false;\r
 }\r
 \r
 static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_Device_t* MSInterfaceInfo)\r
 }\r
 \r
 static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_Device_t* MSInterfaceInfo)\r
index aead39d..1376de4 100644 (file)
@@ -48,8 +48,7 @@ bool Pipe_ConfigurePipe(const uint8_t Number, const uint8_t Type, const uint8_t
        UPCFG0X = ((Type << EPTYPE0) | Token | ((EndpointNumber & PIPE_EPNUM_MASK) << PEPNUM0));\r
        UPCFG1X = ((1 << ALLOC) | Banks | Pipe_BytesToEPSizeMask(Size));\r
 \r
        UPCFG0X = ((Type << EPTYPE0) | Token | ((EndpointNumber & PIPE_EPNUM_MASK) << PEPNUM0));\r
        UPCFG1X = ((1 << ALLOC) | Banks | Pipe_BytesToEPSizeMask(Size));\r
 \r
-       if (Token == PIPE_TOKEN_IN)\r
-         Pipe_SetInfiniteINRequests();\r
+       Pipe_SetInfiniteINRequests();\r
 \r
        return Pipe_IsConfigured();\r
 }\r
 \r
        return Pipe_IsConfigured();\r
 }\r
index 3843941..34fe109 100644 (file)
   *  - Added new USE_INTERNAL_SERIAL define for using the unique serial numbers in some AVR models as the USB device's serial number,\r
   *    added NO_INTERNAL_SERIAL compile time option to turn off new serial number reading code\r
   *  - Fixed ADC driver for the ATMEGA32U4 and ATMEGA16U4 (thanks to Opendous Inc.)\r
   *  - Added new USE_INTERNAL_SERIAL define for using the unique serial numbers in some AVR models as the USB device's serial number,\r
   *    added NO_INTERNAL_SERIAL compile time option to turn off new serial number reading code\r
   *  - Fixed ADC driver for the ATMEGA32U4 and ATMEGA16U4 (thanks to Opendous Inc.)\r
+  *  - Fixed CDCHost demo unfreezing the pipes at the point of configuration, rather than use\r
   *  - Pipe stream functions now automatically set the correct pipe token, so that bidirectional pipes can be used\r
   *  - Pipe_ConfigurePipe() now automatically defaults IN pipes to accepting infinite IN requests, this can still be changed by calling\r
   *    the existing \ref Pipe_SetFiniteINRequests() function\r
   *  - Pipe stream functions now automatically set the correct pipe token, so that bidirectional pipes can be used\r
   *  - Pipe_ConfigurePipe() now automatically defaults IN pipes to accepting infinite IN requests, this can still be changed by calling\r
   *    the existing \ref Pipe_SetFiniteINRequests() function\r
+  *  - Fixed MassStorage demo not clearing the reset flag when a Mass Storage Reset is issued while not processing a command\r
   *\r
   *\r
   *  \section Sec_ChangeLog090605 Version 090605\r
   *\r
   *\r
   *  \section Sec_ChangeLog090605 Version 090605\r