Browse Source

STM32: ADC warning fix (#13933)

Tanguy Pruvot 5 years ago
parent
commit
e53d7e5517
1 changed files with 2 additions and 3 deletions
  1. 2
    3
      Marlin/src/HAL/HAL_STM32F1/HAL.cpp

+ 2
- 3
Marlin/src/HAL/HAL_STM32F1/HAL.cpp View File

279
 void HAL_adc_start_conversion(const uint8_t adc_pin) {
279
 void HAL_adc_start_conversion(const uint8_t adc_pin) {
280
   TEMP_PINS pin_index;
280
   TEMP_PINS pin_index;
281
   switch (adc_pin) {
281
   switch (adc_pin) {
282
+    default: return;
282
     #if HAS_TEMP_ADC_0
283
     #if HAS_TEMP_ADC_0
283
       case TEMP_0_PIN: pin_index = TEMP_0; break;
284
       case TEMP_0_PIN: pin_index = TEMP_0; break;
284
     #endif
285
     #endif
310
   HAL_adc_result = (HAL_adc_results[(int)pin_index] >> 2) & 0x3FF; // shift to get 10 bits only.
311
   HAL_adc_result = (HAL_adc_results[(int)pin_index] >> 2) & 0x3FF; // shift to get 10 bits only.
311
 }
312
 }
312
 
313
 
313
-uint16_t HAL_adc_get_result(void) {
314
-  return HAL_adc_result;
315
-}
314
+uint16_t HAL_adc_get_result(void) { return HAL_adc_result; }
316
 
315
 
317
 #endif // __STM32F1__
316
 #endif // __STM32F1__

Loading…
Cancel
Save