Skip to content

Commit e384d16

Browse files
committed
clean up tud_audio_set_itf_cb() invocation
1 parent 223aaea commit e384d16

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

src/class/audio/audio_device.c

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,8 +1629,6 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
16291629
#endif
16301630

16311631
#endif
1632-
// Invoke callback - can be used to trigger data sampling if not already running
1633-
// if (tud_audio_set_itf_cb) TU_VERIFY(tud_audio_set_itf_cb(rhport, p_request));
16341632

16351633
// Schedule first transmit if alternate interface is not zero i.e. streaming is disabled - in case no sample data is available a ZLP is loaded
16361634
// It is necessary to trigger this here since the refill is done with an RX FIFO empty interrupt which can only trigger if something was in there
@@ -1662,16 +1660,6 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
16621660
#endif
16631661
#endif
16641662

1665-
#if CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
1666-
// In case of asynchronous EP, call Cb after ep_fb is set
1667-
// if ( !(desc_ep->bmAttributes.sync == 0x01 && audio->ep_fb == 0) )
1668-
// {
1669-
// if (tud_audio_set_itf_cb) TU_VERIFY(tud_audio_set_itf_cb(rhport, p_request));
1670-
// }
1671-
#else
1672-
// Invoke callback
1673-
if (tud_audio_set_itf_cb) TU_VERIFY(tud_audio_set_itf_cb(rhport, p_request));
1674-
#endif
16751663
// Prepare for incoming data
16761664
#if USE_LINEAR_BUFFER_RX
16771665
TU_VERIFY(usbd_edpt_xfer(rhport, audio->ep_out, audio->lin_buf_out, audio->ep_out_sz), false);
@@ -1688,12 +1676,6 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
16881676

16891677
// Enable SOF interrupt if callback is implemented
16901678
if (tud_audio_feedback_interval_isr) usbd_sof_enable(rhport, true);
1691-
1692-
// // Invoke callback after ep_out is set
1693-
// if (audio->ep_out != 0)
1694-
// {
1695-
// if (tud_audio_set_itf_cb) TU_VERIFY(tud_audio_set_itf_cb(rhport, p_request));
1696-
// }
16971679
}
16981680
#endif
16991681
#endif // CFG_TUD_AUDIO_ENABLE_EP_OUT
@@ -1705,10 +1687,10 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
17051687

17061688
TU_VERIFY(foundEPs == nEps);
17071689

1708-
#if CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
17091690
// Invoke one callback for a final set interface
17101691
if (tud_audio_set_itf_cb) TU_VERIFY(tud_audio_set_itf_cb(rhport, p_request));
17111692

1693+
#if CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
17121694
// Prepare feedback computation if callback is available
17131695
if (tud_audio_feedback_params_cb)
17141696
{

0 commit comments

Comments
 (0)