aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Class/Host/StillImage.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-03-25 06:34:38 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-03-25 06:34:38 +0000
commit74353374c38237d1c976dabf81703dd885d0d556 (patch)
treec96599e868d2fbe7215c86fe5a2dfe2d217846f7 /LUFA/Drivers/USB/Class/Host/StillImage.c
parentb8db5fc1e7a49c0b91a67570e11edf90f985cd00 (diff)
downloadlufa-74353374c38237d1c976dabf81703dd885d0d556.tar.gz
lufa-74353374c38237d1c976dabf81703dd885d0d556.tar.bz2
lufa-74353374c38237d1c976dabf81703dd885d0d556.zip
All Class Driver Host mode demos now correctly set the board LEDs to READY once the enumeration process has completed.
Fixed Still Image Host class driver not resetting the transaction ID when a new session is opened, fixed driver not sending a valid session ID to the device.
Diffstat (limited to 'LUFA/Drivers/USB/Class/Host/StillImage.c')
-rw-r--r--LUFA/Drivers/USB/Class/Host/StillImage.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/LUFA/Drivers/USB/Class/Host/StillImage.c b/LUFA/Drivers/USB/Class/Host/StillImage.c
index 577f619c8..d116ceb74 100644
--- a/LUFA/Drivers/USB/Class/Host/StillImage.c
+++ b/LUFA/Drivers/USB/Class/Host/StillImage.c
@@ -315,12 +315,15 @@ uint8_t SImage_Host_OpenSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
uint8_t ErrorCode;
+ SIInterfaceInfo->State.TransactionID = 0;
+ SIInterfaceInfo->State.IsSessionOpen = false;
+
SI_PIMA_Container_t PIMABlock = (SI_PIMA_Container_t)
{
- .DataLength = PIMA_COMMAND_SIZE(0),
+ .DataLength = PIMA_COMMAND_SIZE(1),
.Type = CType_CommandBlock,
.Code = 0x1002,
- .Params = {},
+ .Params = {1},
};
if ((ErrorCode = SImage_Host_SendBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError)
@@ -332,7 +335,6 @@ uint8_t SImage_Host_OpenSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
if ((PIMABlock.Type != CType_ResponseBlock) || (PIMABlock.Code != 0x2001))
return SI_ERROR_LOGICAL_CMD_FAILED;
- SIInterfaceInfo->State.TransactionID = 0;
SIInterfaceInfo->State.IsSessionOpen = true;
return PIPE_RWSTREAM_NoError;
@@ -347,10 +349,10 @@ uint8_t SImage_Host_CloseSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
SI_PIMA_Container_t PIMABlock = (SI_PIMA_Container_t)
{
- .DataLength = PIMA_COMMAND_SIZE(0),
+ .DataLength = PIMA_COMMAND_SIZE(1),
.Type = CType_CommandBlock,
.Code = 0x1003,
- .Params = {},
+ .Params = {1},
};
if ((ErrorCode = SImage_Host_SendBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError)