mirror of
https://github.com/hathach/tinyusb.git
synced 2025-04-16 05:42:56 +00:00
ENCODE -> DECODE
This commit is contained in:
parent
b68c65faee
commit
05a1b854ff
@ -1481,9 +1481,14 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
|
|||||||
audio->ep_in_as_intf_num = 0;
|
audio->ep_in_as_intf_num = 0;
|
||||||
usbd_edpt_close(rhport, audio->ep_in);
|
usbd_edpt_close(rhport, audio->ep_in);
|
||||||
|
|
||||||
#if !CFG_TUD_AUDIO_ENABLE_ENCODING
|
|
||||||
// Clear FIFOs, since data is no longer valid
|
// Clear FIFOs, since data is no longer valid
|
||||||
|
#if !CFG_TUD_AUDIO_ENABLE_ENCODING
|
||||||
tu_fifo_clear(&audio->ep_in_ff);
|
tu_fifo_clear(&audio->ep_in_ff);
|
||||||
|
#else
|
||||||
|
for (uint8_t cnt = 0; cnt < audio->n_tx_supp_ff; cnt++)
|
||||||
|
{
|
||||||
|
tu_fifo_clear(&audio->tx_supp_ff[cnt]);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Invoke callback - can be used to stop data sampling
|
// Invoke callback - can be used to stop data sampling
|
||||||
@ -1491,14 +1496,6 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
|
|||||||
|
|
||||||
audio->ep_in = 0; // Necessary?
|
audio->ep_in = 0; // Necessary?
|
||||||
|
|
||||||
// Clear support FIFOs if used
|
|
||||||
#if CFG_TUD_AUDIO_ENABLE_ENCODING
|
|
||||||
for (uint8_t cnt = 0; cnt < audio->n_tx_supp_ff; cnt++)
|
|
||||||
{
|
|
||||||
tu_fifo_clear(&audio->tx_supp_ff[cnt]);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1508,9 +1505,14 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
|
|||||||
audio->ep_out_as_intf_num = 0;
|
audio->ep_out_as_intf_num = 0;
|
||||||
usbd_edpt_close(rhport, audio->ep_out);
|
usbd_edpt_close(rhport, audio->ep_out);
|
||||||
|
|
||||||
#if !CFG_TUD_AUDIO_ENABLE_ENCODING
|
|
||||||
// Clear FIFOs, since data is no longer valid
|
// Clear FIFOs, since data is no longer valid
|
||||||
|
#if !CFG_TUD_AUDIO_ENABLE_DECODING
|
||||||
tu_fifo_clear(&audio->ep_out_ff);
|
tu_fifo_clear(&audio->ep_out_ff);
|
||||||
|
#else
|
||||||
|
for (uint8_t cnt = 0; cnt < audio->n_rx_supp_ff; cnt++)
|
||||||
|
{
|
||||||
|
tu_fifo_clear(&audio->rx_supp_ff[cnt]);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Invoke callback - can be used to stop data sampling
|
// Invoke callback - can be used to stop data sampling
|
||||||
@ -1518,14 +1520,6 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
|
|||||||
|
|
||||||
audio->ep_out = 0; // Necessary?
|
audio->ep_out = 0; // Necessary?
|
||||||
|
|
||||||
// Clear support FIFOs if used
|
|
||||||
#if CFG_TUD_AUDIO_ENABLE_DECODING
|
|
||||||
for (uint8_t cnt = 0; cnt < audio->n_rx_supp_ff; cnt++)
|
|
||||||
{
|
|
||||||
tu_fifo_clear(&audio->rx_supp_ff[cnt]);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Close corresponding feedback EP
|
// Close corresponding feedback EP
|
||||||
#if CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
|
#if CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
|
||||||
usbd_edpt_close(rhport, audio->ep_fb);
|
usbd_edpt_close(rhport, audio->ep_fb);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user