File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
components/usb/usb_device_uac Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -456,10 +456,12 @@ static void usb_spk_task(void *pvParam)
456456#if CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_RX
457457static void usb_mic_task (void * pvParam )
458458{
459+ TickType_t xLastWakeTime = xTaskGetTickCount ();
459460 while (1 ) {
460461 if (s_uac_device -> mic_active == false) {
461462 // clear the notification
462463 ulTaskNotifyTake (pdTRUE , portMAX_DELAY );
464+ xLastWakeTime = xTaskGetTickCount ();
463465 continue ;
464466 }
465467 // clear the notification
@@ -479,6 +481,8 @@ static void usb_mic_task(void *pvParam)
479481 s_uac_device -> mic_data_size = bytes_read ;
480482 UAC_EXIT_CRITICAL ();
481483 }
484+
485+ vTaskDelayUntil (& xLastWakeTime , pdMS_TO_TICKS (MIC_INTERVAL_MS ));
482486 }
483487}
484488#endif
You can’t perform that action at this time.
0 commit comments