GcodeDispatch::GcodeDispatch()
{
- halted= false;
uploading = false;
currentline = -1;
last_g= 255;
void GcodeDispatch::on_module_loaded()
{
this->register_for_event(ON_CONSOLE_LINE_RECEIVED);
- this->register_for_event(ON_HALT);
-}
-
-void GcodeDispatch::on_halt(void *arg)
-{
- // set halt stream and ignore everything until M999
- this->halted= (arg == nullptr);
}
// When a command is received, if it is a Gcode, dispatch it as an object via an event
//Prepare gcode for dispatch
Gcode *gcode = new Gcode(single_command, new_message.stream);
- if(halted) {
+ if(THEKERNEL->is_halted()) {
// we ignore all commands until M999, unless it is in the exceptions list (like M105 get temp)
if(gcode->has_m && gcode->m == 999) {
THEKERNEL->call_event(ON_HALT, (void *)1); // clears on_halt
- halted= false;
+
// fall through and pass onto other modules
}else if(!is_allowed_mcode(gcode->m)) {