From 848dd740ba4ec555b0cab2e5730fb67b4d68bb0e Mon Sep 17 00:00:00 2001 From: BigTreeTech <38851044+bigtreetech@users.noreply.github.com> Date: Sat, 24 Aug 2019 14:33:16 +0800 Subject: [PATCH] Fix STM32F1 ADC read temperature error (#15026) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …after USB CDC connect. --- Marlin/src/HAL/HAL_STM32F1/HAL.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL.cpp b/Marlin/src/HAL/HAL_STM32F1/HAL.cpp index 17457343d..1af050e20 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL.cpp +++ b/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();