🐛 STM32 ADC followup (#22798)
This commit is contained in:
committed by
Scott Lahteine
parent
0e8e215d4e
commit
5d8ca7c944
@ -437,7 +437,7 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) {
|
||||
case POWER_MONITOR_VOLTAGE_PIN: pin_index = POWERMON_VOLTS; break;
|
||||
#endif
|
||||
}
|
||||
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] >> (12 - HAL_ADC_RESOLUTION); // shift out unused bits
|
||||
}
|
||||
|
||||
uint16_t HAL_adc_get_result() { return HAL_adc_result; }
|
||||
|
Reference in New Issue
Block a user