Partial commit: Rename references to Drivers/AT90USBXXX to Drivers/Peripheral.
[pub/USBasp.git] / Demos / Host / StillImageHost / StillImageCommands.c
index 4d4c0b1..ebf20b0 100644 (file)
@@ -72,7 +72,7 @@ void SImage_SendBlockHeader(void)
                }\r
                \r
                /* Send the PIMA command block to the attached device */\r
                }\r
                \r
                /* Send the PIMA command block to the attached device */\r
-               Pipe_ClearCurrentBank();\r
+               Pipe_ClearOUT();\r
        }\r
                                        \r
        /* Freeze pipe after use */\r
        }\r
                                        \r
        /* Freeze pipe after use */\r
@@ -90,7 +90,7 @@ void SImage_RecieveEventHeader(void)
        Pipe_Read_Stream_LE(&PIMA_EventBlock, sizeof(PIMA_EventBlock));\r
        \r
        /* Clear the pipe after read complete to prepare for next event */\r
        Pipe_Read_Stream_LE(&PIMA_EventBlock, sizeof(PIMA_EventBlock));\r
        \r
        /* Clear the pipe after read complete to prepare for next event */\r
-       Pipe_ClearCurrentBank();\r
+       Pipe_ClearIN();\r
        \r
        /* Freeze the event pipe again after use */\r
        Pipe_Freeze();\r
        \r
        /* Freeze the event pipe again after use */\r
        Pipe_Freeze();\r
@@ -106,12 +106,12 @@ uint8_t SImage_RecieveBlockHeader(void)
        Pipe_Unfreeze();\r
        \r
        /* Wait until data received on the IN pipe */\r
        Pipe_Unfreeze();\r
        \r
        /* Wait until data received on the IN pipe */\r
-       while (!(Pipe_ReadWriteAllowed()))\r
+       while (!(Pipe_IsReadWriteAllowed()))\r
        {\r
                /* Check to see if a new frame has been issued (1ms elapsed) */\r
                if (USB_INT_HasOccurred(USB_INT_HSOFI))\r
                {\r
        {\r
                /* Check to see if a new frame has been issued (1ms elapsed) */\r
                if (USB_INT_HasOccurred(USB_INT_HSOFI))\r
                {\r
-                       /* Clear the flag and decrement the timout period counter */\r
+                       /* Clear the flag and decrement the timeout period counter */\r
                        USB_INT_Clear(USB_INT_HSOFI);\r
                        TimeoutMSRem--;\r
 \r
                        USB_INT_Clear(USB_INT_HSOFI);\r
                        TimeoutMSRem--;\r
 \r
@@ -179,7 +179,7 @@ uint8_t SImage_RecieveBlockHeader(void)
                }\r
                \r
                /* Clear pipe bank after use */\r
                }\r
                \r
                /* Clear pipe bank after use */\r
-               Pipe_ClearCurrentBank();\r
+               Pipe_ClearIN();\r
        }\r
        \r
        /* Freeze the IN pipe after use */\r
        }\r
        \r
        /* Freeze the IN pipe after use */\r
@@ -203,7 +203,7 @@ void SImage_SendData(void* Buffer, uint16_t Bytes)
        Pipe_Write_Stream_LE(Buffer, Bytes);\r
 \r
        /* Send the last packet to the attached device */\r
        Pipe_Write_Stream_LE(Buffer, Bytes);\r
 \r
        /* Send the last packet to the attached device */\r
-       Pipe_ClearCurrentBank();\r
+       Pipe_ClearOUT();\r
 \r
        /* Freeze the pipe again after use */\r
        Pipe_Freeze();\r
 \r
        /* Freeze the pipe again after use */\r
        Pipe_Freeze();\r
@@ -272,5 +272,8 @@ uint8_t SImage_ClearPipeStall(const uint8_t PipeEndpointNum)
                        wLength:       0,\r
                };\r
        \r
                        wLength:       0,\r
                };\r
        \r
+       /* Select the control pipe for the request transfer */\r
+       Pipe_SelectPipe(PIPE_CONTROLPIPE);\r
+\r
        return USB_Host_SendControlRequest(NULL);\r
 }\r
        return USB_Host_SendControlRequest(NULL);\r
 }\r