Skip to content

Commit cc665f3

Browse files
committed
Merge branch 'contrib/github_pr_512' into 'master'
Fix usb_mic_task overrun by enforcing MIC_INTERVAL_MS pacing (GitHub PR) Closes AEGHB-1078 See merge request ae_group/esp-iot-solution!1325
2 parents a568297 + e715e59 commit cc665f3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

components/usb/usb_device_uac/usb_device_uac.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,10 +456,12 @@ static void usb_spk_task(void *pvParam)
456456
#if CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_RX
457457
static 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

0 commit comments

Comments
 (0)