X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/37b2130fb2767a39f3d95414c6aca75a67c26298..c20a94a4e84c89debf5e7109482ede708a694a0c:/Demos/Device/AudioInput/AudioInput.c?ds=sidebyside diff --git a/Demos/Device/AudioInput/AudioInput.c b/Demos/Device/AudioInput/AudioInput.c index ade3aa5a3..05094c2b8 100644 --- a/Demos/Device/AudioInput/AudioInput.c +++ b/Demos/Device/AudioInput/AudioInput.c @@ -131,18 +131,16 @@ EVENT_HANDLER(USB_ConfigurationChanged) EVENT_HANDLER(USB_UnhandledControlPacket) { /* Process General and Audio specific control requests */ - switch (bRequest) + switch (USB_ControlRequest.bRequest) { case REQ_SetInterface: /* Set Interface is not handled by the library, as its function is application-specific */ - if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_INTERFACE)) + if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_INTERFACE)) { - uint16_t wValue = Endpoint_Read_Word_LE(); - - Endpoint_ClearControlSETUP(); + Endpoint_ClearSETUP(); /* Check if the host is enabling the audio interface (setting AlternateSetting to 1) */ - if (wValue) + if (USB_ControlRequest.wValue) { /* Start audio task */ Scheduler_SetTaskMode(USB_Audio_Task, TASK_RUN); @@ -155,7 +153,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket) /* Acknowledge status stage */ while (!(Endpoint_IsINReady())); - Endpoint_ClearControlIN(); + Endpoint_ClearIN(); } break;