\r
#include "StillImageCommands.h"\r
\r
-/* Globals: */\r
/** PIMA block container for the block to send to the device */\r
PIMA_Container_t PIMA_SendBlock;\r
\r
}\r
\r
/** Function to receive a PIMA event container from the attached still image device. */\r
-uint8_t SImage_RecieveEventHeader(void)\r
+uint8_t SImage_ReceiveEventHeader(void)\r
{\r
uint8_t ErrorCode;\r
\r
}\r
\r
/** Function to receive a PIMA response container from the attached still image device. */\r
-uint8_t SImage_RecieveBlockHeader(void)\r
+uint8_t SImage_ReceiveBlockHeader(void)\r
{\r
uint16_t TimeoutMSRem = COMMAND_DATA_TIMEOUT_MS;\r
\r
}\r
}\r
\r
+ Pipe_Freeze();\r
Pipe_SelectPipe(SIMAGE_DATA_OUT_PIPE);\r
+ Pipe_Unfreeze();\r
\r
/* Check if pipe stalled (command failed by device) */\r
if (Pipe_IsStalled())\r
return PIPE_RWSTREAM_PipeStalled;\r
}\r
\r
+ Pipe_Freeze();\r
Pipe_SelectPipe(SIMAGE_DATA_IN_PIPE);\r
+ Pipe_Unfreeze();\r
\r
/* Check if pipe stalled (command failed by device) */\r
if (Pipe_IsStalled())\r
}\r
\r
/* Check to see if the device was disconnected, if so exit function */\r
- if (!(USB_IsConnected))\r
- {\r
- /* Return error code */\r
- return PIPE_RWSTREAM_DeviceDisconnected;\r
- }\r
- };\r
- \r
- /* Freeze OUT pipe after use */\r
- Pipe_SelectPipe(SIMAGE_DATA_OUT_PIPE);\r
- Pipe_Freeze();\r
-\r
- /* Select the IN data pipe for data reception */\r
- Pipe_SelectPipe(SIMAGE_DATA_IN_PIPE);\r
- \r
+ if (USB_HostState == HOST_STATE_Unattached)\r
+ return PIPE_RWSTREAM_DeviceDisconnected;\r
+ }\r
+ \r
/* Load in the response from the attached device */\r
Pipe_Read_Stream_LE(&PIMA_ReceivedBlock, PIMA_COMMAND_SIZE(0));\r
\r