ADC out of range - improve logging


While debugging a ‘ADC out of range’ i noticed that the status line just before the error eventually does not capture the out-of-range value.
i got this in 1 out of 3 times, the status line just before the ‘ADC out of range’ to not show the error value.

People on discord told me that its already hard to tell which ADC failed, so having an status line in the timeframe the error is triggered with the erroneous reading value and corresponding sensor would allow for more specific actions to resolve the problem.

Looking at the code in src/adccmds.c around line 49 makes me believe that the ADC triggers an error after 0,9 seconds of bad values while the status line appears every 1 second. first error on 0s, 2nd on 0.3s, 3rd on 0.6s and last one on 0.9s triggers the shutdown. That would mean a 10% chance that the status line misses the error value, but it feels like it happens way more often.

My suggestion is to either increase the RANGE_CHECK_COUNT to 5 or 6 so it guarantees a status line or (even better) push a final status line when a shutdown is triggered.

Additionally, it would be nice if that status line would include ALL sensor values. The value of my temperature_fan thermistor is missing, the sensor that actually caused the issue for me. I could only tell which one is defective because i confirmed the extruder/bed temp were ok.

To reproduce, start klipper and disconnect a thermistor, so ADC out of range gets triggered. Do that multiple times until you see that the last status line does not show a bad temperature reading.