From e53d7e55175a08bc0788547cbabb33f7fdce8778 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Thu, 9 May 2019 07:33:38 +0200 Subject: [PATCH] STM32: ADC warning fix (#13933) --- Marlin/src/HAL/HAL_STM32F1/HAL.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL.cpp b/Marlin/src/HAL/HAL_STM32F1/HAL.cpp index 1534a35756..c2d0325e65 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/HAL.cpp @@ -279,6 +279,7 @@ void HAL_adc_init(void) { void HAL_adc_start_conversion(const uint8_t adc_pin) { TEMP_PINS pin_index; switch (adc_pin) { + default: return; #if HAS_TEMP_ADC_0 case TEMP_0_PIN: pin_index = TEMP_0; break; #endif @@ -310,8 +311,6 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) { HAL_adc_result = (HAL_adc_results[(int)pin_index] >> 2) & 0x3FF; // shift to get 10 bits only. } -uint16_t HAL_adc_get_result(void) { - return HAL_adc_result; -} +uint16_t HAL_adc_get_result(void) { return HAL_adc_result; } #endif // __STM32F1__