XMOS USB Audio 代码中从 XUD 提取出 audio sample data 方法
关键是 buffer.xc 中的这一句使 audio out endpoint 能够被 decouple core 使用,decouple core 中直接用 XUD 标准函数来读数据存入数据 buffer 中:
/* Store EP's to globals so that decouple() can access them */
asm("stw %0, dp[aud_from_host_usb_ep]"::"r"(ep_aud_out));
So when received Audio packet HOST -> DEVICE by the code below, the data should be on the EP first.
XUD_GetData_Select(c_aud_out, ep_aud_out, length, result):
Then very soon in the decouple core, the same EP will be set as ready to receive data, and store the audio sample data into the real outAudioBuff in the decouple core.
XUD_SetReady_OutPtr(aud_from_host_usb_ep, aud_from_host_wrptr+4);
发表时间:2014年7月25日13:00:43