X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/8f6b4ddf764c3a54e42d00a7502c82c5c3e71b1c..c20a94a4e84c89debf5e7109482ede708a694a0c:/Demos/Device/AudioInput/AudioInput.c diff --git a/Demos/Device/AudioInput/AudioInput.c b/Demos/Device/AudioInput/AudioInput.c index c0166944b..05094c2b8 100644 --- a/Demos/Device/AudioInput/AudioInput.c +++ b/Demos/Device/AudioInput/AudioInput.c @@ -39,8 +39,8 @@ /* Scheduler Task List */ TASK_LIST { - { Task: USB_USBTask , TaskStatus: TASK_STOP }, - { Task: USB_Audio_Task , TaskStatus: TASK_STOP }, + { .Task = USB_USBTask , .TaskStatus = TASK_STOP }, + { .Task = USB_Audio_Task , .TaskStatus = TASK_STOP }, }; @@ -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;