gcode_button: ignore empty templates
A bouncing button can generate a lot of pending G-code Each G-Code command will lock on the G-Code mutex Decrease pressure by ignoring empty G-Code requests Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
This commit is contained in:
1 parent
f3db41c637
commit
b8c936f7b8
1 file changed
+4
-1
@@ -40,7 +40,10 @@ class GCodeButton:
|
||||
if not state:
|
||||
template = self.release_template
|
||||
try:
|
||||
self.gcode.run_script(template.render())
|
||||
commands = template.render()
|
||||
if not commands.strip():
|
||||
return
|
||||
self.gcode.run_script(commands)
|
||||
except:
|
||||
logging.exception("Script running error")
|
||||
|
||||
|
||||
Reference in new issue
Block a user