diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2017-10-11 22:16:02 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2017-10-12 11:59:27 -0400 |
commit | d03cf2b83f9df6b802af72860d8d3b56df89956f (patch) | |
tree | b9f61292f67fcf0548eaa8f5b3a7c491290689fd /src/linux | |
parent | 744c6d114e3681a2e8cfcd4475424a7d19774d52 (diff) | |
download | kutter-d03cf2b83f9df6b802af72860d8d3b56df89956f.tar.gz kutter-d03cf2b83f9df6b802af72860d8d3b56df89956f.tar.xz kutter-d03cf2b83f9df6b802af72860d8d3b56df89956f.zip |
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>
Diffstat (limited to 'src/linux')
-rw-r--r-- | src/linux/analog.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/linux/analog.c b/src/linux/analog.c index 88adc9dd..c909e286 100644 --- a/src/linux/analog.c +++ b/src/linux/analog.c @@ -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); |