X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/7fbb75928749b74a0964ad159159066967191243..1190652c0b210fe24320f8da9bfd5a0e169111d8:/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c?ds=inline diff --git a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c index deb8a5504..ef073abd5 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,30 @@ 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("Turning off Device...\r\n"); + SImage_Host_SendCommand(&DigitalCamera_SI_Interface, 0x1013, 0, 0, 0, 0, NULL); + printf("Device Off.\r\n"); + + 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; + } + + LEDs_SetAllLEDs(LEDMASK_USB_READY); + USB_HostState = HOST_STATE_WaitForDeviceRemoval; break; }