Skip to content

Commit 7782562

Browse files
Update src/AdvancedADC.cpp
Co-authored-by: Ibrahim Abdelkader <[email protected]>
1 parent bc5b920 commit 7782562

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/AdvancedADC.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,9 @@ int AdvancedADC::begin(uint32_t resolution, uint32_t sample_rate, size_t n_sampl
185185
descr->dmabuf[1] = descr->pool->allocate();
186186

187187
// Init and config DMA.
188-
if (hal_dma_config(&descr->dma, descr->dma_irqn, DMA_PERIPH_TO_MEMORY) < 0) return 0;
188+
if (hal_dma_config(&descr->dma, descr->dma_irqn, DMA_PERIPH_TO_MEMORY) < 0) {
189+
return 0;
190+
}
189191

190192
// Init and config ADC.
191193
if (hal_adc_config(&descr->adc, ADC_RES_LUT[resolution], descr->tim_trig, adc_pins, n_channels) < 0) return 0;

0 commit comments

Comments
 (0)