aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host/ClassDriver/StillImageHost
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-09-02 13:08:55 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-09-02 13:08:55 +0000
commit6783bc4594177833d2b1047d77316e38cfe6a629 (patch)
tree192e7b44b6e0ff87d1cd5108c2d2b4d318e90eb7 /Demos/Host/ClassDriver/StillImageHost
parent205b35d131a1cc8196786de4370cb90fec17835e (diff)
downloadlufa-6783bc4594177833d2b1047d77316e38cfe6a629.tar.gz
lufa-6783bc4594177833d2b1047d77316e38cfe6a629.tar.bz2
lufa-6783bc4594177833d2b1047d77316e38cfe6a629.zip
Add StillImage Host Class Driver functions for opening and closing sessions. Ensure IsActive is set on the interface to allow device functions to run.
Fix spelling of "Received" in all source files where it is misspelt "Recieved".
Diffstat (limited to 'Demos/Host/ClassDriver/StillImageHost')
-rw-r--r--Demos/Host/ClassDriver/StillImageHost/StillImageHost.c22
1 files changed, 21 insertions, 1 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;
}