Ensure ADC conversion is complete before reading (#11336)
The current Marlin implementation relies on a timer interrupt to start the ADC conversion and read it. However in some circumstances the interrupt can be delayed resulting in insufficient time being available for the ADC conversion. This results in a bad reading and false temperature fluctuations. These changes make sure that the conversion is complete (by checking the ADC hardware via the HAL) before reading a value. See: https://github.com/MarlinFirmware/Marlin/issues/11323
This commit is contained in:
committed by
Scott Lahteine
parent
e2aa635e70
commit
624986d423
@ -142,7 +142,8 @@ uint8_t spiRec(uint32_t chan);
|
||||
void HAL_adc_init();
|
||||
|
||||
#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
|
||||
#define HAL_READ_ADC HAL_adc_get_result()
|
||||
#define HAL_READ_ADC() HAL_adc_get_result()
|
||||
#define HAL_ADC_READY() true
|
||||
|
||||
#define HAL_ANALOG_SELECT(pin) NOOP;
|
||||
|
||||
|
Reference in New Issue
Block a user