aboutsummaryrefslogtreecommitdiffstats
path: root/Demos
diff options
context:
space:
mode:
Diffstat (limited to 'Demos')
-rw-r--r--Demos/Host/ClassDriver/StillImageHost/StillImageHost.c22
-rw-r--r--Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c2
-rw-r--r--Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.c4
-rw-r--r--Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.h6
-rw-r--r--Demos/Host/LowLevel/StillImageHost/StillImageHost.c8
5 files changed, 31 insertions, 11 deletions
diff --git a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c
index deb8a5504..d60db097b 100644
--- a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c
+++ b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c
@@ -50,7 +50,6 @@ USB_ClassInfo_SI_Host_t DigitalCamera_SI_Interface =
},
};
-
/** Main program entry point. This routine configures the hardware required by the application, then
* starts the scheduler to run the application tasks.
*/
@@ -102,7 +101,28 @@ int main(void)
USB_HostState = HOST_STATE_Configured;
break;
case HOST_STATE_Configured:
+ printf("Opening Session...\r\n");
+
+ if (SImage_Host_OpenSession(&DigitalCamera_SI_Interface) != PIPE_RWSTREAM_NoError)
+ {
+ printf("Could not open PIMA session.\r\n");
+ USB_HostState = HOST_STATE_WaitForDeviceRemoval;
+ break;
+ }
+
+ printf("Closing Session...\r\n");
+
+ if (SImage_Host_CloseSession(&DigitalCamera_SI_Interface) != PIPE_RWSTREAM_NoError)
+ {
+ printf("Could not close PIMA session.\r\n");
+ USB_HostState = HOST_STATE_WaitForDeviceRemoval;
+ break;
+ }
+
+ printf("Device Idle.\r\n");
+ LEDs_SetAllLEDs(LEDMASK_USB_READY);
+ USB_HostState = HOST_STATE_WaitForDeviceRemoval;
break;
}
diff --git a/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c b/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c
index fefcbbfc7..7ed8898e3 100644
--- a/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c
+++ b/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c
@@ -30,7 +30,7 @@
/** \file
*
- * Printer Device commands, to send/recieve data to and from an attached USB
+ * Printer Device commands, to send/receive data to and from an attached USB
* printer, and to send and receive Printer Class control requests.
*/
diff --git a/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.c b/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.c
index fbff2f48c..31b5e002d 100644
--- a/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.c
+++ b/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.c
@@ -80,7 +80,7 @@ void SImage_SendBlockHeader(void)
}
/** Function to receive a PIMA event container from the attached still image device. */
-uint8_t SImage_RecieveEventHeader(void)
+uint8_t SImage_ReceiveEventHeader(void)
{
uint8_t ErrorCode;
@@ -101,7 +101,7 @@ uint8_t SImage_RecieveEventHeader(void)
}
/** Function to receive a PIMA response container from the attached still image device. */
-uint8_t SImage_RecieveBlockHeader(void)
+uint8_t SImage_ReceiveBlockHeader(void)
{
uint16_t TimeoutMSRem = COMMAND_DATA_TIMEOUT_MS;
diff --git a/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.h b/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.h
index b44b7524f..6ac70fc50 100644
--- a/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.h
+++ b/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.h
@@ -85,7 +85,7 @@
uint16_t Type; /**< Container type, a value from the PIMA_Container_Types_t enum */
uint16_t Code; /**< Command, event or response code of the container */
uint32_t TransactionID; /**< Unique container ID to link blocks together */
- uint32_t Params[4]; /**< Block parameters to be issued along with the block code (command blocks only) */
+ uint32_t Params[3]; /**< Block parameters to be issued along with the block code (command blocks only) */
} PIMA_Container_t;
/* Enums: */
@@ -106,8 +106,8 @@
/* Function Prototypes: */
void SImage_SendBlockHeader(void);
- uint8_t SImage_RecieveBlockHeader(void);
- uint8_t SImage_RecieveEventHeader(void);
+ uint8_t SImage_ReceiveBlockHeader(void);
+ uint8_t SImage_ReceiveEventHeader(void);
uint8_t SImage_SendData(void* Buffer, uint16_t Bytes);
uint8_t SImage_ReadData(void* Buffer, uint16_t Bytes);
bool SImage_IsEventReceived(void);
diff --git a/Demos/Host/LowLevel/StillImageHost/StillImageHost.c b/Demos/Host/LowLevel/StillImageHost/StillImageHost.c
index fb768fdaa..75a293469 100644
--- a/Demos/Host/LowLevel/StillImageHost/StillImageHost.c
+++ b/Demos/Host/LowLevel/StillImageHost/StillImageHost.c
@@ -189,7 +189,7 @@ void StillImage_Task(void)
SImage_SendBlockHeader();
/* Receive the response data block */
- if ((ErrorCode = SImage_RecieveBlockHeader()) != PIPE_RWSTREAM_NoError)
+ if ((ErrorCode = SImage_ReceiveBlockHeader()) != PIPE_RWSTREAM_NoError)
{
ShowCommandError(ErrorCode, false);
@@ -242,7 +242,7 @@ void StillImage_Task(void)
printf_P(PSTR(" Device Version: %s\r\n"), DeviceVersion);
/* Receive the final response block from the device */
- if ((ErrorCode = SImage_RecieveBlockHeader()) != PIPE_RWSTREAM_NoError)
+ if ((ErrorCode = SImage_ReceiveBlockHeader()) != PIPE_RWSTREAM_NoError)
{
ShowCommandError(ErrorCode, false);
@@ -274,7 +274,7 @@ void StillImage_Task(void)
SImage_SendBlockHeader();
/* Receive the response block from the device */
- if ((ErrorCode = SImage_RecieveBlockHeader()) != PIPE_RWSTREAM_NoError)
+ if ((ErrorCode = SImage_ReceiveBlockHeader()) != PIPE_RWSTREAM_NoError)
{
ShowCommandError(ErrorCode, false);
@@ -306,7 +306,7 @@ void StillImage_Task(void)
SImage_SendBlockHeader();
/* Receive the response block from the device */
- if ((ErrorCode = SImage_RecieveBlockHeader()) != PIPE_RWSTREAM_NoError)
+ if ((ErrorCode = SImage_ReceiveBlockHeader()) != PIPE_RWSTREAM_NoError)
{
ShowCommandError(ErrorCode, false);