projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added new Printer Host mode Class driver.
[pub/USBasp.git]
/
Demos
/
Host
/
LowLevel
/
StillImageHost
/
Lib
/
StillImageCommands.c
diff --git
a/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.c
b/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.c
index
970df4f
..
4735781
100644
(file)
--- a/
Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.c
+++ b/
Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.c
@@
-37,7
+37,6
@@
\r
#include "StillImageCommands.h"
\r
\r
\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
/** PIMA block container for the block to send to the device */
\r
PIMA_Container_t PIMA_SendBlock;
\r
\r
@@
-80,7
+79,7
@@
void SImage_SendBlockHeader(void)
}
\r
\r
/** Function to receive a PIMA event container from the attached still image device. */
\r
}
\r
\r
/** Function to receive a PIMA event container from the attached still image device. */
\r
-uint8_t SImage_Rec
ie
veEventHeader(void)
\r
+uint8_t SImage_Rec
ei
veEventHeader(void)
\r
{
\r
uint8_t ErrorCode;
\r
\r
{
\r
uint8_t ErrorCode;
\r
\r
@@
-101,7
+100,7
@@
uint8_t SImage_RecieveEventHeader(void)
}
\r
\r
/** Function to receive a PIMA response container from the attached still image device. */
\r
}
\r
\r
/** Function to receive a PIMA response container from the attached still image device. */
\r
-uint8_t SImage_Rec
ie
veBlockHeader(void)
\r
+uint8_t SImage_Rec
ei
veBlockHeader(void)
\r
{
\r
uint16_t TimeoutMSRem = COMMAND_DATA_TIMEOUT_MS;
\r
\r
{
\r
uint16_t TimeoutMSRem = COMMAND_DATA_TIMEOUT_MS;
\r
\r
@@
-127,7
+126,9
@@
uint8_t SImage_RecieveBlockHeader(void)
}
\r
}
\r
\r
}
\r
}
\r
\r
+ Pipe_Freeze();
\r
Pipe_SelectPipe(SIMAGE_DATA_OUT_PIPE);
\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
\r
/* Check if pipe stalled (command failed by device) */
\r
if (Pipe_IsStalled())
\r
@@
-139,7
+140,9
@@
uint8_t SImage_RecieveBlockHeader(void)
return PIPE_RWSTREAM_PipeStalled;
\r
}
\r
\r
return PIPE_RWSTREAM_PipeStalled;
\r
}
\r
\r
+ Pipe_Freeze();
\r
Pipe_SelectPipe(SIMAGE_DATA_IN_PIPE);
\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
/* Check if pipe stalled (command failed by device) */
\r
if (Pipe_IsStalled())
\r
@@
-155,14
+158,7
@@
uint8_t SImage_RecieveBlockHeader(void)
if (USB_HostState == HOST_STATE_Unattached)
\r
return PIPE_RWSTREAM_DeviceDisconnected;
\r
}
\r
if (USB_HostState == HOST_STATE_Unattached)
\r
return PIPE_RWSTREAM_DeviceDisconnected;
\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
+
\r
/* Load in the response from the attached device */
\r
Pipe_Read_Stream_LE(&PIMA_ReceivedBlock, PIMA_COMMAND_SIZE(0));
\r
\r
/* Load in the response from the attached device */
\r
Pipe_Read_Stream_LE(&PIMA_ReceivedBlock, PIMA_COMMAND_SIZE(0));
\r
\r