mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Merge pull request #1091 from openmv/nrf_audio_fixes
Add Arduino fixes.
This commit is contained in:
commit
0d830d15a3
@ -81,9 +81,17 @@ static mp_obj_t py_audio_init(uint n_args, const mp_obj_t *args, mp_map_t *kw_ar
|
|||||||
.interrupt_priority = PDM_IRQ_PRIORITY,
|
.interrupt_priority = PDM_IRQ_PRIORITY,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Enable high frequency oscillator if not already enabled
|
||||||
|
if (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0) {
|
||||||
|
NRF_CLOCK->TASKS_HFCLKSTART = 1;
|
||||||
|
while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// configure the sample rate and channels
|
// configure the sample rate and channels
|
||||||
switch (frequency) {
|
switch (frequency) {
|
||||||
case 16000:
|
case 16000:
|
||||||
|
NRF_PDM->RATIO = ((PDM_RATIO_RATIO_Ratio80 << PDM_RATIO_RATIO_Pos) & PDM_RATIO_RATIO_Msk);
|
||||||
nrfx_pdm_config.clock_freq = NRF_PDM_FREQ_1280K;
|
nrfx_pdm_config.clock_freq = NRF_PDM_FREQ_1280K;
|
||||||
break;
|
break;
|
||||||
case 41667:
|
case 41667:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user