Skip to content

Commit ce19132

Browse files
committed
RP2040 PDMIn frequency based on sample rate
1 parent fd2cbc0 commit ce19132

File tree

1 file changed

+1
-1
lines changed
  • ports/raspberrypi/common-hal/audiobusio

1 file changed

+1
-1
lines changed

ports/raspberrypi/common-hal/audiobusio/PDMIn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t *self,
6464
// Use the state machine to manage pins.
6565
common_hal_rp2pio_statemachine_construct(&self->state_machine,
6666
pdmin, sizeof(pdmin) / sizeof(pdmin[0]),
67-
44100 * 32 * 2, // Clock at 44.1 khz to warm the DAC up.
67+
sample_rate * 32 * 2, // Frequency based on sample rate
6868
NULL, 0,
6969
NULL, 1, 0, 0xffffffff, // out pin
7070
data_pin, 1, // in pins

0 commit comments

Comments
 (0)