Explorar el Código

Fix Realtime Reporting with G-code Motion Modes (#21630)

fedetony hace 3 años
padre
commit
b8cf818dac
No account linked to committer's email address
Se han modificado 2 ficheros con 14 adiciones y 5 borrados
  1. 1
    0
      Marlin/src/gcode/bedlevel/abl/G29.cpp
  2. 13
    5
      Marlin/src/gcode/parser.cpp

+ 1
- 0
Marlin/src/gcode/bedlevel/abl/G29.cpp Ver fichero

@@ -901,6 +901,7 @@ G29_TYPE GcodeSuite::G29() {
901 901
   TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE));
902 902
 
903 903
   G29_RETURN(isnan(abl.measured_z));
904
+
904 905
 }
905 906
 
906 907
 #endif // HAS_ABL_NOT_UBL

+ 13
- 5
Marlin/src/gcode/parser.cpp Ver fichero

@@ -217,10 +217,10 @@ void GCodeParser::parse(char *p) {
217 217
 
218 218
     #if ENABLED(GCODE_MOTION_MODES)
219 219
       #if ENABLED(ARC_SUPPORT)
220
-        case 'I' ... 'J': case 'R':
220
+        case 'I' ... 'J': 
221 221
           if (motion_mode_codenum != 2 && motion_mode_codenum != 3) return;
222 222
       #endif
223
-      case 'P' ... 'Q':
223
+      case 'Q':
224 224
         if (motion_mode_codenum != 5) return;
225 225
       case 'X' ... 'Z': case 'E' ... 'F':
226 226
         if (motion_mode_codenum < 0) return;
@@ -229,15 +229,23 @@ void GCodeParser::parse(char *p) {
229 229
         TERN_(USE_GCODE_SUBCODES, subcode = motion_mode_subcode);
230 230
         p--; // Back up one character to use the current parameter
231 231
       break;
232
-    #endif // GCODE_MOTION_MODES
232
+    #endif
233 233
 
234 234
     #if ENABLED(REALTIME_REPORTING_COMMANDS)
235
-      case 'S': case 'P': case 'R': {
235
+      case 'P': case 'R': {
236
+        if (letter == 'R') {
237
+          #if ENABLED(GCODE_MOTION_MODES)
238
+            if (ENABLED(ARC_SUPPORT) && !WITHIN(motion_mode_codenum, 2, 3)) return;
239
+          #endif
240
+        }
241
+        else if (TERN0(GCODE_MOTION_MODES, motion_mode_codenum != 5)) return;
242
+      } // fall-thru
243
+      case 'S': {
236 244
         codenum = 0;                  // The only valid codenum is 0
237 245
         uint8_t digits = 0;
238 246
         while (*p++ == '0') digits++; // Count up '0' characters
239 247
         command_letter = (digits == 3) ? letter : '?'; // Three '0' digits is a good command
240
-      } return;                       // No parameters, so return
248
+      } return;                       // No parameters needed, so return now
241 249
     #endif
242 250
 
243 251
     default: return;

Loading…
Cancelar
Guardar