8000 Check for PDMIn DMA getting stuck. by dhalbert · Pull Request #916 · adafruit/circuitpython · GitHub
[go: up one dir, main page]

Skip to content

Check for PDMIn DMA getting stuck. #916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 8, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions ports/atmel-samd/common-hal/audiobusio/PDMIn.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,18 @@ uint32_t common_hal_audiobusio_pdmin_record_to_buffer(audiobusio_pdmin_obj_t* se
break;
}
// Wait for the next buffer to fill
uint32_t wait_counts = 0;
#ifdef SAMD21
#define MAX_WAIT_COUNTS 1000
#endif
#ifdef SAMD51
#define MAX_WAIT_COUNTS 6000
#endif
while (!event_interrupt_active(event_channel)) {
if (wait_counts++ > MAX_WAIT_COUNTS) {
// Buffer has stopped filling; DMA may have missed an I2S trigger event.
break;
}
#ifdef MICROPY_VM_HOOK_LOOP
MICROPY_VM_HOOK_LOOP
#endif
Expand Down
0