Skip to content

Commit 8ffdbfe

Browse files
author
Reinhard Panhuber
committed
Streamline call of tud_audio_set_itf_cb() within audiod_set_interface()
1 parent 5aba464 commit 8ffdbfe

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

src/class/audio/audio_device.c

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1631,7 +1631,7 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
16311631

16321632
#endif
16331633
// Invoke callback - can be used to trigger data sampling if not already running
1634-
if (tud_audio_set_itf_cb) TU_VERIFY(tud_audio_set_itf_cb(rhport, p_request));
1634+
// if (tud_audio_set_itf_cb) TU_VERIFY(tud_audio_set_itf_cb(rhport, p_request));
16351635

16361636
// 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
16371637
// 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
@@ -1665,10 +1665,10 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
16651665

16661666
#if CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
16671667
// In case of asynchronous EP, call Cb after ep_fb is set
1668-
if ( !(desc_ep->bmAttributes.sync == 0x01 && audio->ep_fb == 0) )
1669-
{
1670-
if (tud_audio_set_itf_cb) TU_VERIFY(tud_audio_set_itf_cb(rhport, p_request));
1671-
}
1668+
// if ( !(desc_ep->bmAttributes.sync == 0x01 && audio->ep_fb == 0) )
1669+
// {
1670+
// if (tud_audio_set_itf_cb) TU_VERIFY(tud_audio_set_itf_cb(rhport, p_request));
1671+
// }
16721672
#else
16731673
// Invoke callback
16741674
if (tud_audio_set_itf_cb) TU_VERIFY(tud_audio_set_itf_cb(rhport, p_request));
@@ -1693,11 +1693,11 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
16931693
audio->fb_n_cycles_old = 0;
16941694
#endif
16951695

1696-
// Invoke callback after ep_out is set
1697-
if (audio->ep_out != 0)
1698-
{
1699-
if (tud_audio_set_itf_cb) TU_VERIFY(tud_audio_set_itf_cb(rhport, p_request));
1700-
}
1696+
// // Invoke callback after ep_out is set
1697+
// if (audio->ep_out != 0)
1698+
// {
1699+
// if (tud_audio_set_itf_cb) TU_VERIFY(tud_audio_set_itf_cb(rhport, p_request));
1700+
// }
17011701
}
17021702
#endif
17031703
#endif // CFG_TUD_AUDIO_ENABLE_EP_OUT
@@ -1709,6 +1709,9 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
17091709

17101710
TU_VERIFY(foundEPs == nEps);
17111711

1712+
// Invoke one callback for a final set interface
1713+
if (tud_audio_set_itf_cb) TU_VERIFY(tud_audio_set_itf_cb(rhport, p_request));
1714+
17121715
// We are done - abort loop
17131716
break;
17141717
}
@@ -2118,7 +2121,7 @@ void audiod_sof (uint8_t rhport, uint32_t frame_count)
21182121

21192122
// Buffer count checks ?
21202123

2121-
// Magic checks
2124+
// Magic checks - where are they from?
21222125
if (feedback > 2949166){ // 45.0007 in 16.16 format
21232126
feedback = 2949166;
21242127
}

0 commit comments

Comments
 (0)