Skip to content

Commit cef326b

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

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
@@ -190,7 +190,9 @@ int AdvancedADC::begin(uint32_t resolution, uint32_t sample_rate, size_t n_sampl
190190
}
191191

192192
// Init and config ADC.
193-
if (hal_adc_config(&descr->adc, ADC_RES_LUT[resolution], descr->tim_trig, adc_pins, n_channels) < 0) return 0;
193+
if (hal_adc_config(&descr->adc, ADC_RES_LUT[resolution], descr->tim_trig, adc_pins, n_channels) < 0) {
194+
return 0;
195+
}
194196

195197
// Link DMA handle to ADC handle, and start the ADC.
196198
__HAL_LINKDMA(&descr->adc, DMA_Handle, descr->dma);

0 commit comments

Comments
 (0)