2017-09-06 06:28:31 -05:00
|
|
|
/**
|
|
|
|
* Marlin 3D Printer Firmware
|
2019-06-27 23:57:50 -05:00
|
|
|
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
2017-09-06 06:28:31 -05:00
|
|
|
*
|
|
|
|
* Based on Sprinter and grbl.
|
2019-06-27 23:57:50 -05:00
|
|
|
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
2017-09-06 06:28:31 -05:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
2019-07-04 22:44:12 -05:00
|
|
|
#pragma once
|
2017-09-06 06:28:31 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gcode.h - Temporary container for all gcode handlers
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* -----------------
|
|
|
|
* G-Codes in Marlin
|
|
|
|
* -----------------
|
|
|
|
*
|
|
|
|
* Helpful G-code references:
|
2019-05-28 21:39:55 -05:00
|
|
|
* - http://marlinfw.org/meta/gcode
|
|
|
|
* - https://reprap.org/wiki/G-code
|
|
|
|
* - http://linuxcnc.org/docs/html/gcode.html
|
2017-09-06 06:28:31 -05:00
|
|
|
*
|
|
|
|
* Help to document Marlin's G-codes online:
|
|
|
|
* - https://github.com/MarlinFirmware/MarlinDocumentation
|
|
|
|
*
|
|
|
|
* -----------------
|
|
|
|
*
|
|
|
|
* "G" Codes
|
|
|
|
*
|
|
|
|
* G0 -> G1
|
|
|
|
* G1 - Coordinated Movement X Y Z E
|
|
|
|
* G2 - CW ARC
|
|
|
|
* G3 - CCW ARC
|
|
|
|
* G4 - Dwell S<seconds> or P<milliseconds>
|
|
|
|
* G5 - Cubic B-spline with XYZE destination and IJPQ offsets
|
|
|
|
* G10 - Retract filament according to settings of M207 (Requires FWRETRACT)
|
|
|
|
* G11 - Retract recover filament according to settings of M208 (Requires FWRETRACT)
|
|
|
|
* G12 - Clean tool (Requires NOZZLE_CLEAN_FEATURE)
|
|
|
|
* G17 - Select Plane XY (Requires CNC_WORKSPACE_PLANES)
|
|
|
|
* G18 - Select Plane ZX (Requires CNC_WORKSPACE_PLANES)
|
|
|
|
* G19 - Select Plane YZ (Requires CNC_WORKSPACE_PLANES)
|
|
|
|
* G20 - Set input units to inches (Requires INCH_MODE_SUPPORT)
|
|
|
|
* G21 - Set input units to millimeters (Requires INCH_MODE_SUPPORT)
|
2017-11-23 17:59:43 -06:00
|
|
|
* G26 - Mesh Validation Pattern (Requires G26_MESH_VALIDATION)
|
2017-09-06 06:28:31 -05:00
|
|
|
* G27 - Park Nozzle (Requires NOZZLE_PARK_FEATURE)
|
|
|
|
* G28 - Home one or more axes
|
|
|
|
* G29 - Start or continue the bed leveling probe procedure (Requires bed leveling)
|
|
|
|
* G30 - Single Z probe, probes bed at X Y location (defaults to current XY location)
|
|
|
|
* G31 - Dock sled (Z_PROBE_SLED only)
|
|
|
|
* G32 - Undock sled (Z_PROBE_SLED only)
|
|
|
|
* G33 - Delta Auto-Calibration (Requires DELTA_AUTO_CALIBRATION)
|
2018-10-29 14:01:36 -05:00
|
|
|
* G34 - Z Stepper automatic alignment using probe: I<iterations> T<accuracy> A<amplification> (Requires Z_STEPPER_AUTO_ALIGN)
|
2017-09-06 06:28:31 -05:00
|
|
|
* G38 - Probe in any direction using the Z_MIN_PROBE (Requires G38_PROBE_TARGET)
|
2017-11-22 14:51:42 -06:00
|
|
|
* G42 - Coordinated move to a mesh point (Requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BLINEAR, or AUTO_BED_LEVELING_UBL)
|
2018-10-05 18:19:45 -05:00
|
|
|
* G80 - Cancel current motion mode (Requires GCODE_MOTION_MODES)
|
2017-09-06 06:28:31 -05:00
|
|
|
* G90 - Use Absolute Coordinates
|
|
|
|
* G91 - Use Relative Coordinates
|
|
|
|
* G92 - Set current position to coordinates given
|
|
|
|
*
|
|
|
|
* "M" Codes
|
|
|
|
*
|
|
|
|
* M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
|
|
|
|
* M1 -> M0
|
2019-06-27 23:06:49 -05:00
|
|
|
* M3 - Turn ON Laser | Spindle (clockwise), set Power | Speed. (Requires SPINDLE_FEATURE or LASER_FEATURE)
|
|
|
|
* M4 - Turn ON Laser | Spindle (counter-clockwise), set Power | Speed. (Requires SPINDLE_FEATURE or LASER_FEATURE)
|
|
|
|
* M5 - Turn OFF Laser | Spindle. (Requires SPINDLE_FEATURE or LASER_FEATURE)
|
2019-06-13 18:43:11 -05:00
|
|
|
* M7 - Turn mist coolant ON. (Requires COOLANT_CONTROL)
|
|
|
|
* M8 - Turn flood coolant ON. (Requires COOLANT_CONTROL)
|
|
|
|
* M9 - Turn coolant OFF. (Requires COOLANT_CONTROL)
|
2018-11-12 21:29:46 -06:00
|
|
|
* M12 - Set up closed loop control system. (Requires EXTERNAL_CLOSED_LOOP_CONTROLLER)
|
2019-08-13 23:38:45 -05:00
|
|
|
* M16 - Expected printer check. (Requires EXPECTED_PRINTER_CHECK)
|
2017-09-06 06:28:31 -05:00
|
|
|
* M17 - Enable/Power all stepper motors
|
|
|
|
* M18 - Disable all stepper motors; same as M84
|
|
|
|
* M20 - List SD card. (Requires SDSUPPORT)
|
|
|
|
* M21 - Init SD card. (Requires SDSUPPORT)
|
|
|
|
* M22 - Release SD card. (Requires SDSUPPORT)
|
|
|
|
* M23 - Select SD file: "M23 /path/file.gco". (Requires SDSUPPORT)
|
|
|
|
* M24 - Start/resume SD print. (Requires SDSUPPORT)
|
|
|
|
* M25 - Pause SD print. (Requires SDSUPPORT)
|
|
|
|
* M26 - Set SD position in bytes: "M26 S12345". (Requires SDSUPPORT)
|
2018-03-11 05:57:31 -05:00
|
|
|
* M27 - Report SD print status. (Requires SDSUPPORT)
|
|
|
|
* OR, with 'S<seconds>' set the SD status auto-report interval. (Requires AUTO_REPORT_SD_STATUS)
|
|
|
|
* OR, with 'C' get the current filename.
|
2017-09-06 06:28:31 -05:00
|
|
|
* M28 - Start SD write: "M28 /path/file.gco". (Requires SDSUPPORT)
|
|
|
|
* M29 - Stop SD write. (Requires SDSUPPORT)
|
|
|
|
* M30 - Delete file from SD: "M30 /path/file.gco"
|
|
|
|
* M31 - Report time since last M109 or SD card start to serial.
|
|
|
|
* M32 - Select file and start SD print: "M32 [S<bytepos>] !/path/file.gco#". (Requires SDSUPPORT)
|
|
|
|
* Use P to run other files as sub-programs: "M32 P !filename#"
|
|
|
|
* The '#' is necessary when calling from within sd files, as it stops buffer prereading
|
|
|
|
* M33 - Get the longname version of a path. (Requires LONG_FILENAME_HOST_SUPPORT)
|
|
|
|
* M34 - Set SD Card sorting options. (Requires SDCARD_SORT_ALPHA)
|
|
|
|
* M42 - Change pin status via gcode: M42 P<pin> S<value>. LED pin assumed if P is omitted.
|
|
|
|
* M43 - Display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins
|
2018-03-10 05:30:59 -06:00
|
|
|
* M48 - Measure Z Probe repeatability: M48 P<points> X<pos> Y<pos> V<level> E<engage> L<legs> S<chizoid>. (Requires Z_MIN_PROBE_REPEATABILITY_TEST)
|
2019-05-24 16:30:19 -05:00
|
|
|
* M73 - Set the progress percentage. (Requires LCD_SET_PROGRESS_MANUALLY)
|
2017-09-06 06:28:31 -05:00
|
|
|
* M75 - Start the print job timer.
|
|
|
|
* M76 - Pause the print job timer.
|
|
|
|
* M77 - Stop the print job timer.
|
|
|
|
* M78 - Show statistical information about the print jobs. (Requires PRINTCOUNTER)
|
2019-07-05 01:58:34 -05:00
|
|
|
* M80 - Turn on Power Supply. (Requires PSU_CONTROL)
|
|
|
|
* M81 - Turn off Power Supply. (Requires PSU_CONTROL)
|
2017-09-06 06:28:31 -05:00
|
|
|
* M82 - Set E codes absolute (default).
|
|
|
|
* M83 - Set E codes relative while in Absolute (G90) mode.
|
|
|
|
* M84 - Disable steppers until next move, or use S<seconds> to specify an idle
|
|
|
|
* duration after which steppers should turn off. S0 disables the timeout.
|
|
|
|
* M85 - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
|
2018-10-10 09:45:20 -05:00
|
|
|
* M92 - Set planner.settings.axis_steps_per_mm for one or more axes.
|
2017-09-06 06:28:31 -05:00
|
|
|
* M100 - Watch Free Memory (for debugging) (Requires M100_FREE_MEMORY_WATCHER)
|
|
|
|
* M104 - Set extruder target temp.
|
|
|
|
* M105 - Report current temperatures.
|
2017-10-16 01:41:45 -05:00
|
|
|
* M106 - Set print fan speed.
|
|
|
|
* M107 - Print fan off.
|
2017-09-06 06:28:31 -05:00
|
|
|
* M108 - Break out of heating loops (M109, M190, M303). With no controller, breaks out of M0/M1. (Requires EMERGENCY_PARSER)
|
2019-05-24 16:30:19 -05:00
|
|
|
* M109 - S<temp> Wait for extruder current temp to reach target temp. ** Wait only when heating! **
|
|
|
|
* R<temp> Wait for extruder current temp to reach target temp. ** Wait for heating or cooling. **
|
2017-09-06 06:28:31 -05:00
|
|
|
* If AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
|
|
|
|
* M110 - Set the current line number. (Used by host printing)
|
|
|
|
* M111 - Set debug flags: "M111 S<flagbits>". See flag bits defined in enum.h.
|
|
|
|
* M112 - Emergency stop.
|
|
|
|
* M113 - Get or set the timeout interval for Host Keepalive "busy" messages. (Requires HOST_KEEPALIVE_FEATURE)
|
|
|
|
* M114 - Report current position.
|
|
|
|
* M115 - Report capabilities. (Extended capabilities requires EXTENDED_CAPABILITIES_REPORT)
|
|
|
|
* M117 - Display a message on the controller screen. (Requires an LCD)
|
|
|
|
* M118 - Display a message in the host console.
|
|
|
|
* M119 - Report endstops status.
|
|
|
|
* M120 - Enable endstops detection.
|
|
|
|
* M121 - Disable endstops detection.
|
2019-06-20 15:47:50 -05:00
|
|
|
* M122 - Debug stepper (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660 or L6470)
|
2017-09-06 06:28:31 -05:00
|
|
|
* M125 - Save current position and move to filament change position. (Requires PARK_HEAD_ON_PAUSE)
|
|
|
|
* M126 - Solenoid Air Valve Open. (Requires BARICUDA)
|
|
|
|
* M127 - Solenoid Air Valve Closed. (Requires BARICUDA)
|
|
|
|
* M128 - EtoP Open. (Requires BARICUDA)
|
|
|
|
* M129 - EtoP Closed. (Requires BARICUDA)
|
|
|
|
* M140 - Set bed target temp. S<temp>
|
2019-05-24 16:30:19 -05:00
|
|
|
* M141 - Set heated chamber target temp. S<temp> (Requires a chamber heater)
|
2017-09-06 06:28:31 -05:00
|
|
|
* M145 - Set heatup values for materials on the LCD. H<hotend> B<bed> F<fan speed> for S<material> (0=PLA, 1=ABS)
|
|
|
|
* M149 - Set temperature units. (Requires TEMPERATURE_UNITS_SUPPORT)
|
2019-03-16 23:43:06 -05:00
|
|
|
* M150 - Set Status LED Color as R<red> U<green> B<blue> P<bright>. Values 0-255. (Requires BLINKM, RGB_LED, RGBW_LED, NEOPIXEL_LED, PCA9533, or PCA9632).
|
2017-09-06 06:28:31 -05:00
|
|
|
* M155 - Auto-report temperatures with interval of S<seconds>. (Requires AUTO_REPORT_TEMPERATURES)
|
|
|
|
* M163 - Set a single proportion for a mixing extruder. (Requires MIXING_EXTRUDER)
|
2018-10-16 06:09:02 -05:00
|
|
|
* M164 - Commit the mix and save to a virtual tool (current, or as specified by 'S'). (Requires MIXING_EXTRUDER)
|
|
|
|
* M165 - Set the mix for the mixing extruder (and current virtual tool) with parameters ABCDHI. (Requires MIXING_EXTRUDER and DIRECT_MIXING_IN_G1)
|
2019-02-10 04:54:23 -06:00
|
|
|
* M166 - Set the Gradient Mix for the mixing extruder. (Requires GRADIENT_MIX)
|
2019-05-24 16:30:19 -05:00
|
|
|
* M190 - S<temp> Wait for bed current temp to reach target temp. ** Wait only when heating! **
|
|
|
|
* R<temp> Wait for bed current temp to reach target temp. ** Wait for heating or cooling. **
|
2017-09-06 06:28:31 -05:00
|
|
|
* M200 - Set filament diameter, D<diameter>, setting E axis units to cubic. (Use S0 to revert to linear units.)
|
|
|
|
* M201 - Set max acceleration in units/s^2 for print moves: "M201 X<accel> Y<accel> Z<accel> E<accel>"
|
|
|
|
* M202 - Set max acceleration in units/s^2 for travel moves: "M202 X<accel> Y<accel> Z<accel> E<accel>" ** UNUSED IN MARLIN! **
|
|
|
|
* M203 - Set maximum feedrate: "M203 X<fr> Y<fr> Z<fr> E<fr>" in units/sec.
|
|
|
|
* M204 - Set default acceleration in units/sec^2: P<printing> R<extruder_only> T<travel>
|
|
|
|
* M205 - Set advanced settings. Current units apply:
|
|
|
|
S<print> T<travel> minimum speeds
|
|
|
|
B<minimum segment time>
|
|
|
|
X<max X jerk>, Y<max Y jerk>, Z<max Z jerk>, E<max E jerk>
|
|
|
|
* M206 - Set additional homing offset. (Disabled by NO_WORKSPACE_OFFSETS or DELTA)
|
|
|
|
* M207 - Set Retract Length: S<length>, Feedrate: F<units/min>, and Z lift: Z<distance>. (Requires FWRETRACT)
|
|
|
|
* M208 - Set Recover (unretract) Additional (!) Length: S<length> and Feedrate: F<units/min>. (Requires FWRETRACT)
|
2018-09-28 16:52:56 -05:00
|
|
|
* M209 - Turn Automatic Retract Detection on/off: S<0|1> (For slicers that don't support G10/11). (Requires FWRETRACT_AUTORETRACT)
|
2017-09-06 06:28:31 -05:00
|
|
|
Every normal extrude-only move will be classified as retract depending on the direction.
|
|
|
|
* M211 - Enable, Disable, and/or Report software endstops: S<0|1> (Requires MIN_SOFTWARE_ENDSTOPS or MAX_SOFTWARE_ENDSTOPS)
|
2018-10-07 17:06:14 -05:00
|
|
|
* M217 - Set filament swap parameters: "M217 S<length> P<feedrate> R<feedrate>". (Requires SINGLENOZZLE)
|
2018-03-12 08:14:25 -05:00
|
|
|
* M218 - Set/get a tool offset: "M218 T<index> X<offset> Y<offset>". (Requires 2 or more extruders)
|
2017-09-06 06:28:31 -05:00
|
|
|
* M220 - Set Feedrate Percentage: "M220 S<percent>" (i.e., "FR" on the LCD)
|
|
|
|
* M221 - Set Flow Percentage: "M221 S<percent>"
|
|
|
|
* M226 - Wait until a pin is in a given state: "M226 P<pin> S<state>"
|
2019-02-14 15:09:35 -06:00
|
|
|
* M240 - Trigger a camera to take a photograph. (Requires PHOTO_GCODE)
|
2017-09-06 06:28:31 -05:00
|
|
|
* M250 - Set LCD contrast: "M250 C<contrast>" (0-63). (Requires LCD support)
|
|
|
|
* M260 - i2c Send Data (Requires EXPERIMENTAL_I2CBUS)
|
|
|
|
* M261 - i2c Request Data (Requires EXPERIMENTAL_I2CBUS)
|
|
|
|
* M280 - Set servo position absolute: "M280 P<index> S<angle|µs>". (Requires servos)
|
2018-08-24 21:53:42 -05:00
|
|
|
* M281 - Set servo min|max position: "M281 P<index> L<min> U<max>". (Requires EDITABLE_SERVO_ANGLES)
|
2017-10-25 15:49:34 -05:00
|
|
|
* M290 - Babystepping (Requires BABYSTEPPING)
|
2017-09-06 06:28:31 -05:00
|
|
|
* M300 - Play beep sound S<frequency Hz> P<duration ms>
|
|
|
|
* M301 - Set PID parameters P I and D. (Requires PIDTEMP)
|
|
|
|
* M302 - Allow cold extrudes, or set the minimum extrude S<temperature>. (Requires PREVENT_COLD_EXTRUSION)
|
|
|
|
* M303 - PID relay autotune S<temperature> sets the target temperature. Default 150C. (Requires PIDTEMP)
|
|
|
|
* M304 - Set bed PID parameters P I and D. (Requires PIDTEMPBED)
|
2019-05-06 18:51:06 -05:00
|
|
|
* M305 - Set user thermistor parameters R T and P. (Requires TEMP_SENSOR_x 1000)
|
2017-09-06 06:28:31 -05:00
|
|
|
* M350 - Set microstepping mode. (Requires digital microstepping pins.)
|
|
|
|
* M351 - Toggle MS1 MS2 pins directly. (Requires digital microstepping pins.)
|
|
|
|
* M355 - Set Case Light on/off and set brightness. (Requires CASE_LIGHT_PIN)
|
|
|
|
* M380 - Activate solenoid on active extruder. (Requires EXT_SOLENOID)
|
|
|
|
* M381 - Disable all solenoids. (Requires EXT_SOLENOID)
|
|
|
|
* M400 - Finish all moves.
|
2018-03-01 19:10:36 -06:00
|
|
|
* M401 - Deploy and activate Z probe. (Requires a probe)
|
|
|
|
* M402 - Deactivate and stow Z probe. (Requires a probe)
|
2019-01-31 19:10:52 -06:00
|
|
|
* M403 - Set filament type for PRUSA MMU2
|
2017-09-06 06:28:31 -05:00
|
|
|
* M404 - Display or set the Nominal Filament Width: "W<diameter>". (Requires FILAMENT_WIDTH_SENSOR)
|
|
|
|
* M405 - Enable Filament Sensor flow control. "M405 D<delay_cm>". (Requires FILAMENT_WIDTH_SENSOR)
|
|
|
|
* M406 - Disable Filament Sensor flow control. (Requires FILAMENT_WIDTH_SENSOR)
|
|
|
|
* M407 - Display measured filament diameter in millimeters. (Requires FILAMENT_WIDTH_SENSOR)
|
|
|
|
* M410 - Quickstop. Abort all planned moves.
|
2018-11-16 20:47:07 -06:00
|
|
|
* M412 - Enable / Disable Filament Runout Detection. (Requires FILAMENT_RUNOUT_SENSOR)
|
|
|
|
* M413 - Enable / Disable Power-Loss Recovery. (Requires POWER_LOSS_RECOVERY)
|
2017-09-06 06:28:31 -05:00
|
|
|
* M420 - Enable/Disable Leveling (with current values) S1=enable S0=disable (Requires MESH_BED_LEVELING or ABL)
|
2018-04-28 11:16:52 -05:00
|
|
|
* M421 - Set a single Z coordinate in the Mesh Leveling grid. X<units> Y<units> Z<units> (Requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL)
|
2018-10-29 14:01:36 -05:00
|
|
|
* M422 - Set Z Stepper automatic alignment position using probe. X<units> Y<units> A<axis> (Requires Z_STEPPER_AUTO_ALIGN)
|
2018-12-08 14:36:46 -06:00
|
|
|
* M425 - Enable/Disable and tune backlash correction. (Requires BACKLASH_COMPENSATION and BACKLASH_GCODE)
|
2017-09-06 06:28:31 -05:00
|
|
|
* M428 - Set the home_offset based on the current_position. Nearest edge applies. (Disabled by NO_WORKSPACE_OFFSETS or DELTA)
|
|
|
|
* M500 - Store parameters in EEPROM. (Requires EEPROM_SETTINGS)
|
|
|
|
* M501 - Restore parameters from EEPROM. (Requires EEPROM_SETTINGS)
|
|
|
|
* M502 - Revert to the default "factory settings". ** Does not write them to EEPROM! **
|
|
|
|
* M503 - Print the current settings (in memory): "M503 S<verbose>". S0 specifies compact output.
|
2019-05-24 16:30:19 -05:00
|
|
|
* M504 - Validate EEPROM contents. (Requires EEPROM_SETTINGS)
|
2019-06-18 05:03:42 -05:00
|
|
|
* M524 - Abort the current SD print job started with M24. (Requires SDSUPPORT)
|
2019-06-10 17:25:43 -05:00
|
|
|
* M540 - Enable/disable SD card abort on endstop hit: "M540 S<state>". (Requires SD_ABORT_ON_ENDSTOP_HIT)
|
2019-06-20 15:47:50 -05:00
|
|
|
* M569 - Enable stealthChop on an axis. (Requires at least one _DRIVER_TYPE to be TMC2130/2160/2208/2209/5130/5160)
|
2017-09-06 06:28:31 -05:00
|
|
|
* M600 - Pause for filament change: "M600 X<pos> Y<pos> Z<raise> E<first_retract> L<later_retract>". (Requires ADVANCED_PAUSE_FEATURE)
|
2018-01-04 05:06:34 -06:00
|
|
|
* M603 - Configure filament change: "M603 T<tool> U<unload_length> L<load_length>". (Requires ADVANCED_PAUSE_FEATURE)
|
|
|
|
* M605 - Set Dual X-Carriage movement mode: "M605 S<mode> [X<x_offset>] [R<temp_offset>]". (Requires DUAL_X_CARRIAGE)
|
2018-04-11 21:14:48 -05:00
|
|
|
* M665 - Set delta configurations: "M665 H<delta height> L<diagonal rod> R<delta radius> S<segments/s> B<calibration radius> X<Alpha angle trim> Y<Beta angle trim> Z<Gamma angle trim> (Requires DELTA)
|
2018-03-10 05:55:25 -06:00
|
|
|
* M666 - Set/get offsets for delta (Requires DELTA) or dual endstops (Requires [XYZ]_DUAL_ENDSTOPS).
|
2018-11-09 05:25:08 -06:00
|
|
|
* M701 - Load filament (Requires FILAMENT_LOAD_UNLOAD_GCODES)
|
|
|
|
* M702 - Unload filament (Requires FILAMENT_LOAD_UNLOAD_GCODES)
|
|
|
|
* M810-M819 - Define/execute a G-code macro (Requires GCODE_MACROS)
|
2017-09-06 06:28:31 -05:00
|
|
|
* M851 - Set Z probe's Z offset in current units. (Negative = below the nozzle.)
|
2017-12-01 16:42:23 -06:00
|
|
|
* M852 - Set skew factors: "M852 [I<xy>] [J<xz>] [K<yz>]". (Requires SKEW_CORRECTION_GCODE, and SKEW_CORRECTION_FOR_Z for IJ)
|
2017-09-06 06:28:31 -05:00
|
|
|
* M860 - Report the position of position encoder modules.
|
|
|
|
* M861 - Report the status of position encoder modules.
|
|
|
|
* M862 - Perform an axis continuity test for position encoder modules.
|
|
|
|
* M863 - Perform steps-per-mm calibration for position encoder modules.
|
|
|
|
* M864 - Change position encoder module I2C address.
|
|
|
|
* M865 - Check position encoder module firmware version.
|
|
|
|
* M866 - Report or reset position encoder module error count.
|
|
|
|
* M867 - Enable/disable or toggle error correction for position encoder modules.
|
|
|
|
* M868 - Report or set position encoder module error correction threshold.
|
|
|
|
* M869 - Report position encoder module error.
|
2019-05-24 16:30:19 -05:00
|
|
|
* M876 - Handle Prompt Response. (Requires HOST_PROMPT_SUPPORT and not EMERGENCY_PARSER)
|
2018-03-01 15:11:12 -06:00
|
|
|
* M900 - Get or Set Linear Advance K-factor. (Requires LIN_ADVANCE)
|
2019-06-20 15:47:50 -05:00
|
|
|
* M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660 or L6470)
|
2017-09-06 06:28:31 -05:00
|
|
|
* M907 - Set digital trimpot motor current using axis codes. (Requires a board with digital trimpots)
|
|
|
|
* M908 - Control digital trimpot directly. (Requires DAC_STEPPER_CURRENT or DIGIPOTSS_PIN)
|
|
|
|
* M909 - Print digipot/DAC current value. (Requires DAC_STEPPER_CURRENT)
|
|
|
|
* M910 - Commit digipot/DAC value to external EEPROM via I2C. (Requires DAC_STEPPER_CURRENT)
|
2019-06-20 15:47:50 -05:00
|
|
|
* M911 - Report stepper driver overtemperature pre-warn condition. (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660)
|
|
|
|
* M912 - Clear stepper driver overtemperature pre-warn condition flag. (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660)
|
2017-09-06 06:28:31 -05:00
|
|
|
* M913 - Set HYBRID_THRESHOLD speed. (Requires HYBRID_THRESHOLD)
|
2018-09-09 14:59:12 -05:00
|
|
|
* M914 - Set StallGuard sensitivity. (Requires SENSORLESS_HOMING or SENSORLESS_PROBING)
|
2019-05-24 16:30:19 -05:00
|
|
|
* M916 - L6470 tuning: Increase KVAL_HOLD until thermal warning. (Requires at least one _DRIVER_TYPE L6470)
|
|
|
|
* M917 - L6470 tuning: Find minimum current thresholds. (Requires at least one _DRIVER_TYPE L6470)
|
|
|
|
* M918 - L6470 tuning: Increase speed until max or error. (Requires at least one _DRIVER_TYPE L6470)
|
2019-02-06 06:30:53 -06:00
|
|
|
* M951 - Set Magnetic Parking Extruder parameters. (Requires MAGNETIC_PARKING_EXTRUDER)
|
2019-05-24 16:30:19 -05:00
|
|
|
* M7219 - Control Max7219 Matrix LEDs. (Requires MAX7219_GCODE)
|
2017-09-06 06:28:31 -05:00
|
|
|
*
|
|
|
|
* M360 - SCARA calibration: Move to cal-position ThetaA (0 deg calibration)
|
|
|
|
* M361 - SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree)
|
|
|
|
* M362 - SCARA calibration: Move to cal-position PsiA (0 deg calibration)
|
|
|
|
* M363 - SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree)
|
|
|
|
* M364 - SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position)
|
|
|
|
*
|
|
|
|
* ************ Custom codes - This can change to suit future G-code regulations
|
2019-05-24 16:30:19 -05:00
|
|
|
* G425 - Calibrate using a conductive object. (Requires CALIBRATION_GCODE)
|
2017-09-06 06:28:31 -05:00
|
|
|
* M928 - Start SD logging: "M928 filename.gco". Stop with M29. (Requires SDSUPPORT)
|
2019-03-01 20:11:50 -06:00
|
|
|
* M997 - Perform in-application firmware update
|
2017-09-06 06:28:31 -05:00
|
|
|
* M999 - Restart after being stopped by error
|
|
|
|
*
|
|
|
|
* "T" Codes
|
|
|
|
*
|
|
|
|
* T0-T3 - Select an extruder (tool) by index: "T<n> F<units/min>"
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "../inc/MarlinConfig.h"
|
|
|
|
#include "parser.h"
|
|
|
|
|
|
|
|
#if ENABLED(I2C_POSITION_ENCODERS)
|
|
|
|
#include "../feature/I2CPositionEncoder.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
class GcodeSuite {
|
|
|
|
public:
|
|
|
|
|
|
|
|
GcodeSuite() {}
|
|
|
|
|
2017-09-07 22:33:16 -05:00
|
|
|
static bool axis_relative_modes[];
|
|
|
|
|
2017-09-15 23:08:48 -05:00
|
|
|
#if ENABLED(CNC_WORKSPACE_PLANES)
|
|
|
|
/**
|
|
|
|
* Workspace planes only apply to G2/G3 moves
|
|
|
|
* (and "canned cycles" - not a current feature)
|
|
|
|
*/
|
2018-03-06 22:35:22 -06:00
|
|
|
enum WorkspacePlane : char { PLANE_XY, PLANE_ZX, PLANE_YZ };
|
2017-09-15 23:08:48 -05:00
|
|
|
static WorkspacePlane workspace_plane;
|
|
|
|
#endif
|
|
|
|
|
2018-01-04 19:59:43 -06:00
|
|
|
#define MAX_COORDINATE_SYSTEMS 9
|
2017-11-04 16:36:41 -05:00
|
|
|
#if ENABLED(CNC_COORDINATE_SYSTEMS)
|
|
|
|
static int8_t active_coordinate_system;
|
|
|
|
static float coordinate_system[MAX_COORDINATE_SYSTEMS][XYZ];
|
|
|
|
static bool select_coordinate_system(const int8_t _new);
|
|
|
|
#endif
|
|
|
|
|
2018-03-21 19:30:06 -05:00
|
|
|
static millis_t previous_move_ms;
|
|
|
|
FORCE_INLINE static void reset_stepper_timeout() { previous_move_ms = millis(); }
|
2017-09-07 22:33:16 -05:00
|
|
|
|
2018-11-14 17:33:04 -06:00
|
|
|
static int8_t get_target_extruder_from_command();
|
2019-05-01 21:55:58 -05:00
|
|
|
static int8_t get_target_e_stepper_from_command();
|
2017-09-07 22:33:16 -05:00
|
|
|
static void get_destination_from_command();
|
2018-11-14 17:33:04 -06:00
|
|
|
|
2019-06-18 07:02:18 -05:00
|
|
|
static void process_parsed_command(const bool no_ok=false);
|
2017-09-07 22:33:16 -05:00
|
|
|
static void process_next_command();
|
|
|
|
|
2019-06-19 00:00:19 -05:00
|
|
|
// Execute G-code in-place, preserving current G-code parameters
|
2019-06-18 07:02:18 -05:00
|
|
|
static void process_subcommands_now_P(PGM_P pgcode);
|
|
|
|
static void process_subcommands_now(char * gcode);
|
2018-04-18 16:56:10 -05:00
|
|
|
|
2019-06-18 07:02:18 -05:00
|
|
|
static inline void home_all_axes() { process_subcommands_now_P(PSTR("G28")); }
|
2017-09-08 23:49:49 -05:00
|
|
|
|
|
|
|
#if ENABLED(HOST_KEEPALIVE_FEATURE)
|
|
|
|
/**
|
|
|
|
* States for managing Marlin and host communication
|
|
|
|
* Marlin sends messages if blocked or busy
|
|
|
|
*/
|
2018-03-06 22:35:22 -06:00
|
|
|
enum MarlinBusyState : char {
|
2017-09-08 23:49:49 -05:00
|
|
|
NOT_BUSY, // Not in a handler
|
|
|
|
IN_HANDLER, // Processing a GCode
|
|
|
|
IN_PROCESS, // Known to be blocking command input (as in G29)
|
|
|
|
PAUSED_FOR_USER, // Blocking pending any input
|
|
|
|
PAUSED_FOR_INPUT // Blocking pending text input (concept)
|
|
|
|
};
|
|
|
|
|
|
|
|
static MarlinBusyState busy_state;
|
|
|
|
static uint8_t host_keepalive_interval;
|
|
|
|
|
|
|
|
static void host_keepalive();
|
|
|
|
|
2019-06-29 22:49:50 -05:00
|
|
|
#define KEEPALIVE_STATE(N) REMEMBER(_KA_, gcode.busy_state, gcode.N)
|
2017-09-08 23:49:49 -05:00
|
|
|
#else
|
2019-06-29 22:49:50 -05:00
|
|
|
#define KEEPALIVE_STATE(N) NOOP
|
2017-09-08 23:49:49 -05:00
|
|
|
#endif
|
2017-09-07 22:33:16 -05:00
|
|
|
|
2017-09-15 21:17:34 -05:00
|
|
|
static void dwell(millis_t time);
|
2017-09-15 20:44:40 -05:00
|
|
|
|
2017-09-06 06:28:31 -05:00
|
|
|
private:
|
|
|
|
|
|
|
|
static void G0_G1(
|
2018-10-25 10:35:16 -05:00
|
|
|
#if IS_SCARA || defined(G0_FEEDRATE)
|
2017-09-06 06:28:31 -05:00
|
|
|
bool fast_move=false
|
|
|
|
#endif
|
|
|
|
);
|
|
|
|
|
|
|
|
#if ENABLED(ARC_SUPPORT)
|
2017-09-15 20:57:52 -05:00
|
|
|
static void G2_G3(const bool clockwise);
|
2017-09-06 06:28:31 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
static void G4();
|
|
|
|
|
|
|
|
#if ENABLED(BEZIER_CURVE_SUPPORT)
|
|
|
|
static void G5();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if ENABLED(FWRETRACT)
|
|
|
|
static void G10();
|
|
|
|
static void G11();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if ENABLED(NOZZLE_CLEAN_FEATURE)
|
|
|
|
static void G12();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if ENABLED(CNC_WORKSPACE_PLANES)
|
|
|
|
static void G17();
|
|
|
|
static void G18();
|
|
|
|
static void G19();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if ENABLED(INCH_MODE_SUPPORT)
|
|
|
|
static void G20();
|
|
|
|
static void G21();
|
|
|
|
#endif
|
|
|
|
|
2017-11-23 17:59:43 -06:00
|
|
|
#if ENABLED(G26_MESH_VALIDATION)
|
2017-09-06 06:28:31 -05:00
|
|
|
static void G26();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if ENABLED(NOZZLE_PARK_FEATURE)
|
|
|
|
static void G27();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static void G28(const bool always_home_all);
|
|
|
|
|
|
|
|
#if HAS_LEVELING
|
2018-04-18 16:56:10 -05:00
|
|
|
#if ENABLED(G29_RETRY_AND_RECOVER)
|
|
|
|
static void G29_with_retry();
|
2018-06-29 20:48:11 -05:00
|
|
|
#define G29_TYPE bool
|
|
|
|
#else
|
|
|
|
#define G29_TYPE void
|
2018-04-18 16:56:10 -05:00
|
|
|
#endif
|
2018-06-29 20:48:11 -05:00
|
|
|
static G29_TYPE G29();
|
2017-09-06 06:28:31 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if HAS_BED_PROBE
|
|
|
|
static void G30();
|
|
|
|
#if ENABLED(Z_PROBE_SLED)
|
|
|
|
static void G31();
|
|
|
|
static void G32();
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2017-11-07 19:34:34 -06:00
|
|
|
#if ENABLED(DELTA_AUTO_CALIBRATION)
|
2017-09-06 06:28:31 -05:00
|
|
|
static void G33();
|
|
|
|
#endif
|
|
|
|
|
2018-10-29 14:01:36 -05:00
|
|
|
#if ENABLED(Z_STEPPER_AUTO_ALIGN)
|
|
|
|
static void G34();
|
|
|
|
static void M422();
|
|
|
|
#endif
|
|
|
|
|
2017-09-06 06:28:31 -05:00
|
|
|
#if ENABLED(G38_PROBE_TARGET)
|
2019-03-10 17:22:09 -05:00
|
|
|
static void G38(const int8_t subcode);
|
2017-09-06 06:28:31 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if HAS_MESH
|
|
|
|
static void G42();
|
|
|
|
#endif
|
|
|
|
|
2017-11-04 16:36:41 -05:00
|
|
|
#if ENABLED(CNC_COORDINATE_SYSTEMS)
|
|
|
|
static void G53();
|
|
|
|
static void G54();
|
|
|
|
static void G55();
|
|
|
|
static void G56();
|
|
|
|
static void G57();
|
|
|
|
static void G58();
|
|
|
|
static void G59();
|
|
|
|
#endif
|
|
|
|
|
2018-10-05 18:19:45 -05:00
|
|
|
#if ENABLED(GCODE_MOTION_MODES)
|
|
|
|
static void G80();
|
|
|
|
#endif
|
|
|
|
|
2017-09-06 06:28:31 -05:00
|
|
|
static void G92();
|
|
|
|
|
2019-02-06 17:20:17 -06:00
|
|
|
#if ENABLED(CALIBRATION_GCODE)
|
|
|
|
static void G425();
|
|
|
|
#endif
|
|
|
|
|
2017-09-06 06:28:31 -05:00
|
|
|
#if HAS_RESUME_CONTINUE
|
|
|
|
static void M0_M1();
|
|
|
|
#endif
|
|
|
|
|
2019-06-27 23:06:49 -05:00
|
|
|
#if HAS_CUTTER
|
2019-01-20 23:41:47 -06:00
|
|
|
static void M3_M4(const bool is_M4);
|
2017-09-06 06:28:31 -05:00
|
|
|
static void M5();
|
|
|
|
#endif
|
|
|
|
|
2019-06-13 18:43:11 -05:00
|
|
|
#if ENABLED(COOLANT_CONTROL)
|
|
|
|
#if ENABLED(COOLANT_MIST)
|
|
|
|
static void M7();
|
|
|
|
#endif
|
|
|
|
#if ENABLED(COOLANT_FLOOD)
|
|
|
|
static void M8();
|
|
|
|
#endif
|
|
|
|
static void M9();
|
|
|
|
#endif
|
|
|
|
|
2018-09-08 12:08:31 -05:00
|
|
|
#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER)
|
|
|
|
static void M12();
|
|
|
|
#endif
|
|
|
|
|
2019-08-13 23:38:45 -05:00
|
|
|
#if ENABLED(EXPECTED_PRINTER_CHECK)
|
|
|
|
static void M16();
|
|
|
|
#endif
|
|
|
|
|
2017-09-06 06:28:31 -05:00
|
|
|
static void M17();
|
|
|
|
|
|
|
|
static void M18_M84();
|
|
|
|
|
|
|
|
#if ENABLED(SDSUPPORT)
|
|
|
|
static void M20();
|
|
|
|
static void M21();
|
|
|
|
static void M22();
|
|
|
|
static void M23();
|
|
|
|
static void M24();
|
|
|
|
static void M25();
|
|
|
|
static void M26();
|
|
|
|
static void M27();
|
|
|
|
static void M28();
|
|
|
|
static void M29();
|
|
|
|
static void M30();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static void M31();
|
|
|
|
|
|
|
|
#if ENABLED(SDSUPPORT)
|
|
|
|
static void M32();
|
|
|
|
#if ENABLED(LONG_FILENAME_HOST_SUPPORT)
|
|
|
|
static void M33();
|
|
|
|
#endif
|
2019-03-16 23:43:06 -05:00
|
|
|
#if BOTH(SDCARD_SORT_ALPHA, SDSORT_GCODE)
|
2017-09-06 06:28:31 -05:00
|
|
|
static void M34();
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static void M42();
|
|
|
|
|
|
|
|
#if ENABLED(PINS_DEBUGGING)
|
|
|
|
static void M43();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
|
|
|
|
static void M48();
|
|
|
|
#endif
|
|
|
|
|
2019-01-05 14:02:45 -06:00
|
|
|
#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
2017-10-15 02:15:19 -05:00
|
|
|
static void M73();
|
|
|
|
#endif
|
|
|
|
|
2017-09-06 06:28:31 -05:00
|
|
|
static void M75();
|
|
|
|
static void M76();
|
|
|
|
static void M77();
|
|
|
|
|
|
|
|
#if ENABLED(PRINTCOUNTER)
|
|
|
|
static void M78();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if HAS_POWER_SWITCH
|
|
|
|
static void M80();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static void M81();
|
|
|
|
static void M82();
|
|
|
|
static void M83();
|
|
|
|
static void M85();
|
|
|
|
static void M92();
|
|
|
|
|
|
|
|
#if ENABLED(M100_FREE_MEMORY_WATCHER)
|
|
|
|
static void M100();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static void M104();
|
|
|
|
static void M105();
|
|
|
|
static void M106();
|
|
|
|
static void M107();
|
|
|
|
|
|
|
|
#if DISABLED(EMERGENCY_PARSER)
|
|
|
|
static void M108();
|
2017-09-16 13:24:32 -05:00
|
|
|
static void M112();
|
|
|
|
static void M410();
|
2019-02-12 15:55:47 -06:00
|
|
|
#if ENABLED(HOST_PROMPT_SUPPORT)
|
|
|
|
static void M876();
|
|
|
|
#endif
|
2017-09-06 06:28:31 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
static void M109();
|
|
|
|
|
|
|
|
static void M110();
|
|
|
|
static void M111();
|
|
|
|
|
|
|
|
#if ENABLED(HOST_KEEPALIVE_FEATURE)
|
|
|
|
static void M113();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static void M114();
|
|
|
|
static void M115();
|
|
|
|
static void M117();
|
|
|
|
static void M118();
|
|
|
|
static void M119();
|
|
|
|
static void M120();
|
|
|
|
static void M121();
|
|
|
|
|
|
|
|
#if ENABLED(PARK_HEAD_ON_PAUSE)
|
|
|
|
static void M125();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if ENABLED(BARICUDA)
|
|
|
|
#if HAS_HEATER_1
|
|
|
|
static void M126();
|
|
|
|
static void M127();
|
|
|
|
#endif
|
|
|
|
#if HAS_HEATER_2
|
|
|
|
static void M128();
|
|
|
|
static void M129();
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2018-04-23 17:13:01 -05:00
|
|
|
#if HAS_HEATED_BED
|
2017-09-06 06:28:31 -05:00
|
|
|
static void M140();
|
2017-09-16 22:13:32 -05:00
|
|
|
static void M190();
|
2017-09-06 06:28:31 -05:00
|
|
|
#endif
|
|
|
|
|
2019-03-07 02:09:39 -06:00
|
|
|
#if HAS_HEATED_CHAMBER
|
|
|
|
static void M141();
|
|
|
|
//static void M191();
|
|
|
|
#endif
|
|
|
|
|
2018-10-30 16:34:45 -05:00
|
|
|
#if HAS_LCD_MENU
|
2017-09-06 06:28:31 -05:00
|
|
|
static void M145();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if ENABLED(TEMPERATURE_UNITS_SUPPORT)
|
|
|
|
static void M149();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if HAS_COLOR_LEDS
|
|
|
|
static void M150();
|
|
|
|
#endif
|
|
|
|
|
2018-03-07 01:53:50 -06:00
|
|
|
#if ENABLED(AUTO_REPORT_TEMPERATURES) && HAS_TEMP_SENSOR
|
2017-09-06 06:28:31 -05:00
|
|
|
static void M155();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if ENABLED(MIXING_EXTRUDER)
|
|
|
|
static void M163();
|
2018-10-16 03:38:57 -05:00
|
|
|
static void M164();
|
2017-09-06 06:28:31 -05:00
|
|
|
#if ENABLED(DIRECT_MIXING_IN_G1)
|
|
|
|
static void M165();
|
|
|
|
#endif
|
2019-02-10 04:54:23 -06:00
|
|
|
#if ENABLED(GRADIENT_MIX)
|
|
|
|
static void M166();
|
|
|
|
#endif
|
2017-09-06 06:28:31 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
static void M200();
|
|
|
|
static void M201();
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
static void M202(); // Not used for Sprinter/grbl gen6
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static void M203();
|
|
|
|
static void M204();
|
|
|
|
static void M205();
|
|
|
|
|
|
|
|
#if HAS_M206_COMMAND
|
|
|
|
static void M206();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if ENABLED(FWRETRACT)
|
|
|
|
static void M207();
|
|
|
|
static void M208();
|
2018-09-28 16:52:56 -05:00
|
|
|
#if ENABLED(FWRETRACT_AUTORETRACT)
|
|
|
|
static void M209();
|
|
|
|
#endif
|
2017-09-06 06:28:31 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
static void M211();
|
|
|
|
|
2018-10-17 11:11:41 -05:00
|
|
|
#if EXTRUDERS > 1
|
2018-10-07 17:06:14 -05:00
|
|
|
static void M217();
|
|
|
|
#endif
|
|
|
|
|
2019-03-11 20:48:49 -05:00
|
|
|
#if HAS_HOTEND_OFFSET
|
2017-09-06 06:28:31 -05:00
|
|
|
static void M218();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static void M220();
|
|
|
|
static void M221();
|
|
|
|
static void M226();
|
|
|
|
|
2019-02-14 15:09:35 -06:00
|
|
|
#if ENABLED(PHOTO_GCODE)
|
2017-09-06 06:28:31 -05:00
|
|
|
static void M240();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if HAS_LCD_CONTRAST
|
|
|
|
static void M250();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if ENABLED(EXPERIMENTAL_I2CBUS)
|
|
|
|
static void M260();
|
|
|
|
static void M261();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if HAS_SERVOS
|
|
|
|
static void M280();
|
2018-08-24 21:53:42 -05:00
|
|
|
#if ENABLED(EDITABLE_SERVO_ANGLES)
|
|
|
|
static void M281();
|
|
|
|
#endif
|
2017-10-25 15:49:34 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if ENABLED(BABYSTEPPING)
|
|
|
|
static void M290();
|
2017-09-06 06:28:31 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if HAS_BUZZER
|
|
|
|
static void M300();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if ENABLED(PIDTEMP)
|
|
|
|
static void M301();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if ENABLED(PREVENT_COLD_EXTRUSION)
|
|
|
|
static void M302();
|
|
|
|
#endif
|
|
|
|
|
2018-11-14 17:33:04 -06:00
|
|
|
#if HAS_PID_HEATING
|
|
|
|
static void M303();
|
|
|
|
#endif
|
2017-09-06 06:28:31 -05:00
|
|
|
|
|
|
|
#if ENABLED(PIDTEMPBED)
|
|
|
|
static void M304();
|
|
|
|
#endif
|
|
|
|
|
2019-05-06 18:51:06 -05:00
|
|
|
#if HAS_USER_THERMISTORS
|
|
|
|
static void M305();
|
|
|
|
#endif
|
|
|
|
|
2017-09-06 06:28:31 -05:00
|
|
|
#if HAS_MICROSTEPS
|
|
|
|
static void M350();
|
|
|
|
static void M351();
|
|
|
|
#endif
|
|
|
|
|
2019-01-14 20:56:30 -06:00
|
|
|
#if HAS_CASE_LIGHT
|
|
|
|
static void M355();
|
|
|
|
#endif
|
2017-09-06 06:28:31 -05:00
|
|
|
|
|
|
|
#if ENABLED(MORGAN_SCARA)
|
|
|
|
static bool M360();
|
|
|
|
static bool M361();
|
|
|
|
static bool M362();
|
|
|
|
static bool M363();
|
|
|
|
static bool M364();
|
|
|
|
#endif
|
|
|
|
|
2019-03-16 23:43:06 -05:00
|
|
|
#if EITHER(EXT_SOLENOID, MANUAL_SOLENOID_CONTROL)
|
2017-09-06 06:28:31 -05:00
|
|
|
static void M380();
|
|
|
|
static void M381();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static void M400();
|
|
|
|
|
|
|
|
#if HAS_BED_PROBE
|
|
|
|
static void M401();
|
|
|
|
static void M402();
|
|
|
|
#endif
|
|
|
|
|
2019-01-31 19:10:52 -06:00
|
|
|
#if ENABLED(PRUSA_MMU2)
|
|
|
|
static void M403();
|
|
|
|
#endif
|
|
|
|
|
2017-09-06 06:28:31 -05:00
|
|
|
#if ENABLED(FILAMENT_WIDTH_SENSOR)
|
|
|
|
static void M404();
|
|
|
|
static void M405();
|
|
|
|
static void M406();
|
|
|
|
static void M407();
|
|
|
|
#endif
|
|
|
|
|
2019-02-12 20:08:34 -06:00
|
|
|
#if HAS_FILAMENT_SENSOR
|
2018-11-12 21:29:46 -06:00
|
|
|
static void M412();
|
|
|
|
#endif
|
|
|
|
|
2017-09-06 06:28:31 -05:00
|
|
|
#if HAS_LEVELING
|
|
|
|
static void M420();
|
|
|
|
static void M421();
|
|
|
|
#endif
|
|
|
|
|
2018-12-08 14:36:46 -06:00
|
|
|
#if ENABLED(BACKLASH_GCODE)
|
|
|
|
static void M425();
|
|
|
|
#endif
|
|
|
|
|
2017-09-06 06:28:31 -05:00
|
|
|
#if HAS_M206_COMMAND
|
|
|
|
static void M428();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static void M500();
|
|
|
|
static void M501();
|
|
|
|
static void M502();
|
|
|
|
#if DISABLED(DISABLE_M503)
|
|
|
|
static void M503();
|
|
|
|
#endif
|
2018-01-04 19:51:18 -06:00
|
|
|
#if ENABLED(EEPROM_SETTINGS)
|
|
|
|
static void M504();
|
|
|
|
#endif
|
2017-09-06 06:28:31 -05:00
|
|
|
|
2018-10-19 14:25:07 -05:00
|
|
|
#if ENABLED(SDSUPPORT)
|
|
|
|
static void M524();
|
|
|
|
#endif
|
2018-10-19 15:27:07 -05:00
|
|
|
|
2019-06-10 17:25:43 -05:00
|
|
|
#if ENABLED(SD_ABORT_ON_ENDSTOP_HIT)
|
2017-09-06 06:28:31 -05:00
|
|
|
static void M540();
|
|
|
|
#endif
|
|
|
|
|
2019-07-30 02:30:00 -05:00
|
|
|
#if ENABLED(BAUD_RATE_GCODE)
|
|
|
|
static void M575();
|
|
|
|
#endif
|
|
|
|
|
2017-09-06 06:28:31 -05:00
|
|
|
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
|
|
|
static void M600();
|
2018-01-04 05:06:34 -06:00
|
|
|
static void M603();
|
2017-09-06 06:28:31 -05:00
|
|
|
#endif
|
|
|
|
|
2019-03-13 00:42:50 -05:00
|
|
|
#if HAS_DUPLICATION_MODE
|
2017-09-06 06:28:31 -05:00
|
|
|
static void M605();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if IS_KINEMATIC
|
|
|
|
static void M665();
|
|
|
|
#endif
|
|
|
|
|
2019-02-06 04:59:22 -06:00
|
|
|
#if ENABLED(DELTA) || HAS_EXTRA_ENDSTOPS
|
2017-09-06 06:28:31 -05:00
|
|
|
static void M666();
|
|
|
|
#endif
|
|
|
|
|
2018-01-04 05:06:34 -06:00
|
|
|
#if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)
|
|
|
|
static void M701();
|
2017-09-06 06:28:31 -05:00
|
|
|
static void M702();
|
|
|
|
#endif
|
|
|
|
|
2018-11-09 05:25:08 -06:00
|
|
|
#if ENABLED(GCODE_MACROS)
|
|
|
|
static void M810_819();
|
|
|
|
#endif
|
|
|
|
|
2017-09-06 06:28:31 -05:00
|
|
|
#if HAS_BED_PROBE
|
|
|
|
static void M851();
|
|
|
|
#endif
|
|
|
|
|
2017-12-01 16:42:23 -06:00
|
|
|
#if ENABLED(SKEW_CORRECTION_GCODE)
|
|
|
|
static void M852();
|
|
|
|
#endif
|
|
|
|
|
2017-09-06 06:28:31 -05:00
|
|
|
#if ENABLED(I2C_POSITION_ENCODERS)
|
|
|
|
FORCE_INLINE static void M860() { I2CPEM.M860(); }
|
|
|
|
FORCE_INLINE static void M861() { I2CPEM.M861(); }
|
|
|
|
FORCE_INLINE static void M862() { I2CPEM.M862(); }
|
|
|
|
FORCE_INLINE static void M863() { I2CPEM.M863(); }
|
|
|
|
FORCE_INLINE static void M864() { I2CPEM.M864(); }
|
|
|
|
FORCE_INLINE static void M865() { I2CPEM.M865(); }
|
|
|
|
FORCE_INLINE static void M866() { I2CPEM.M866(); }
|
|
|
|
FORCE_INLINE static void M867() { I2CPEM.M867(); }
|
|
|
|
FORCE_INLINE static void M868() { I2CPEM.M868(); }
|
|
|
|
FORCE_INLINE static void M869() { I2CPEM.M869(); }
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if ENABLED(LIN_ADVANCE)
|
|
|
|
static void M900();
|
|
|
|
#endif
|
|
|
|
|
2017-12-15 15:03:14 -06:00
|
|
|
#if HAS_TRINAMIC
|
2018-12-09 20:54:48 -06:00
|
|
|
static void M122();
|
2017-09-06 06:28:31 -05:00
|
|
|
static void M906();
|
2019-01-17 13:17:16 -06:00
|
|
|
#if HAS_STEALTHCHOP
|
|
|
|
static void M569();
|
|
|
|
#endif
|
2018-10-03 02:48:49 -05:00
|
|
|
#if ENABLED(MONITOR_DRIVER_STATUS)
|
2018-10-03 02:55:10 -05:00
|
|
|
static void M911();
|
|
|
|
static void M912();
|
2018-10-03 02:48:49 -05:00
|
|
|
#endif
|
2017-09-06 06:28:31 -05:00
|
|
|
#if ENABLED(HYBRID_THRESHOLD)
|
|
|
|
static void M913();
|
|
|
|
#endif
|
2018-09-09 14:59:12 -05:00
|
|
|
#if USE_SENSORLESS
|
2017-09-06 06:28:31 -05:00
|
|
|
static void M914();
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2019-01-23 19:06:54 -06:00
|
|
|
#if HAS_DRIVER(L6470)
|
|
|
|
static void M122();
|
|
|
|
static void M906();
|
|
|
|
static void M916();
|
|
|
|
static void M917();
|
|
|
|
static void M918();
|
|
|
|
#endif
|
|
|
|
|
2019-03-16 23:43:06 -05:00
|
|
|
#if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || EITHER(DIGIPOT_I2C, DAC_STEPPER_CURRENT)
|
2017-09-23 18:09:14 -05:00
|
|
|
static void M907();
|
|
|
|
#if HAS_DIGIPOTSS || ENABLED(DAC_STEPPER_CURRENT)
|
|
|
|
static void M908();
|
|
|
|
#if ENABLED(DAC_STEPPER_CURRENT)
|
|
|
|
static void M909();
|
|
|
|
static void M910();
|
|
|
|
#endif
|
2017-09-06 06:28:31 -05:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if ENABLED(SDSUPPORT)
|
|
|
|
static void M928();
|
|
|
|
#endif
|
|
|
|
|
2019-02-06 06:30:53 -06:00
|
|
|
#if ENABLED(MAGNETIC_PARKING_EXTRUDER)
|
|
|
|
static void M951();
|
|
|
|
#endif
|
|
|
|
|
2019-03-01 20:11:50 -06:00
|
|
|
#if ENABLED(PLATFORM_M997_SUPPORT)
|
|
|
|
static void M997();
|
|
|
|
#endif
|
|
|
|
|
2017-09-06 06:28:31 -05:00
|
|
|
static void M999();
|
|
|
|
|
2018-11-16 20:47:07 -06:00
|
|
|
#if ENABLED(POWER_LOSS_RECOVERY)
|
|
|
|
static void M413();
|
|
|
|
static void M1000();
|
|
|
|
#endif
|
|
|
|
|
2019-05-24 16:30:19 -05:00
|
|
|
#if ENABLED(MAX7219_GCODE)
|
|
|
|
static void M7219();
|
|
|
|
#endif
|
|
|
|
|
2018-11-14 17:33:04 -06:00
|
|
|
static void T(const uint8_t tool_index);
|
2017-09-06 06:28:31 -05:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
extern GcodeSuite gcode;
|