Browse Source

Fix STM32F1 ADC read temperature error (#15026)

…after USB CDC connect.
pull/1/head
BigTreeTech 5 years ago
committed by Scott Lahteine
parent
commit
848dd740ba
  1. 4
      Marlin/src/HAL/HAL_STM32F1/HAL.cpp

4
Marlin/src/HAL/HAL_STM32F1/HAL.cpp

@ -93,7 +93,7 @@ uint16_t HAL_adc_result;
// ------------------------
STM32ADC adc(ADC1);
uint8_t adc_pins[] = {
const uint8_t adc_pins[] = {
#if HAS_TEMP_ADC_0
TEMP_0_PIN,
#endif
@ -270,7 +270,7 @@ void HAL_adc_init(void) {
#else
adc.setSampleRate(ADC_SMPR_41_5); // 41.5 ADC cycles
#endif
adc.setPins(adc_pins, ADC_PIN_COUNT);
adc.setPins((uint8_t *)adc_pins, ADC_PIN_COUNT);
adc.setDMA(HAL_adc_results, (uint16_t)ADC_PIN_COUNT, (uint32_t)(DMA_MINC_MODE | DMA_CIRC_MODE), nullptr);
adc.setScanMode();
adc.setContinuous();

Loading…
Cancel
Save