STM32: ADC warning fix (#13933)
This commit is contained in:
parent
6b96eaa15b
commit
e53d7e5517
@ -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…
Reference in New Issue
Block a user