mcu: Detect if the communication channel to the firmware is lost

Detect a comms loss and report it to the user.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2016-11-30 19:31:46 -05:00
parent 5ebe8ce025
commit bc80ed4e88
4 changed files with 30 additions and 5 deletions

View file

@ -184,6 +184,10 @@ class Printer:
self.state_message = "Firmware shutdown: %s%s" % (
msg, message_shutdown)
self.gcode.set_printer_ready(False)
def note_mcu_error(self, msg):
self.state_message = "%s%s" % (msg, message_restart)
self.gcode.set_printer_ready(False)
self.gcode.note_mcu_error()
######################################################################