Browse Source

Prettify process_parsed_command

pull/1/head
Scott Lahteine 7 years ago
parent
commit
3c5c6d478a
  1. 521
      Marlin/src/gcode/gcode.cpp

521
Marlin/src/gcode/gcode.cpp

@ -142,520 +142,419 @@ void GcodeSuite::process_parsed_command() {
switch (parser.command_letter) { switch (parser.command_letter) {
case 'G': switch (parser.codenum) { case 'G': switch (parser.codenum) {
// G0, G1 case 0: case 1: G0_G1( // G0: Fast Move, G1: Linear Move
case 0: #if IS_SCARA
case 1: parser.codenum == 0
#if IS_SCARA #endif
G0_G1(parser.codenum == 0); );
#else break;
G0_G1();
#endif
break;
// G2, G3
#if ENABLED(ARC_SUPPORT) && DISABLED(SCARA) #if ENABLED(ARC_SUPPORT) && DISABLED(SCARA)
case 2: // G2: CW ARC case 2: case 3: G2_G3(parser.codenum == 2); break; // G2: CW ARC, G3: CCW ARC
case 3: // G3: CCW ARC
G2_G3(parser.codenum == 2);
break;
#endif #endif
// G4 Dwell case 4: G4(); break; // G4: Dwell
case 4:
G4();
break;
#if ENABLED(BEZIER_CURVE_SUPPORT) #if ENABLED(BEZIER_CURVE_SUPPORT)
case 5: // G5: Cubic B_spline case 5: G5(); break; // G5: Cubic B_spline
G5(); #endif
break;
#endif // BEZIER_CURVE_SUPPORT
#if ENABLED(FWRETRACT) #if ENABLED(FWRETRACT)
case 10: // G10: retract case 10: G10(); break; // G10: Retract / Swap Retract
G10(); case 11: G11(); break; // G11: Recover / Swap Recover
break; #endif
case 11: // G11: retract_recover
G11();
break;
#endif // FWRETRACT
#if ENABLED(NOZZLE_CLEAN_FEATURE) #if ENABLED(NOZZLE_CLEAN_FEATURE)
case 12: case 12: G12(); break; // G12: Nozzle Clean
G12(); // G12: Nozzle Clean #endif
break;
#endif // NOZZLE_CLEAN_FEATURE
#if ENABLED(CNC_WORKSPACE_PLANES) #if ENABLED(CNC_WORKSPACE_PLANES)
case 17: // G17: Select Plane XY case 17: G17(); break; // G17: Select Plane XY
G17(); case 18: G18(); break; // G18: Select Plane ZX
break; case 19: G19(); break; // G19: Select Plane YZ
case 18: // G18: Select Plane ZX #endif
G18();
break;
case 19: // G19: Select Plane YZ
G19();
break;
#endif // CNC_WORKSPACE_PLANES
#if ENABLED(INCH_MODE_SUPPORT) #if ENABLED(INCH_MODE_SUPPORT)
case 20: // G20: Inch Mode case 20: G20(); break; // G20: Inch Mode
G20(); case 21: G21(); break; // G21: MM Mode
break; #endif
case 21: // G21: MM Mode
G21();
break;
#endif // INCH_MODE_SUPPORT
#if ENABLED(G26_MESH_VALIDATION) #if ENABLED(G26_MESH_VALIDATION)
case 26: // G26: Mesh Validation Pattern generation case 26: G26(); break; // G26: Mesh Validation Pattern generation
G26(); #endif
break;
#endif // AUTO_BED_LEVELING_UBL
#if ENABLED(NOZZLE_PARK_FEATURE) #if ENABLED(NOZZLE_PARK_FEATURE)
case 27: // G27: Nozzle Park case 27: G27(); break; // G27: Nozzle Park
G27(); #endif
break;
#endif // NOZZLE_PARK_FEATURE
case 28: // G28: Home all axes, one at a time case 28: G28(false); break; // G28: Home all axes, one at a time
G28(false);
break;
#if HAS_LEVELING #if HAS_LEVELING
case 29: // G29 Detailed Z probe, probes the bed at 3 or more points, case 29: G29(); break; // G29: Bed leveling calibration
// or provides access to the UBL System if enabled. #endif
G29();
break;
#endif // HAS_LEVELING
#if HAS_BED_PROBE #if HAS_BED_PROBE
case 30: G30(); break; // G30: Single Z probe
case 30: // G30 Single Z probe
G30();
break;
#if ENABLED(Z_PROBE_SLED) #if ENABLED(Z_PROBE_SLED)
case 31: G31(); break; // G31: dock the sled
case 31: // G31: dock the sled case 32: G32(); break; // G32: undock the sled
G31(); #endif
break; #endif
case 32: // G32: undock the sled
G32();
break;
#endif // Z_PROBE_SLED
#endif // HAS_BED_PROBE
#if ENABLED(DELTA_AUTO_CALIBRATION) #if ENABLED(DELTA_AUTO_CALIBRATION)
case 33: // G33: Delta Auto-Calibration case 33: G33(); break; // G33: Delta Auto-Calibration
G33(); #endif
break;
#endif // DELTA_AUTO_CALIBRATION
#if ENABLED(G38_PROBE_TARGET) #if ENABLED(G38_PROBE_TARGET)
case 38: // G38.2 & G38.3 case 38: // G38.2 & G38.3
if (parser.subcode == 2 || parser.subcode == 3) if (parser.subcode == 2 || parser.subcode == 3)
G38(parser.subcode == 2); G38(parser.subcode == 2);
break; break;
#endif #endif
case 90: // G90 case 90: relative_mode = false; break; // G90: Relative Mode
relative_mode = false; case 91: relative_mode = true; break; // G91: Absolute Mode
break;
case 91: // G91
relative_mode = true;
break;
case 92: // G92 - Set current axis position(s) case 92: G92(); break; // G92: Set current axis position(s)
G92();
break;
#if HAS_MESH #if HAS_MESH
case 42: G42(); break; // G42: Coordinated move to a mesh point case 42: G42(); break; // G42: Coordinated move to a mesh point
#endif #endif
#if ENABLED(DEBUG_GCODE_PARSER) #if ENABLED(DEBUG_GCODE_PARSER)
case 800: case 800: parser.debug(); break; // G800: GCode Parser Test for G
parser.debug(); // GCode Parser Test for G
break;
#endif #endif
} }
break; break;
case 'M': switch (parser.codenum) { case 'M': switch (parser.codenum) {
#if HAS_RESUME_CONTINUE #if HAS_RESUME_CONTINUE
case 0: // M0: Unconditional stop - Wait for user button press on LCD case 0: // M0: Unconditional stop - Wait for user button press on LCD
case 1: // M1: Conditional stop - Wait for user button press on LCD case 1: M0_M1(); break; // M1: Conditional stop - Wait for user button press on LCD
M0_M1(); #endif
break;
#endif // ULTIPANEL
#if ENABLED(SPINDLE_LASER_ENABLE) #if ENABLED(SPINDLE_LASER_ENABLE)
// These synchronize with movement commands... case 3: M3_M4(true ); break; // M3: turn spindle/laser on, set laser/spindle power/speed, set rotation direction CW
case 3: M3_M4(true ); break; // M3: turn spindle/laser on, set laser/spindle power/speed, set rotation direction CW case 4: M3_M4(false); break; // M4: turn spindle/laser on, set laser/spindle power/speed, set rotation direction CCW
case 4: M3_M4(false); break; // M4: turn spindle/laser on, set laser/spindle power/speed, set rotation direction CCW case 5: M5(); break; // M5 - turn spindle/laser off
case 5: M5(); break; // M5 - turn spindle/laser off
#endif #endif
case 17: // M17: Enable all stepper motors case 17: M17(); break; // M17: Enable all stepper motors
M17();
break;
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)
case 20: M20(); break; // M20: list SD card case 20: M20(); break; // M20: list SD card
case 21: M21(); break; // M21: init SD card case 21: M21(); break; // M21: init SD card
case 22: M22(); break; // M22: release SD card case 22: M22(); break; // M22: release SD card
case 23: M23(); break; // M23: Select file case 23: M23(); break; // M23: Select file
case 24: M24(); break; // M24: Start SD print case 24: M24(); break; // M24: Start SD print
case 25: M25(); break; // M25: Pause SD print case 25: M25(); break; // M25: Pause SD print
case 26: M26(); break; // M26: Set SD index case 26: M26(); break; // M26: Set SD index
case 27: M27(); break; // M27: Get SD status case 27: M27(); break; // M27: Get SD status
case 28: M28(); break; // M28: Start SD write case 28: M28(); break; // M28: Start SD write
case 29: M29(); break; // M29: Stop SD write case 29: M29(); break; // M29: Stop SD write
case 30: M30(); break; // M30 <filename> Delete File case 30: M30(); break; // M30 <filename> Delete File
case 32: M32(); break; // M32: Select file and start SD print case 32: M32(); break; // M32: Select file and start SD print
#if ENABLED(LONG_FILENAME_HOST_SUPPORT) #if ENABLED(LONG_FILENAME_HOST_SUPPORT)
case 33: M33(); break; // M33: Get the long full path to a file or folder case 33: M33(); break; // M33: Get the long full path to a file or folder
#endif #endif
#if ENABLED(SDCARD_SORT_ALPHA) && ENABLED(SDSORT_GCODE) #if ENABLED(SDCARD_SORT_ALPHA) && ENABLED(SDSORT_GCODE)
case 34: M34(); break; // M34: Set SD card sorting options case 34: M34(); break; // M34: Set SD card sorting options
#endif #endif
case 928: M928(); break; // M928: Start SD write case 928: M928(); break; // M928: Start SD write
#endif // SDSUPPORT #endif // SDSUPPORT
case 31: M31(); break; // M31: Report time since the start of SD print or last M109 case 31: M31(); break; // M31: Report time since the start of SD print or last M109
case 42: M42(); break; // M42: Change pin state
case 42: M42(); break; // M42: Change pin state
#if ENABLED(PINS_DEBUGGING) #if ENABLED(PINS_DEBUGGING)
case 43: M43(); break; // M43: Read pin state case 43: M43(); break; // M43: Read pin state
#endif #endif
#if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
case 48: M48(); break; // M48: Z probe repeatability test case 48: M48(); break; // M48: Z probe repeatability test
#endif #endif
#if ENABLED(G26_MESH_VALIDATION) #if ENABLED(G26_MESH_VALIDATION)
case 49: M49(); break; // M49: Turn on or off G26 debug flag for verbose output case 49: M49(); break; // M49: Turn on or off G26 debug flag for verbose output
#endif #endif
#if ENABLED(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY) #if ENABLED(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY)
case 73: M73(); break; // M73: Set progress percentage (for display on LCD) case 73: M73(); break; // M73: Set progress percentage (for display on LCD)
#endif #endif
case 75: M75(); break; // M75: Start print timer case 75: M75(); break; // M75: Start print timer
case 76: M76(); break; // M76: Pause print timer case 76: M76(); break; // M76: Pause print timer
case 77: M77(); break; // M77: Stop print timer case 77: M77(); break; // M77: Stop print timer
#if ENABLED(PRINTCOUNTER) #if ENABLED(PRINTCOUNTER)
case 78: M78(); break; // M78: Show print statistics case 78: M78(); break; // M78: Show print statistics
#endif #endif
#if ENABLED(M100_FREE_MEMORY_WATCHER) #if ENABLED(M100_FREE_MEMORY_WATCHER)
case 100: M100(); break; // M100: Free Memory Report case 100: M100(); break; // M100: Free Memory Report
#endif #endif
case 104: M104(); break; // M104: Set hot end temperature case 104: M104(); break; // M104: Set hot end temperature
case 109: M109(); break; // M109: Wait for hotend temperature to reach target case 109: M109(); break; // M109: Wait for hotend temperature to reach target
case 110: M110(); break; // M110: Set Current Line Number
case 110: M110(); break; // M110: Set Current Line Number case 111: M111(); break; // M111: Set debug level
case 111: M111(); break; // M111: Set debug level
#if DISABLED(EMERGENCY_PARSER) #if DISABLED(EMERGENCY_PARSER)
case 108: M108(); break; // M108: Cancel Waiting case 108: M108(); break; // M108: Cancel Waiting
case 112: M112(); break; // M112: Emergency Stop case 112: M112(); break; // M112: Emergency Stop
case 410: M410(); break; // M410: Quickstop - Abort all the planned moves. case 410: M410(); break; // M410: Quickstop - Abort all the planned moves.
#endif #endif
#if ENABLED(HOST_KEEPALIVE_FEATURE) #if ENABLED(HOST_KEEPALIVE_FEATURE)
case 113: M113(); break; // M113: Set Host Keepalive interval case 113: M113(); break; // M113: Set Host Keepalive interval
#endif #endif
#if HAS_HEATER_BED && HAS_TEMP_BED #if HAS_HEATER_BED && HAS_TEMP_BED
case 140: M140(); break; // M140: Set bed temperature case 140: M140(); break; // M140: Set bed temperature
case 190: M190(); break; // M190: Wait for bed temperature to reach target case 190: M190(); break; // M190: Wait for bed temperature to reach target
#endif #endif
case 105: // M105: Report current temperature case 105: M105(); KEEPALIVE_STATE(NOT_BUSY); return; // M105: Report Temperatures (and say "ok")
M105();
KEEPALIVE_STATE(NOT_BUSY);
return; // "ok" already printed
#if ENABLED(AUTO_REPORT_TEMPERATURES) && HAS_TEMP_SENSOR #if ENABLED(AUTO_REPORT_TEMPERATURES) && HAS_TEMP_SENSOR
case 155: M155(); break; // M155: Set temperature auto-report interval case 155: M155(); break; // M155: Set temperature auto-report interval
#endif #endif
#if FAN_COUNT > 0 #if FAN_COUNT > 0
case 106: M106(); break; // M106: Fan On case 106: M106(); break; // M106: Fan On
case 107: M107(); break; // M107: Fan Off case 107: M107(); break; // M107: Fan Off
#endif #endif
#if ENABLED(PARK_HEAD_ON_PAUSE) #if ENABLED(PARK_HEAD_ON_PAUSE)
case 125: M125(); break; // M125: Store current position and move to filament change position case 125: M125(); break; // M125: Store current position and move to filament change position
#endif #endif
#if ENABLED(BARICUDA) #if ENABLED(BARICUDA)
// PWM for HEATER_1_PIN // PWM for HEATER_1_PIN
#if HAS_HEATER_1 #if HAS_HEATER_1
case 126: M126(); break; // M126: valve open case 126: M126(); break; // M126: valve open
case 127: M127(); break; // M127: valve closed case 127: M127(); break; // M127: valve closed
#endif #endif
// PWM for HEATER_2_PIN // PWM for HEATER_2_PIN
#if HAS_HEATER_2 #if HAS_HEATER_2
case 128: M128(); break; // M128: valve open case 128: M128(); break; // M128: valve open
case 129: M129(); break; // M129: valve closed case 129: M129(); break; // M129: valve closed
#endif #endif
#endif // BARICUDA #endif // BARICUDA
#if HAS_POWER_SWITCH #if HAS_POWER_SWITCH
case 80: M80(); break; // M80: Turn on Power Supply case 80: M80(); break; // M80: Turn on Power Supply
#endif #endif
case 81: M81(); break; // M81: Turn off Power, including Power Supply, if possible
case 81: M81(); break; // M81: Turn off Power, including Power Supply, if possible
case 82: M82(); break; // M82: Set E axis normal mode (same as other axes)
case 82: M82(); break; // M82: Set E axis normal mode (same as other axes) case 83: M83(); break; // M83: Set E axis relative mode
case 83: M83(); break; // M83: Set E axis relative mode case 18: case 84: M18_M84(); break; // M18/M84: Disable Steppers / Set Timeout
case 85: M85(); break; // M85: Set inactivity stepper shutdown timeout
case 18: // M18 => M84 case 92: M92(); break; // M92: Set the steps-per-unit for one or more axes
case 84: M18_M84(); break; // M84: Disable all steppers or set timeout case 114: M114(); break; // M114: Report current position
case 85: M85(); break; // M85: Set inactivity stepper shutdown timeout case 115: M115(); break; // M115: Report capabilities
case 117: M117(); break; // M117: Set LCD message text, if possible
case 92: M92(); break; // M92: Set the steps-per-unit for one or more axes case 118: M118(); break; // M118: Display a message in the host console
case 119: M119(); break; // M119: Report endstop states
case 114: M114(); break; // M114: Report current position case 120: M120(); break; // M120: Enable endstops
case 121: M121(); break; // M121: Disable endstops
case 115: M115(); break; // M115: Report capabilities
case 117: M117(); break; // M117: Set LCD message text, if possible
case 118: M118(); break; // M118: Display a message in the host console
case 119: M119(); break; // M119: Report endstop states
case 120: M120(); break; // M120: Enable endstops
case 121: M121(); break; // M121: Disable endstops
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)
case 145: M145(); break; // M145: Set material heatup parameters case 145: M145(); break; // M145: Set material heatup parameters
#endif #endif
#if ENABLED(TEMPERATURE_UNITS_SUPPORT) #if ENABLED(TEMPERATURE_UNITS_SUPPORT)
case 149: M149(); break; // M149: Set temperature units case 149: M149(); break; // M149: Set temperature units
#endif #endif
#if HAS_COLOR_LEDS #if HAS_COLOR_LEDS
case 150: M150(); break; // M150: Set Status LED Color case 150: M150(); break; // M150: Set Status LED Color
#endif #endif
#if ENABLED(MIXING_EXTRUDER) #if ENABLED(MIXING_EXTRUDER)
case 163: M163(); break; // M163: Set a component weight for mixing extruder case 163: M163(); break; // M163: Set a component weight for mixing extruder
#if MIXING_VIRTUAL_TOOLS > 1 #if MIXING_VIRTUAL_TOOLS > 1
case 164: M164(); break; // M164: Save current mix as a virtual extruder case 164: M164(); break; // M164: Save current mix as a virtual extruder
#endif #endif
#if ENABLED(DIRECT_MIXING_IN_G1) #if ENABLED(DIRECT_MIXING_IN_G1)
case 165: M165(); break; // M165: Set multiple mix weights case 165: M165(); break; // M165: Set multiple mix weights
#endif #endif
#endif #endif
#if DISABLED(NO_VOLUMETRICS) #if DISABLED(NO_VOLUMETRICS)
case 200: M200(); break; // M200: Set filament diameter, E to cubic units case 200: M200(); break; // M200: Set filament diameter, E to cubic units
#endif #endif
case 201: M201(); break; // M201: Set max acceleration for print moves (units/s^2) case 201: M201(); break; // M201: Set max acceleration for print moves (units/s^2)
#if 0 #if 0
case 202: M202(); break; // Not used for Sprinter/grbl gen6 case 202: M202(); break; // M202: Not used for Sprinter/grbl gen6
#endif #endif
case 203: M203(); break; // M203: Set max feedrate (units/sec) case 203: M203(); break; // M203: Set max feedrate (units/sec)
case 204: M204(); break; // M204: Set acceleration case 204: M204(); break; // M204: Set acceleration
case 205: M205(); break; // M205: Set advanced settings case 205: M205(); break; // M205: Set advanced settings
#if HAS_M206_COMMAND #if HAS_M206_COMMAND
case 206: M206(); break; // M206: Set home offsets case 206: M206(); break; // M206: Set home offsets
#endif #endif
#if ENABLED(DELTA) #if ENABLED(DELTA)
case 665: M665(); break; // M665: Set delta configurations case 665: M665(); break; // M665: Set delta configurations
#endif #endif
#if ENABLED(DELTA) || ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) #if ENABLED(DELTA) || ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS)
case 666: M666(); break; // M666: Set delta or dual endstop adjustment case 666: M666(); break; // M666: Set delta or dual endstop adjustment
#endif #endif
#if ENABLED(FWRETRACT) #if ENABLED(FWRETRACT)
case 207: M207(); break; // M207: Set Retract Length, Feedrate, and Z lift case 207: M207(); break; // M207: Set Retract Length, Feedrate, and Z lift
case 208: M208(); break; // M208: Set Recover (unretract) Additional Length and Feedrate case 208: M208(); break; // M208: Set Recover (unretract) Additional Length and Feedrate
case 209: if (MIN_AUTORETRACT <= MAX_AUTORETRACT) M209(); break; // M209: Turn Automatic Retract Detection on/off case 209:
if (MIN_AUTORETRACT <= MAX_AUTORETRACT) M209(); // M209: Turn Automatic Retract Detection on/off
break;
#endif #endif
case 211: M211(); break; // M211: Enable, Disable, and/or Report software endstops case 211: M211(); break; // M211: Enable, Disable, and/or Report software endstops
#if HOTENDS > 1 #if HOTENDS > 1
case 218: // M218: Set a tool offset case 218: M218(); break; // M218: Set a tool offset
M218();
break;
#endif #endif
case 220: M220(); break; // M220: Set Feedrate Percentage: S<percent> ("FR" on your LCD) case 220: M220(); break; // M220: Set Feedrate Percentage: S<percent> ("FR" on your LCD)
case 221: M221(); break; // M221: Set Flow Percentage
case 221: // M221: Set Flow Percentage case 226: M226(); break; // M226: Wait until a pin reaches a state
M221();
break;
case 226: M226(); break; // M226: Wait until a pin reaches a state
#if HAS_SERVOS #if HAS_SERVOS
case 280: M280(); break; // M280: Set servo position absolute case 280: M280(); break; // M280: Set servo position absolute
#endif #endif
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
case 290: M290(); break; // M290: Babystepping case 290: M290(); break; // M290: Babystepping
#endif #endif
#if HAS_BUZZER #if HAS_BUZZER
case 300: M300(); break; // M300: Play beep tone case 300: M300(); break; // M300: Play beep tone
#endif #endif
#if ENABLED(PIDTEMP) #if ENABLED(PIDTEMP)
case 301: M301(); break; // M301: Set hotend PID parameters case 301: M301(); break; // M301: Set hotend PID parameters
#endif #endif
#if ENABLED(PIDTEMPBED) #if ENABLED(PIDTEMPBED)
case 304: M304(); break; // M304: Set bed PID parameters case 304: M304(); break; // M304: Set bed PID parameters
#endif #endif
#if defined(CHDK) || HAS_PHOTOGRAPH #if defined(CHDK) || HAS_PHOTOGRAPH
case 240: M240(); break; // M240: Trigger a camera by emulating a Canon RC-1 : http://www.doc-diy.net/photo/rc-1_hacked/ case 240: M240(); break; // M240: Trigger a camera by emulating a Canon RC-1 : http://www.doc-diy.net/photo/rc-1_hacked/
#endif #endif
#if HAS_LCD_CONTRAST #if HAS_LCD_CONTRAST
case 250: M250(); break; // M250: Set LCD contrast case 250: M250(); break; // M250: Set LCD contrast
#endif #endif
#if ENABLED(EXPERIMENTAL_I2CBUS) #if ENABLED(EXPERIMENTAL_I2CBUS)
case 260: M260(); break; // M260: Send data to an i2c slave case 260: M260(); break; // M260: Send data to an i2c slave
case 261: M261(); break; // M261: Request data from an i2c slave case 261: M261(); break; // M261: Request data from an i2c slave
#endif #endif
#if ENABLED(PREVENT_COLD_EXTRUSION) #if ENABLED(PREVENT_COLD_EXTRUSION)
case 302: M302(); break; // M302: Allow cold extrudes (set the minimum extrude temperature) case 302: M302(); break; // M302: Allow cold extrudes (set the minimum extrude temperature)
#endif #endif
case 303: // M303: PID autotune case 303: M303(); break; // M303: PID autotune
M303();
break;
#if ENABLED(MORGAN_SCARA) #if ENABLED(MORGAN_SCARA)
case 360: if (M360()) return; break; // M360: SCARA Theta pos1 case 360: if (M360()) return; break; // M360: SCARA Theta pos1
case 361: if (M361()) return; break; // M361: SCARA Theta pos2 case 361: if (M361()) return; break; // M361: SCARA Theta pos2
case 362: if (M362()) return; break; // M362: SCARA Psi pos1 case 362: if (M362()) return; break; // M362: SCARA Psi pos1
case 363: if (M363()) return; break; // M363: SCARA Psi pos2 case 363: if (M363()) return; break; // M363: SCARA Psi pos2
case 364: if (M364()) return; break; // M364: SCARA Psi pos3 (90 deg to Theta) case 364: if (M364()) return; break; // M364: SCARA Psi pos3 (90 deg to Theta)
#endif #endif
#if ENABLED(EXT_SOLENOID) #if ENABLED(EXT_SOLENOID)
case 380: M380(); break; // M380: Activate solenoid on active extruder case 380: M380(); break; // M380: Activate solenoid on active extruder
case 381: M381(); break; // M381: Disable all solenoids case 381: M381(); break; // M381: Disable all solenoids
#endif #endif
case 400: M400(); break; // M400: Finish all moves case 400: M400(); break; // M400: Finish all moves
#if HAS_BED_PROBE #if HAS_BED_PROBE
case 401: M401(); break; // M401: Deploy probe case 401: M401(); break; // M401: Deploy probe
case 402: M402(); break; // M402: Stow probe case 402: M402(); break; // M402: Stow probe
#endif #endif
#if ENABLED(FILAMENT_WIDTH_SENSOR) #if ENABLED(FILAMENT_WIDTH_SENSOR)
case 404: // M404: Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or display nominal filament width case 404: M404(); break; // M404: Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or display nominal filament width
M404(); case 405: M405(); break; // M405: Turn on filament sensor for control
break; case 406: M406(); break; // M406: Turn off filament sensor for control
case 405: // M405: Turn on filament sensor for control case 407: M407(); break; // M407: Display measured filament diameter
M405(); #endif
break;
case 406: // M406: Turn off filament sensor for control
M406();
break;
case 407: // M407: Display measured filament diameter
M407();
break;
#endif // FILAMENT_WIDTH_SENSOR
#if HAS_LEVELING #if HAS_LEVELING
case 420: // M420: Enable/Disable Bed Leveling case 420: M420(); break; // M420: Enable/Disable Bed Leveling
M420();
break;
#endif #endif
#if HAS_MESH #if HAS_MESH
case 421: // M421: Set a Mesh Bed Leveling Z coordinate case 421: M421(); break; // M421: Set a Mesh Bed Leveling Z coordinate
M421();
break;
#endif #endif
#if HAS_M206_COMMAND #if HAS_M206_COMMAND
case 428: M428(); break; // M428: Apply current_position to home_offset case 428: M428(); break; // M428: Apply current_position to home_offset
#endif #endif
case 500: M500(); break; // M500: Store settings in EEPROM case 500: M500(); break; // M500: Store settings in EEPROM
case 501: M501(); break; // M501: Read settings from EEPROM case 501: M501(); break; // M501: Read settings from EEPROM
case 502: M502(); break; // M502: Revert to default settings case 502: M502(); break; // M502: Revert to default settings
#if DISABLED(DISABLE_M503) #if DISABLED(DISABLE_M503)
case 503: M503(); break; // M503: print settings currently in memory case 503: M503(); break; // M503: print settings currently in memory
#endif #endif
#if ENABLED(EEPROM_SETTINGS) #if ENABLED(EEPROM_SETTINGS)
case 504: M504(); break; // M504: Validate EEPROM contents case 504: M504(); break; // M504: Validate EEPROM contents
#endif #endif
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
case 540: M540(); break; // M540: Set abort on endstop hit for SD printing case 540: M540(); break; // M540: Set abort on endstop hit for SD printing
#endif #endif
#if HAS_BED_PROBE #if HAS_BED_PROBE
case 851: // M851: Set Z Probe Z Offset case 851: M851(); break; // M851: Set Z Probe Z Offset
M851(); #endif
break;
#endif // HAS_BED_PROBE
#if ENABLED(SKEW_CORRECTION_GCODE) #if ENABLED(SKEW_CORRECTION_GCODE)
case 852: // M852: Set Skew factors case 852: M852(); break; // M852: Set Skew factors
M852();
break;
#endif #endif
#if ENABLED(ADVANCED_PAUSE_FEATURE) #if ENABLED(ADVANCED_PAUSE_FEATURE)
case 600: M600(); break; // M600: Pause for Filament Change case 600: M600(); break; // M600: Pause for Filament Change
case 603: M603(); break; // M603: Configure Filament Change case 603: M603(); break; // M603: Configure Filament Change
#endif // ADVANCED_PAUSE_FEATURE #endif
#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
case 605: M605(); break; // M605: Set Dual X Carriage movement mode case 605: M605(); break; // M605: Set Dual X Carriage movement mode
#endif #endif
#if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)
case 701: M701(); break; // M701: Load Filament case 701: M701(); break; // M701: Load Filament
case 702: M702(); break; // M702: Unload Filament case 702: M702(); break; // M702: Unload Filament
#endif #endif
#if ENABLED(LIN_ADVANCE) #if ENABLED(LIN_ADVANCE)
case 900: M900(); break; // M900: Set advance K factor. case 900: M900(); break; // M900: Set advance K factor.
#endif #endif
#if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || ENABLED(DIGIPOT_I2C) || ENABLED(DAC_STEPPER_CURRENT) #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || ENABLED(DIGIPOT_I2C) || ENABLED(DAC_STEPPER_CURRENT)
case 907: M907(); break; // M907: Set digital trimpot motor current using axis codes. case 907: M907(); break; // M907: Set digital trimpot motor current using axis codes.
#if HAS_DIGIPOTSS || ENABLED(DAC_STEPPER_CURRENT) #if HAS_DIGIPOTSS || ENABLED(DAC_STEPPER_CURRENT)
case 908: M908(); break; // M908: Control digital trimpot directly. case 908: M908(); break; // M908: Control digital trimpot directly.
#if ENABLED(DAC_STEPPER_CURRENT) // As with Printrbot RevF #if ENABLED(DAC_STEPPER_CURRENT)
case 909: M909(); break; // M909: Print digipot/DAC current value case 909: M909(); break; // M909: Print digipot/DAC current value
case 910: M910(); break; // M910: Commit digipot/DAC value to external EEPROM case 910: M910(); break; // M910: Commit digipot/DAC value to external EEPROM
#endif #endif
#endif #endif
#endif #endif
@ -664,51 +563,49 @@ void GcodeSuite::process_parsed_command() {
#if ENABLED(TMC_DEBUG) #if ENABLED(TMC_DEBUG)
case 122: M122(); break; case 122: M122(); break;
#endif #endif
case 906: M906(); break; // M906: Set motor current in milliamps using axis codes X, Y, Z, E case 906: M906(); break; // M906: Set motor current in milliamps using axis codes X, Y, Z, E
case 911: M911(); break; // M911: Report TMC2130 prewarn triggered flags case 911: M911(); break; // M911: Report TMC2130 prewarn triggered flags
case 912: M912(); break; // M912: Clear TMC2130 prewarn triggered flags case 912: M912(); break; // M912: Clear TMC2130 prewarn triggered flags
#if ENABLED(HYBRID_THRESHOLD) #if ENABLED(HYBRID_THRESHOLD)
case 913: M913(); break; // M913: Set HYBRID_THRESHOLD speed. case 913: M913(); break; // M913: Set HYBRID_THRESHOLD speed.
#endif #endif
#if ENABLED(SENSORLESS_HOMING) #if ENABLED(SENSORLESS_HOMING)
case 914: M914(); break; // M914: Set SENSORLESS_HOMING sensitivity. case 914: M914(); break; // M914: Set SENSORLESS_HOMING sensitivity.
#endif #endif
#if ENABLED(TMC_Z_CALIBRATION) #if ENABLED(TMC_Z_CALIBRATION)
case 915: M915(); break; // M915: TMC Z axis calibration. case 915: M915(); break; // M915: TMC Z axis calibration.
#endif #endif
#endif #endif
#if HAS_MICROSTEPS #if HAS_MICROSTEPS
case 350: M350(); break; // M350: Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers. case 350: M350(); break; // M350: Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers.
case 351: M351(); break; // M351: Toggle MS1 MS2 pins directly, S# determines MS1 or MS2, X# sets the pin high/low. case 351: M351(); break; // M351: Toggle MS1 MS2 pins directly, S# determines MS1 or MS2, X# sets the pin high/low.
#endif #endif
case 355: M355(); break; // M355: Set case light brightness case 355: M355(); break; // M355: Set case light brightness
#if ENABLED(DEBUG_GCODE_PARSER) #if ENABLED(DEBUG_GCODE_PARSER)
case 800: case 800: parser.debug(); break; // M800: GCode Parser Test for M
parser.debug(); // GCode Parser Test for M
break;
#endif #endif
#if ENABLED(I2C_POSITION_ENCODERS) #if ENABLED(I2C_POSITION_ENCODERS)
case 860: M860(); break; // M860: Report encoder module position case 860: M860(); break; // M860: Report encoder module position
case 861: M861(); break; // M861: Report encoder module status case 861: M861(); break; // M861: Report encoder module status
case 862: M862(); break; // M862: Perform axis test case 862: M862(); break; // M862: Perform axis test
case 863: M863(); break; // M863: Calibrate steps/mm case 863: M863(); break; // M863: Calibrate steps/mm
case 864: M864(); break; // M864: Change module address case 864: M864(); break; // M864: Change module address
case 865: M865(); break; // M865: Check module firmware version case 865: M865(); break; // M865: Check module firmware version
case 866: M866(); break; // M866: Report axis error count case 866: M866(); break; // M866: Report axis error count
case 867: M867(); break; // M867: Toggle error correction case 867: M867(); break; // M867: Toggle error correction
case 868: M868(); break; // M868: Set error correction threshold case 868: M868(); break; // M868: Set error correction threshold
case 869: M869(); break; // M869: Report axis error case 869: M869(); break; // M869: Report axis error
#endif #endif
case 999: M999(); break; // M999: Restart after being Stopped case 999: M999(); break; // M999: Restart after being Stopped
} }
break; break;
case 'T': T(parser.codenum); break; // Tn: Tool Change case 'T': T(parser.codenum); break; // Tn: Tool Change
default: parser.unknown_command_error(); default: parser.unknown_command_error();
} }

Loading…
Cancel
Save