mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-08 07:27:43 -06:00
adccmds: Continue to query analog inputs after a shutdown
Continue to sample the ADC input pins even if the MCU goes into a shutdown state. This enables the printer to continue reporting temperatures even on an mcu error. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
744c6d114e
commit
d03cf2b83f
5 changed files with 20 additions and 10 deletions
|
@ -49,7 +49,8 @@ gpio_adc_read(struct gpio_adc g)
|
|||
int ret = pread(g.fd, buf, sizeof(buf)-1, 0);
|
||||
if (ret <= 0) {
|
||||
report_errno("analog read", ret);
|
||||
shutdown("Error on analog read");
|
||||
try_shutdown("Error on analog read");
|
||||
return 0;
|
||||
}
|
||||
buf[ret] = '\0';
|
||||
return atoi(buf);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue