Skip to content

Commit 178f327

Browse files
committed
AdvancedADC: Disable DMA IRQ before enabling double buffer mode.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
1 parent 0fcd53e commit 178f327

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/AdvancedADC.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,9 @@ int AdvancedADC::begin(uint32_t resolution, uint32_t sample_rate, size_t n_sampl
208208
}
209209

210210
// Re/enable DMA double buffer mode.
211+
HAL_NVIC_DisableIRQ(descr->dma_irqn);
211212
hal_dma_enable_dbm(&descr->dma, descr->dmabuf[0]->data(), descr->dmabuf[1]->data());
213+
HAL_NVIC_EnableIRQ(descr->dma_irqn);
212214

213215
// Init, config and start the ADC timer.
214216
hal_tim_config(&descr->tim, sample_rate);

0 commit comments

Comments
 (0)