Sfoglia il codice sorgente

STM32: ADC warning fix (#13933)

Tanguy Pruvot 5 anni fa
parent
commit
e53d7e5517
1 ha cambiato i file con 2 aggiunte e 3 eliminazioni
  1. 2
    3
      Marlin/src/HAL/HAL_STM32F1/HAL.cpp

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

@@ -279,6 +279,7 @@ void HAL_adc_init(void) {
279 279
 void HAL_adc_start_conversion(const uint8_t adc_pin) {
280 280
   TEMP_PINS pin_index;
281 281
   switch (adc_pin) {
282
+    default: return;
282 283
     #if HAS_TEMP_ADC_0
283 284
       case TEMP_0_PIN: pin_index = TEMP_0; break;
284 285
     #endif
@@ -310,8 +311,6 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) {
310 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 316
 #endif // __STM32F1__

Loading…
Annulla
Salva