diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 8cc0a6621..735fad015 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -901,6 +901,7 @@ G29_TYPE GcodeSuite::G29() { TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE)); G29_RETURN(isnan(abl.measured_z)); + } #endif // HAS_ABL_NOT_UBL diff --git a/Marlin/src/gcode/parser.cpp b/Marlin/src/gcode/parser.cpp index 9f0d09563..8cbbe1d19 100644 --- a/Marlin/src/gcode/parser.cpp +++ b/Marlin/src/gcode/parser.cpp @@ -217,10 +217,10 @@ void GCodeParser::parse(char *p) { #if ENABLED(GCODE_MOTION_MODES) #if ENABLED(ARC_SUPPORT) - case 'I' ... 'J': case 'R': + case 'I' ... 'J': if (motion_mode_codenum != 2 && motion_mode_codenum != 3) return; #endif - case 'P' ... 'Q': + case 'Q': if (motion_mode_codenum != 5) return; case 'X' ... 'Z': case 'E' ... 'F': if (motion_mode_codenum < 0) return; @@ -229,15 +229,23 @@ void GCodeParser::parse(char *p) { TERN_(USE_GCODE_SUBCODES, subcode = motion_mode_subcode); p--; // Back up one character to use the current parameter break; - #endif // GCODE_MOTION_MODES + #endif #if ENABLED(REALTIME_REPORTING_COMMANDS) - case 'S': case 'P': case 'R': { + case 'P': case 'R': { + if (letter == 'R') { + #if ENABLED(GCODE_MOTION_MODES) + if (ENABLED(ARC_SUPPORT) && !WITHIN(motion_mode_codenum, 2, 3)) return; + #endif + } + else if (TERN0(GCODE_MOTION_MODES, motion_mode_codenum != 5)) return; + } // fall-thru + case 'S': { codenum = 0; // The only valid codenum is 0 uint8_t digits = 0; while (*p++ == '0') digits++; // Count up '0' characters command_letter = (digits == 3) ? letter : '?'; // Three '0' digits is a good command - } return; // No parameters, so return + } return; // No parameters needed, so return now #endif default: return;