mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2026-02-20 00:31:35 +01:00
@@ -271,7 +271,8 @@ void MarlinHAL::adc_start(const pin_t pin) {
|
||||
uint32_t mv;
|
||||
esp_adc_cal_get_voltage((adc_channel_t)chan, &characteristics[attenuations[chan]], &mv);
|
||||
|
||||
adc_result = (mv * 1023) * (1000.f / (ADC_REFERENCE_VOLTAGE));
|
||||
static constexpr uint32_t adc_divisor = uint32_t((ADC_REFERENCE_VOLTAGE) * 1000UL);
|
||||
adc_result = (mv * 1023UL) / adc_divisor;
|
||||
|
||||
// Change the attenuation level based on the new reading
|
||||
adc_atten_t atten;
|
||||
|
||||
Reference in New Issue
Block a user