Fix XUA lite when using VENDOR_REQUESTS_PARAMS
This commit is contained in:
@@ -24,6 +24,19 @@ unsafe void XUA_Buffer_lite(chanend c_ep0_out, chanend c_ep0_in, chanend c_aud_o
|
||||
[[combinable]]
|
||||
unsafe void XUA_Buffer_lite2(server ep0_control_if i_ep0_ctl, chanend c_aud_out, chanend ?c_feedback, chanend c_aud_in, chanend c_sof, in port p_for_mclk_count, streaming chanend c_audio_hub);
|
||||
|
||||
/** Transfer samples to/from XUA. Should be called at the current USB rate.
|
||||
* This function is non-blocking.
|
||||
*
|
||||
* \param[in,out] c_audio Channel to XUA.
|
||||
*
|
||||
* \param[out] sampsFromUsbToAudio Samples sent from host to device.
|
||||
*
|
||||
* \param[in] sampsFromAudioToUsb Samples to send from device to host.
|
||||
*
|
||||
* \param[out] clock_nudge Notification that the device is running
|
||||
* too slowly/quickly. Only used when in
|
||||
* adaptive endpoint mode.
|
||||
*/
|
||||
static inline void XUA_transfer_samples(streaming chanend c_audio,
|
||||
unsigned sampsFromUsbToAudio[],
|
||||
unsigned sampsFromAudioToUsb[],
|
||||
|
||||
@@ -1213,13 +1213,13 @@ void XUA_Endpoint0(chanend c_ep0_out, chanend c_ep0_in, chanend c_audioControl,
|
||||
chanend c_mix_ctl, chanend c_clk_ctl, chanend c_EANativeTransport_ctrl, CLIENT_INTERFACE(i_dfu, dfuInterface) VENDOR_REQUESTS_PARAMS_DEC_)
|
||||
{
|
||||
USB_SetupPacket_t sp;
|
||||
XUA_Endpoint0_init(c_ep0_out, c_ep0_in, c_audioControl, c_mix_ctl, c_clk_ctl, c_EANativeTransport_ctrl, dfuInterface);
|
||||
XUA_Endpoint0_init(c_ep0_out, c_ep0_in, c_audioControl, c_mix_ctl, c_clk_ctl, c_EANativeTransport_ctrl, dfuInterface VENDOR_REQUESTS_PARAMS_);
|
||||
|
||||
while(1)
|
||||
{
|
||||
/* Returns XUD_RES_OKAY for success, XUD_RES_RST for bus reset */
|
||||
XUD_Result_t result = USB_GetSetupPacket(ep0_out, ep0_in, &sp);
|
||||
XUA_Endpoint0_loop(result, sp, c_ep0_out, c_ep0_in, c_audioControl, c_mix_ctl, c_clk_ctl, c_EANativeTransport_ctrl, dfuInterface);
|
||||
XUA_Endpoint0_loop(result, sp, c_ep0_out, c_ep0_in, c_audioControl, c_mix_ctl, c_clk_ctl, c_EANativeTransport_ctrl, dfuInterface VENDOR_REQUESTS_PARAMS_);
|
||||
}
|
||||
}
|
||||
#endif /* XUA_USB_EN*/
|
||||
|
||||
@@ -16,7 +16,7 @@ void XUA_Endpoint0_select(chanend c_ep0_out, chanend c_ep0_in, client ep0_contro
|
||||
{
|
||||
|
||||
USB_SetupPacket_t sp;
|
||||
XUA_Endpoint0_lite_init(c_ep0_out, c_ep0_in, null, null, null, null, dfuInterface);
|
||||
XUA_Endpoint0_lite_init(c_ep0_out, c_ep0_in, null, null, null, null, dfuInterface VENDOR_REQUESTS_PARAMS_);
|
||||
unsigned char sbuffer[120];
|
||||
XUD_SetReady_Out(ep0_out, sbuffer);
|
||||
|
||||
@@ -36,7 +36,8 @@ void XUA_Endpoint0_select(chanend c_ep0_out, chanend c_ep0_in, client ep0_contro
|
||||
}
|
||||
debug_printf("ep0, result: %d, length: %d\n", result, length); //-1 reset, 0 ok, 1 error
|
||||
|
||||
XUA_Endpoint0_lite_loop(result, sp, c_ep0_out, c_ep0_in, null, null, null, null, dfuInterface, &input_interface_num, &output_interface_num);
|
||||
XUA_Endpoint0_lite_loop(result, sp, c_ep0_out, c_ep0_in, null, null, null, null, dfuInterface
|
||||
VENDOR_REQUESTS_PARAMS_, &input_interface_num, &output_interface_num);
|
||||
i_ep0_ctl.set_output_interface(output_interface_num);
|
||||
i_ep0_ctl.set_input_interface(input_interface_num);
|
||||
|
||||
@@ -44,4 +45,4 @@ void XUA_Endpoint0_select(chanend c_ep0_out, chanend c_ep0_in, client ep0_contro
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user