Browse Source

STM32: ADC warning fix (#13933)

pull/1/head
Tanguy Pruvot 6 years ago
committed by Scott Lahteine
parent
commit
e53d7e5517
  1. 5
      Marlin/src/HAL/HAL_STM32F1/HAL.cpp

5
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) { void HAL_adc_start_conversion(const uint8_t adc_pin) {
TEMP_PINS pin_index; TEMP_PINS pin_index;
switch (adc_pin) { switch (adc_pin) {
default: return;
#if HAS_TEMP_ADC_0 #if HAS_TEMP_ADC_0
case TEMP_0_PIN: pin_index = TEMP_0; break; case TEMP_0_PIN: pin_index = TEMP_0; break;
#endif #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. HAL_adc_result = (HAL_adc_results[(int)pin_index] >> 2) & 0x3FF; // shift to get 10 bits only.
} }
uint16_t HAL_adc_get_result(void) { uint16_t HAL_adc_get_result(void) { return HAL_adc_result; }
return HAL_adc_result;
}
#endif // __STM32F1__ #endif // __STM32F1__

Loading…
Cancel
Save