diff options
| author | MasterPhi <[email protected]> | 2021-07-05 21:00:04 +0200 |
|---|---|---|
| committer | MasterPhi <[email protected]> | 2021-07-05 21:00:37 +0200 |
| commit | 05a1b854ffcebe8144481a8af9e447d0eac2ae1f (patch) | |
| tree | 0aeb1412843edbb833d22adc138ae7af3771324a | |
| parent | b68c65faeef0d23ed4196b7a9211845f470a6a96 (diff) | |
ENCODE -> DECODE
| -rw-r--r-- | src/class/audio/audio_device.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/src/class/audio/audio_device.c b/src/class/audio/audio_device.c index c7b8b8519..97a9c495e 100644 --- a/src/class/audio/audio_device.c +++ b/src/class/audio/audio_device.c @@ -1481,9 +1481,14 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const * audio->ep_in_as_intf_num = 0; usbd_edpt_close(rhport, audio->ep_in); -#if !CFG_TUD_AUDIO_ENABLE_ENCODING // Clear FIFOs, since data is no longer valid +#if !CFG_TUD_AUDIO_ENABLE_ENCODING 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 // 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? - // 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 @@ -1508,9 +1505,14 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const * audio->ep_out_as_intf_num = 0; usbd_edpt_close(rhport, audio->ep_out); -#if !CFG_TUD_AUDIO_ENABLE_ENCODING // Clear FIFOs, since data is no longer valid +#if !CFG_TUD_AUDIO_ENABLE_DECODING 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 // 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? - // 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 #if CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP usbd_edpt_close(rhport, audio->ep_fb); |
