Skip to content
This repository was archived by the owner on Apr 16, 2021. It is now read-only.

Commit 055af04

Browse files
committed
PDM: use HFCLK clock
This clock usually gets activated only by RADIO (BLE). Helps keeping the microphone jitter low.
1 parent 67ef327 commit 055af04

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libraries/PDM/src/PDM.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ int PDMClass::begin(int channels, long sampleRate)
4848
{
4949
_channels = channels;
5050

51+
NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
52+
NRF_CLOCK->TASKS_HFCLKSTART = 1;
53+
while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0) { }
54+
5155
// configure the sample rate and channels
5256
switch (sampleRate) {
5357
case 16000:

0 commit comments

Comments
 (0)