My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

gcode.h 40KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #pragma once
  23. /**
  24. * -----------------
  25. * G-Codes in Marlin
  26. * -----------------
  27. *
  28. * Helpful G-code references:
  29. * - https://marlinfw.org/meta/gcode
  30. * - https://reprap.org/wiki/G-code
  31. * - https://linuxcnc.org/docs/html/gcode.html
  32. *
  33. * Help to document Marlin's G-codes online:
  34. * - https://github.com/MarlinFirmware/MarlinDocumentation
  35. *
  36. * -----------------
  37. *
  38. * "G" Codes
  39. *
  40. * G0 -> G1
  41. * G1 - Coordinated Movement X Y Z E
  42. * G2 - CW ARC
  43. * G3 - CCW ARC
  44. * G4 - Dwell S<seconds> or P<milliseconds>
  45. * G5 - Cubic B-spline with XYZE destination and IJPQ offsets
  46. * G10 - Retract filament according to settings of M207 (Requires FWRETRACT)
  47. * G11 - Retract recover filament according to settings of M208 (Requires FWRETRACT)
  48. * G12 - Clean tool (Requires NOZZLE_CLEAN_FEATURE)
  49. * G17 - Select Plane XY (Requires CNC_WORKSPACE_PLANES)
  50. * G18 - Select Plane ZX (Requires CNC_WORKSPACE_PLANES)
  51. * G19 - Select Plane YZ (Requires CNC_WORKSPACE_PLANES)
  52. * G20 - Set input units to inches (Requires INCH_MODE_SUPPORT)
  53. * G21 - Set input units to millimeters (Requires INCH_MODE_SUPPORT)
  54. * G26 - Mesh Validation Pattern (Requires G26_MESH_VALIDATION)
  55. * G27 - Park Nozzle (Requires NOZZLE_PARK_FEATURE)
  56. * G28 - Home one or more axes
  57. * G29 - Start or continue the bed leveling probe procedure (Requires bed leveling)
  58. * G30 - Single Z probe, probes bed at X Y location (defaults to current XY location)
  59. * G31 - Dock sled (Z_PROBE_SLED only)
  60. * G32 - Undock sled (Z_PROBE_SLED only)
  61. * G33 - Delta Auto-Calibration (Requires DELTA_AUTO_CALIBRATION)
  62. * G34 - Z Stepper automatic alignment using probe: I<iterations> T<accuracy> A<amplification> (Requires Z_STEPPER_AUTO_ALIGN)
  63. * G35 - Read bed corners to help adjust bed screws: T<screw_thread> (Requires ASSISTED_TRAMMING)
  64. * G38 - Probe in any direction using the Z_MIN_PROBE (Requires G38_PROBE_TARGET)
  65. * G42 - Coordinated move to a mesh point (Requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BLINEAR, or AUTO_BED_LEVELING_UBL)
  66. * G60 - Save current position. (Requires SAVED_POSITIONS)
  67. * G61 - Apply/restore saved coordinates. (Requires SAVED_POSITIONS)
  68. * G76 - Calibrate first layer temperature offsets. (Requires PROBE_TEMP_COMPENSATION)
  69. * G80 - Cancel current motion mode (Requires GCODE_MOTION_MODES)
  70. * G90 - Use Absolute Coordinates
  71. * G91 - Use Relative Coordinates
  72. * G92 - Set current position to coordinates given
  73. *
  74. * "M" Codes
  75. *
  76. * M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
  77. * M1 -> M0
  78. * M3 - Turn ON Laser | Spindle (clockwise), set Power | Speed. (Requires SPINDLE_FEATURE or LASER_FEATURE)
  79. * M4 - Turn ON Laser | Spindle (counter-clockwise), set Power | Speed. (Requires SPINDLE_FEATURE or LASER_FEATURE)
  80. * M5 - Turn OFF Laser | Spindle. (Requires SPINDLE_FEATURE or LASER_FEATURE)
  81. * M7 - Turn mist coolant ON. (Requires COOLANT_CONTROL)
  82. * M8 - Turn flood coolant ON. (Requires COOLANT_CONTROL)
  83. * M9 - Turn coolant OFF. (Requires COOLANT_CONTROL)
  84. * M10 - Turn Vacuum or Blower motor ON (Requires AIR_EVACUATION)
  85. * M11 - Turn Vacuum or Blower motor OFF (Requires AIR_EVACUATION)
  86. * M12 - Set up closed loop control system. (Requires EXTERNAL_CLOSED_LOOP_CONTROLLER)
  87. * M16 - Expected printer check. (Requires EXPECTED_PRINTER_CHECK)
  88. * M17 - Enable/Power all stepper motors
  89. * M18 - Disable all stepper motors; same as M84
  90. * M20 - List SD card. (Requires SDSUPPORT)
  91. * M21 - Init SD card. (Requires SDSUPPORT)
  92. * M22 - Release SD card. (Requires SDSUPPORT)
  93. * M23 - Select SD file: "M23 /path/file.gco". (Requires SDSUPPORT)
  94. * M24 - Start/resume SD print. (Requires SDSUPPORT)
  95. * M25 - Pause SD print. (Requires SDSUPPORT)
  96. * M26 - Set SD position in bytes: "M26 S12345". (Requires SDSUPPORT)
  97. * M27 - Report SD print status. (Requires SDSUPPORT)
  98. * OR, with 'S<seconds>' set the SD status auto-report interval. (Requires AUTO_REPORT_SD_STATUS)
  99. * OR, with 'C' get the current filename.
  100. * M28 - Start SD write: "M28 /path/file.gco". (Requires SDSUPPORT)
  101. * M29 - Stop SD write. (Requires SDSUPPORT)
  102. * M30 - Delete file from SD: "M30 /path/file.gco"
  103. * M31 - Report time since last M109 or SD card start to serial.
  104. * M32 - Select file and start SD print: "M32 [S<bytepos>] !/path/file.gco#". (Requires SDSUPPORT)
  105. * Use P to run other files as sub-programs: "M32 P !filename#"
  106. * The '#' is necessary when calling from within sd files, as it stops buffer prereading
  107. * M33 - Get the longname version of a path. (Requires LONG_FILENAME_HOST_SUPPORT)
  108. * M34 - Set SD Card sorting options. (Requires SDCARD_SORT_ALPHA)
  109. * M42 - Change pin status via gcode: M42 P<pin> S<value>. LED pin assumed if P is omitted. (Requires DIRECT_PIN_CONTROL)
  110. * M43 - Display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins
  111. * 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)
  112. * M73 - Set the progress percentage. (Requires LCD_SET_PROGRESS_MANUALLY)
  113. * M75 - Start the print job timer.
  114. * M76 - Pause the print job timer.
  115. * M77 - Stop the print job timer.
  116. * M78 - Show statistical information about the print jobs. (Requires PRINTCOUNTER)
  117. * M80 - Turn on Power Supply. (Requires PSU_CONTROL)
  118. * M81 - Turn off Power Supply. (Requires PSU_CONTROL)
  119. * M82 - Set E codes absolute (default).
  120. * M83 - Set E codes relative while in Absolute (G90) mode.
  121. * M84 - Disable steppers until next move, or use S<seconds> to specify an idle
  122. * duration after which steppers should turn off. S0 disables the timeout.
  123. * M85 - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
  124. * M92 - Set planner.settings.axis_steps_per_mm for one or more axes.
  125. * M100 - Watch Free Memory (for debugging) (Requires M100_FREE_MEMORY_WATCHER)
  126. * M104 - Set extruder target temp.
  127. * M105 - Report current temperatures.
  128. * M106 - Set print fan speed.
  129. * M107 - Print fan off.
  130. * M108 - Break out of heating loops (M109, M190, M303). With no controller, breaks out of M0/M1. (Requires EMERGENCY_PARSER)
  131. * M109 - S<temp> Wait for extruder current temp to reach target temp. ** Wait only when heating! **
  132. * R<temp> Wait for extruder current temp to reach target temp. ** Wait for heating or cooling. **
  133. * If AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
  134. * M110 - Set the current line number. (Used by host printing)
  135. * M111 - Set debug flags: "M111 S<flagbits>". See flag bits defined in enum.h.
  136. * M112 - Full Shutdown.
  137. * M113 - Get or set the timeout interval for Host Keepalive "busy" messages. (Requires HOST_KEEPALIVE_FEATURE)
  138. * M114 - Report current position.
  139. * M115 - Report capabilities. (Extended capabilities requires EXTENDED_CAPABILITIES_REPORT)
  140. * M117 - Display a message on the controller screen. (Requires an LCD)
  141. * M118 - Display a message in the host console.
  142. * M119 - Report endstops status.
  143. * M120 - Enable endstops detection.
  144. * M121 - Disable endstops detection.
  145. * M122 - Debug stepper (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660 or L6470)
  146. * M125 - Save current position and move to filament change position. (Requires PARK_HEAD_ON_PAUSE)
  147. * M126 - Solenoid Air Valve Open. (Requires BARICUDA)
  148. * M127 - Solenoid Air Valve Closed. (Requires BARICUDA)
  149. * M128 - EtoP Open. (Requires BARICUDA)
  150. * M129 - EtoP Closed. (Requires BARICUDA)
  151. * M140 - Set bed target temp. S<temp>
  152. * M141 - Set heated chamber target temp. S<temp> (Requires a chamber heater)
  153. * M143 - Set cooler target temp. S<temp> (Requires a laser cooling device)
  154. * M145 - Set heatup values for materials on the LCD. H<hotend> B<bed> F<fan speed> for S<material> (0=PLA, 1=ABS)
  155. * M149 - Set temperature units. (Requires TEMPERATURE_UNITS_SUPPORT)
  156. * M150 - Set Status LED Color as R<red> U<green> B<blue> W<white> P<bright>. Values 0-255. (Requires BLINKM, RGB_LED, RGBW_LED, NEOPIXEL_LED, PCA9533, or PCA9632).
  157. * M154 - Auto-report position with interval of S<seconds>. (Requires AUTO_REPORT_POSITION)
  158. * M155 - Auto-report temperatures with interval of S<seconds>. (Requires AUTO_REPORT_TEMPERATURES)
  159. * M163 - Set a single proportion for a mixing extruder. (Requires MIXING_EXTRUDER)
  160. * M164 - Commit the mix and save to a virtual tool (current, or as specified by 'S'). (Requires MIXING_EXTRUDER)
  161. * M165 - Set the mix for the mixing extruder (and current virtual tool) with parameters ABCDHI. (Requires MIXING_EXTRUDER and DIRECT_MIXING_IN_G1)
  162. * M166 - Set the Gradient Mix for the mixing extruder. (Requires GRADIENT_MIX)
  163. * M190 - S<temp> Wait for bed current temp to reach target temp. ** Wait only when heating! **
  164. * R<temp> Wait for bed current temp to reach target temp. ** Wait for heating or cooling. **
  165. * M193 - R<temp> Wait for cooler temp to reach target temp. ** Wait for cooling. **
  166. * M200 - Set filament diameter, D<diameter>, setting E axis units to cubic. (Use S0 to revert to linear units.)
  167. * M201 - Set max acceleration in units/s^2 for print moves: "M201 X<accel> Y<accel> Z<accel> E<accel>"
  168. * M202 - Set max acceleration in units/s^2 for travel moves: "M202 X<accel> Y<accel> Z<accel> E<accel>" ** UNUSED IN MARLIN! **
  169. * M203 - Set maximum feedrate: "M203 X<fr> Y<fr> Z<fr> E<fr>" in units/sec.
  170. * M204 - Set default acceleration in units/sec^2: P<printing> R<extruder_only> T<travel>
  171. * M205 - Set advanced settings. Current units apply:
  172. S<print> T<travel> minimum speeds
  173. B<minimum segment time>
  174. X<max X jerk>, Y<max Y jerk>, Z<max Z jerk>, E<max E jerk>
  175. * M206 - Set additional homing offset. (Disabled by NO_WORKSPACE_OFFSETS or DELTA)
  176. * M207 - Set Retract Length: S<length>, Feedrate: F<units/min>, and Z lift: Z<distance>. (Requires FWRETRACT)
  177. * M208 - Set Recover (unretract) Additional (!) Length: S<length> and Feedrate: F<units/min>. (Requires FWRETRACT)
  178. * M209 - Turn Automatic Retract Detection on/off: S<0|1> (For slicers that don't support G10/11). (Requires FWRETRACT_AUTORETRACT)
  179. Every normal extrude-only move will be classified as retract depending on the direction.
  180. * M211 - Enable, Disable, and/or Report software endstops: S<0|1> (Requires MIN_SOFTWARE_ENDSTOPS or MAX_SOFTWARE_ENDSTOPS)
  181. * M217 - Set filament swap parameters: "M217 S<length> P<feedrate> R<feedrate>". (Requires SINGLENOZZLE)
  182. * M218 - Set/get a tool offset: "M218 T<index> X<offset> Y<offset>". (Requires 2 or more extruders)
  183. * M220 - Set Feedrate Percentage: "M220 S<percent>" (i.e., "FR" on the LCD)
  184. * Use "M220 B" to back up the Feedrate Percentage and "M220 R" to restore it. (Requires an MMU_MODEL version 2 or 2S)
  185. * M221 - Set Flow Percentage: "M221 S<percent>"
  186. * M226 - Wait until a pin is in a given state: "M226 P<pin> S<state>" (Requires DIRECT_PIN_CONTROL)
  187. * M240 - Trigger a camera to take a photograph. (Requires PHOTO_GCODE)
  188. * M250 - Set LCD contrast: "M250 C<contrast>" (0-63). (Requires LCD support)
  189. * M256 - Set LCD brightness: "M256 B<brightness>" (0-255). (Requires an LCD with brightness control)
  190. * M260 - i2c Send Data (Requires EXPERIMENTAL_I2CBUS)
  191. * M261 - i2c Request Data (Requires EXPERIMENTAL_I2CBUS)
  192. * M280 - Set servo position absolute: "M280 P<index> S<angle|µs>". (Requires servos)
  193. * M281 - Set servo min|max position: "M281 P<index> L<min> U<max>". (Requires EDITABLE_SERVO_ANGLES)
  194. * M282 - Detach servo: "M282 P<index>". (Requires SERVO_DETACH_GCODE)
  195. * M290 - Babystepping (Requires BABYSTEPPING)
  196. * M300 - Play beep sound S<frequency Hz> P<duration ms>
  197. * M301 - Set PID parameters P I and D. (Requires PIDTEMP)
  198. * M302 - Allow cold extrudes, or set the minimum extrude S<temperature>. (Requires PREVENT_COLD_EXTRUSION)
  199. * M303 - PID relay autotune S<temperature> sets the target temperature. Default 150C. (Requires PIDTEMP)
  200. * M304 - Set bed PID parameters P I and D. (Requires PIDTEMPBED)
  201. * M305 - Set user thermistor parameters R T and P. (Requires TEMP_SENSOR_x 1000)
  202. * M309 - Set chamber PID parameters P I and D. (Requires PIDTEMPCHAMBER)
  203. * M350 - Set microstepping mode. (Requires digital microstepping pins.)
  204. * M351 - Toggle MS1 MS2 pins directly. (Requires digital microstepping pins.)
  205. * M355 - Set Case Light on/off and set brightness. (Requires CASE_LIGHT_PIN)
  206. * M380 - Activate solenoid on active extruder. (Requires EXT_SOLENOID)
  207. * M381 - Disable all solenoids. (Requires EXT_SOLENOID)
  208. * M400 - Finish all moves.
  209. * M401 - Deploy and activate Z probe. (Requires a probe)
  210. * M402 - Deactivate and stow Z probe. (Requires a probe)
  211. * M403 - Set filament type for PRUSA MMU2
  212. * M404 - Display or set the Nominal Filament Width: "W<diameter>". (Requires FILAMENT_WIDTH_SENSOR)
  213. * M405 - Enable Filament Sensor flow control. "M405 D<delay_cm>". (Requires FILAMENT_WIDTH_SENSOR)
  214. * M406 - Disable Filament Sensor flow control. (Requires FILAMENT_WIDTH_SENSOR)
  215. * M407 - Display measured filament diameter in millimeters. (Requires FILAMENT_WIDTH_SENSOR)
  216. * M410 - Quickstop. Abort all planned moves.
  217. * M412 - Enable / Disable Filament Runout Detection. (Requires FILAMENT_RUNOUT_SENSOR)
  218. * M413 - Enable / Disable Power-Loss Recovery. (Requires POWER_LOSS_RECOVERY)
  219. * M414 - Set language by index. (Requires LCD_LANGUAGE_2...)
  220. * M420 - Enable/Disable Leveling (with current values) S1=enable S0=disable (Requires MESH_BED_LEVELING or ABL)
  221. * 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)
  222. * M422 - Set Z Stepper automatic alignment position using probe. X<units> Y<units> A<axis> (Requires Z_STEPPER_AUTO_ALIGN)
  223. * M425 - Enable/Disable and tune backlash correction. (Requires BACKLASH_COMPENSATION and BACKLASH_GCODE)
  224. * M428 - Set the home_offset based on the current_position. Nearest edge applies. (Disabled by NO_WORKSPACE_OFFSETS or DELTA)
  225. * M430 - Read the system current, voltage, and power (Requires POWER_MONITOR_CURRENT, POWER_MONITOR_VOLTAGE, or POWER_MONITOR_FIXED_VOLTAGE)
  226. * M486 - Identify and cancel objects. (Requires CANCEL_OBJECTS)
  227. * M500 - Store parameters in EEPROM. (Requires EEPROM_SETTINGS)
  228. * M501 - Restore parameters from EEPROM. (Requires EEPROM_SETTINGS)
  229. * M502 - Revert to the default "factory settings". ** Does not write them to EEPROM! **
  230. * M503 - Print the current settings (in memory): "M503 S<verbose>". S0 specifies compact output.
  231. * M504 - Validate EEPROM contents. (Requires EEPROM_SETTINGS)
  232. * M510 - Lock Printer
  233. * M511 - Unlock Printer
  234. * M512 - Set/Change/Remove Password
  235. * M524 - Abort the current SD print job started with M24. (Requires SDSUPPORT)
  236. * M540 - Enable/disable SD card abort on endstop hit: "M540 S<state>". (Requires SD_ABORT_ON_ENDSTOP_HIT)
  237. * M552 - Get or set IP address. Enable/disable network interface. (Requires enabled Ethernet port)
  238. * M553 - Get or set IP netmask. (Requires enabled Ethernet port)
  239. * M554 - Get or set IP gateway. (Requires enabled Ethernet port)
  240. * M569 - Enable stealthChop on an axis. (Requires at least one _DRIVER_TYPE to be TMC2130/2160/2208/2209/5130/5160)
  241. * M575 - Change the serial baud rate. (Requires BAUD_RATE_GCODE)
  242. * M600 - Pause for filament change: "M600 X<pos> Y<pos> Z<raise> E<first_retract> L<later_retract>". (Requires ADVANCED_PAUSE_FEATURE)
  243. * M603 - Configure filament change: "M603 T<tool> U<unload_length> L<load_length>". (Requires ADVANCED_PAUSE_FEATURE)
  244. * M605 - Set Dual X-Carriage movement mode: "M605 S<mode> [X<x_offset>] [R<temp_offset>]". (Requires DUAL_X_CARRIAGE)
  245. * 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)
  246. * M666 - Set/get offsets for delta (Requires DELTA) or dual endstops. (Requires [XYZ]_DUAL_ENDSTOPS)
  247. * M672 - Set/Reset Duet Smart Effector's sensitivity. (Requires DUET_SMART_EFFECTOR and SMART_EFFECTOR_MOD_PIN)
  248. * M701 - Load filament (Requires FILAMENT_LOAD_UNLOAD_GCODES)
  249. * M702 - Unload filament (Requires FILAMENT_LOAD_UNLOAD_GCODES)
  250. * M808 - Set or Goto a Repeat Marker (Requires GCODE_REPEAT_MARKERS)
  251. * M810-M819 - Define/execute a G-code macro (Requires GCODE_MACROS)
  252. * M851 - Set Z probe's XYZ offsets in current units. (Negative values: X=left, Y=front, Z=below)
  253. * M852 - Set skew factors: "M852 [I<xy>] [J<xz>] [K<yz>]". (Requires SKEW_CORRECTION_GCODE, and SKEW_CORRECTION_FOR_Z for IJ)
  254. * M860 - Report the position of position encoder modules.
  255. * M861 - Report the status of position encoder modules.
  256. * M862 - Perform an axis continuity test for position encoder modules.
  257. * M863 - Perform steps-per-mm calibration for position encoder modules.
  258. * M864 - Change position encoder module I2C address.
  259. * M865 - Check position encoder module firmware version.
  260. * M866 - Report or reset position encoder module error count.
  261. * M867 - Enable/disable or toggle error correction for position encoder modules.
  262. * M868 - Report or set position encoder module error correction threshold.
  263. * M869 - Report position encoder module error.
  264. * M871 - Print/reset/clear first layer temperature offset values. (Requires PROBE_TEMP_COMPENSATION)
  265. * M192 - Wait for probe temp (Requires PROBE_TEMP_COMPENSATION)
  266. * M876 - Handle Prompt Response. (Requires HOST_PROMPT_SUPPORT and not EMERGENCY_PARSER)
  267. * M900 - Get or Set Linear Advance K-factor. (Requires LIN_ADVANCE)
  268. * 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)
  269. * M907 - Set digital trimpot motor current using axis codes. (Requires a board with digital trimpots)
  270. * M908 - Control digital trimpot directly. (Requires HAS_MOTOR_CURRENT_DAC or DIGIPOTSS_PIN)
  271. * M909 - Print digipot/DAC current value. (Requires HAS_MOTOR_CURRENT_DAC)
  272. * M910 - Commit digipot/DAC value to external EEPROM via I2C. (Requires HAS_MOTOR_CURRENT_DAC)
  273. * M911 - Report stepper driver overtemperature pre-warn condition. (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660)
  274. * M912 - Clear stepper driver overtemperature pre-warn condition flag. (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660)
  275. * M913 - Set HYBRID_THRESHOLD speed. (Requires HYBRID_THRESHOLD)
  276. * M914 - Set StallGuard sensitivity. (Requires SENSORLESS_HOMING or SENSORLESS_PROBING)
  277. * M916 - L6470 tuning: Increase KVAL_HOLD until thermal warning. (Requires at least one _DRIVER_TYPE L6470)
  278. * M917 - L6470 tuning: Find minimum current thresholds. (Requires at least one _DRIVER_TYPE L6470)
  279. * M918 - L6470 tuning: Increase speed until max or error. (Requires at least one _DRIVER_TYPE L6470)
  280. * M951 - Set Magnetic Parking Extruder parameters. (Requires MAGNETIC_PARKING_EXTRUDER)
  281. * M7219 - Control Max7219 Matrix LEDs. (Requires MAX7219_GCODE)
  282. *
  283. * M360 - SCARA calibration: Move to cal-position ThetaA (0 deg calibration)
  284. * M361 - SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree)
  285. * M362 - SCARA calibration: Move to cal-position PsiA (0 deg calibration)
  286. * M363 - SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree)
  287. * M364 - SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position)
  288. *
  289. * ************ Custom codes - This can change to suit future G-code regulations
  290. * G425 - Calibrate using a conductive object. (Requires CALIBRATION_GCODE)
  291. * M928 - Start SD logging: "M928 filename.gco". Stop with M29. (Requires SDSUPPORT)
  292. * M993 - Backup SPI Flash to SD
  293. * M994 - Load a Backup from SD to SPI Flash
  294. * M995 - Touch screen calibration for TFT display
  295. * M997 - Perform in-application firmware update
  296. * M999 - Restart after being stopped by error
  297. * D... - Custom Development G-code. Add hooks to 'gcode_D.cpp' for developers to test features. (Requires MARLIN_DEV_MODE)
  298. * D576 - Set buffer monitoring options. (Requires BUFFER_MONITORING)
  299. *
  300. * "T" Codes
  301. *
  302. * T0-T3 - Select an extruder (tool) by index: "T<n> F<units/min>"
  303. */
  304. #include "../inc/MarlinConfig.h"
  305. #include "parser.h"
  306. #if ENABLED(I2C_POSITION_ENCODERS)
  307. #include "../feature/encoder_i2c.h"
  308. #endif
  309. #if IS_SCARA || defined(G0_FEEDRATE)
  310. #define HAS_FAST_MOVES 1
  311. #endif
  312. enum AxisRelative : uint8_t {
  313. LOGICAL_AXIS_LIST(REL_E, REL_X, REL_Y, REL_Z, REL_I, REL_J, REL_K)
  314. #if HAS_EXTRUDERS
  315. , E_MODE_ABS, E_MODE_REL
  316. #endif
  317. };
  318. extern const char G28_STR[];
  319. class GcodeSuite {
  320. public:
  321. static uint8_t axis_relative;
  322. static inline bool axis_is_relative(const AxisEnum a) {
  323. #if HAS_EXTRUDERS
  324. if (a == E_AXIS) {
  325. if (TEST(axis_relative, E_MODE_REL)) return true;
  326. if (TEST(axis_relative, E_MODE_ABS)) return false;
  327. }
  328. #endif
  329. return TEST(axis_relative, a);
  330. }
  331. static inline void set_relative_mode(const bool rel) {
  332. axis_relative = rel ? (0 LOGICAL_AXIS_GANG(
  333. | _BV(REL_E),
  334. | _BV(REL_X), | _BV(REL_Y), | _BV(REL_Z),
  335. | _BV(REL_I), | _BV(REL_J), | _BV(REL_K)
  336. )) : 0;
  337. }
  338. #if HAS_EXTRUDERS
  339. static inline void set_e_relative() {
  340. CBI(axis_relative, E_MODE_ABS);
  341. SBI(axis_relative, E_MODE_REL);
  342. }
  343. static inline void set_e_absolute() {
  344. CBI(axis_relative, E_MODE_REL);
  345. SBI(axis_relative, E_MODE_ABS);
  346. }
  347. #endif
  348. #if ENABLED(CNC_WORKSPACE_PLANES)
  349. /**
  350. * Workspace planes only apply to G2/G3 moves
  351. * (and "canned cycles" - not a current feature)
  352. */
  353. enum WorkspacePlane : char { PLANE_XY, PLANE_ZX, PLANE_YZ };
  354. static WorkspacePlane workspace_plane;
  355. #endif
  356. #define MAX_COORDINATE_SYSTEMS 9
  357. #if ENABLED(CNC_COORDINATE_SYSTEMS)
  358. static int8_t active_coordinate_system;
  359. static xyz_pos_t coordinate_system[MAX_COORDINATE_SYSTEMS];
  360. static bool select_coordinate_system(const int8_t _new);
  361. #endif
  362. static millis_t previous_move_ms, max_inactive_time, stepper_inactive_time;
  363. FORCE_INLINE static void reset_stepper_timeout(const millis_t ms=millis()) { previous_move_ms = ms; }
  364. FORCE_INLINE static bool stepper_max_timed_out(const millis_t ms=millis()) {
  365. return max_inactive_time && ELAPSED(ms, previous_move_ms + max_inactive_time);
  366. }
  367. FORCE_INLINE static bool stepper_inactive_timeout(const millis_t ms=millis()) {
  368. return ELAPSED(ms, previous_move_ms + stepper_inactive_time);
  369. }
  370. static void report_echo_start(const bool forReplay);
  371. static void report_heading(const bool forReplay, PGM_P const pstr, const bool eol=true);
  372. static inline void report_heading_etc(const bool forReplay, PGM_P const pstr, const bool eol=true) {
  373. report_heading(forReplay, pstr, eol);
  374. report_echo_start(forReplay);
  375. }
  376. static void say_units();
  377. static int8_t get_target_extruder_from_command();
  378. static int8_t get_target_e_stepper_from_command();
  379. static void get_destination_from_command();
  380. static void process_parsed_command(const bool no_ok=false);
  381. static void process_next_command();
  382. // Execute G-code in-place, preserving current G-code parameters
  383. static void process_subcommands_now_P(PGM_P pgcode);
  384. static void process_subcommands_now(char * gcode);
  385. static inline void home_all_axes(const bool keep_leveling=false) {
  386. process_subcommands_now_P(keep_leveling ? G28_STR : TERN(CAN_SET_LEVELING_AFTER_G28, PSTR("G28L0"), G28_STR));
  387. }
  388. #if EITHER(HAS_AUTO_REPORTING, HOST_KEEPALIVE_FEATURE)
  389. static bool autoreport_paused;
  390. static inline bool set_autoreport_paused(const bool p) {
  391. const bool was = autoreport_paused;
  392. autoreport_paused = p;
  393. return was;
  394. }
  395. #else
  396. static constexpr bool autoreport_paused = false;
  397. static inline bool set_autoreport_paused(const bool) { return false; }
  398. #endif
  399. #if ENABLED(HOST_KEEPALIVE_FEATURE)
  400. /**
  401. * States for managing Marlin and host communication
  402. * Marlin sends messages if blocked or busy
  403. */
  404. enum MarlinBusyState : char {
  405. NOT_BUSY, // Not in a handler
  406. IN_HANDLER, // Processing a GCode
  407. IN_PROCESS, // Known to be blocking command input (as in G29)
  408. PAUSED_FOR_USER, // Blocking pending any input
  409. PAUSED_FOR_INPUT // Blocking pending text input (concept)
  410. };
  411. static MarlinBusyState busy_state;
  412. static uint8_t host_keepalive_interval;
  413. static void host_keepalive();
  414. static inline bool host_keepalive_is_paused() { return busy_state >= PAUSED_FOR_USER; }
  415. #define KEEPALIVE_STATE(N) REMEMBER(_KA_, gcode.busy_state, gcode.N)
  416. #else
  417. #define KEEPALIVE_STATE(N) NOOP
  418. #endif
  419. static void dwell(millis_t time);
  420. private:
  421. friend class MarlinSettings;
  422. #if ENABLED(MARLIN_DEV_MODE)
  423. static void D(const int16_t dcode);
  424. #endif
  425. static void G0_G1(TERN_(HAS_FAST_MOVES, const bool fast_move=false));
  426. #if ENABLED(ARC_SUPPORT)
  427. static void G2_G3(const bool clockwise);
  428. #endif
  429. static void G4();
  430. #if ENABLED(BEZIER_CURVE_SUPPORT)
  431. static void G5();
  432. #endif
  433. #if ENABLED(DIRECT_STEPPING)
  434. static void G6();
  435. #endif
  436. #if ENABLED(FWRETRACT)
  437. static void G10();
  438. static void G11();
  439. #endif
  440. #if ENABLED(NOZZLE_CLEAN_FEATURE)
  441. static void G12();
  442. #endif
  443. #if ENABLED(CNC_WORKSPACE_PLANES)
  444. static void G17();
  445. static void G18();
  446. static void G19();
  447. #endif
  448. #if ENABLED(INCH_MODE_SUPPORT)
  449. static void G20();
  450. static void G21();
  451. #endif
  452. #if ENABLED(G26_MESH_VALIDATION)
  453. static void G26();
  454. #endif
  455. #if ENABLED(NOZZLE_PARK_FEATURE)
  456. static void G27();
  457. #endif
  458. static void G28();
  459. #if HAS_LEVELING
  460. #if ENABLED(G29_RETRY_AND_RECOVER)
  461. static void event_probe_failure();
  462. static void event_probe_recover();
  463. static void G29_with_retry();
  464. #define G29_TYPE bool
  465. #else
  466. #define G29_TYPE void
  467. #endif
  468. static G29_TYPE G29();
  469. #endif
  470. #if HAS_BED_PROBE
  471. static void G30();
  472. #if ENABLED(Z_PROBE_SLED)
  473. static void G31();
  474. static void G32();
  475. #endif
  476. #endif
  477. #if ENABLED(DELTA_AUTO_CALIBRATION)
  478. static void G33();
  479. #endif
  480. #if ANY(Z_MULTI_ENDSTOPS, Z_STEPPER_AUTO_ALIGN, MECHANICAL_GANTRY_CALIBRATION)
  481. static void G34();
  482. #endif
  483. #if ENABLED(Z_STEPPER_AUTO_ALIGN)
  484. static void M422();
  485. static void M422_report(const bool forReplay=true);
  486. #endif
  487. #if ENABLED(ASSISTED_TRAMMING)
  488. static void G35();
  489. #endif
  490. #if ENABLED(G38_PROBE_TARGET)
  491. static void G38(const int8_t subcode);
  492. #endif
  493. #if HAS_MESH
  494. static void G42();
  495. #endif
  496. #if ENABLED(CNC_COORDINATE_SYSTEMS)
  497. static void G53();
  498. static void G54();
  499. static void G55();
  500. static void G56();
  501. static void G57();
  502. static void G58();
  503. static void G59();
  504. #endif
  505. #if ENABLED(PROBE_TEMP_COMPENSATION)
  506. static void G76();
  507. #endif
  508. #if SAVED_POSITIONS
  509. static void G60();
  510. static void G61();
  511. #endif
  512. #if ENABLED(GCODE_MOTION_MODES)
  513. static void G80();
  514. #endif
  515. static void G92();
  516. #if ENABLED(CALIBRATION_GCODE)
  517. static void G425();
  518. #endif
  519. #if HAS_RESUME_CONTINUE
  520. static void M0_M1();
  521. #endif
  522. #if HAS_CUTTER
  523. static void M3_M4(const bool is_M4);
  524. static void M5();
  525. #endif
  526. #if ENABLED(COOLANT_MIST)
  527. static void M7();
  528. #endif
  529. #if EITHER(AIR_ASSIST, COOLANT_FLOOD)
  530. static void M8();
  531. #endif
  532. #if EITHER(AIR_ASSIST, COOLANT_CONTROL)
  533. static void M9();
  534. #endif
  535. #if ENABLED(AIR_EVACUATION)
  536. static void M10();
  537. static void M11();
  538. #endif
  539. #if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER)
  540. static void M12();
  541. #endif
  542. #if ENABLED(EXPECTED_PRINTER_CHECK)
  543. static void M16();
  544. #endif
  545. static void M17();
  546. static void M18_M84();
  547. #if ENABLED(SDSUPPORT)
  548. static void M20();
  549. static void M21();
  550. static void M22();
  551. static void M23();
  552. static void M24();
  553. static void M25();
  554. static void M26();
  555. static void M27();
  556. static void M28();
  557. static void M29();
  558. static void M30();
  559. #endif
  560. static void M31();
  561. #if ENABLED(SDSUPPORT)
  562. #if HAS_MEDIA_SUBCALLS
  563. static void M32();
  564. #endif
  565. #if ENABLED(LONG_FILENAME_HOST_SUPPORT)
  566. static void M33();
  567. #endif
  568. #if BOTH(SDCARD_SORT_ALPHA, SDSORT_GCODE)
  569. static void M34();
  570. #endif
  571. #endif
  572. #if ENABLED(DIRECT_PIN_CONTROL)
  573. static void M42();
  574. #endif
  575. #if ENABLED(PINS_DEBUGGING)
  576. static void M43();
  577. #endif
  578. #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
  579. static void M48();
  580. #endif
  581. #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
  582. static void M73();
  583. #endif
  584. static void M75();
  585. static void M76();
  586. static void M77();
  587. #if ENABLED(PRINTCOUNTER)
  588. static void M78();
  589. #endif
  590. #if ENABLED(PSU_CONTROL)
  591. static void M80();
  592. #endif
  593. static void M81();
  594. #if HAS_EXTRUDERS
  595. static void M82();
  596. static void M83();
  597. #endif
  598. static void M85();
  599. static void M92();
  600. static void M92_report(const bool forReplay=true, const int8_t e=-1);
  601. #if ENABLED(M100_FREE_MEMORY_WATCHER)
  602. static void M100();
  603. #endif
  604. #if HAS_EXTRUDERS
  605. static void M104_M109(const bool isM109);
  606. FORCE_INLINE static void M104() { M104_M109(false); }
  607. FORCE_INLINE static void M109() { M104_M109(true); }
  608. #endif
  609. static void M105();
  610. #if HAS_FAN
  611. static void M106();
  612. static void M107();
  613. #endif
  614. #if DISABLED(EMERGENCY_PARSER)
  615. static void M108();
  616. static void M112();
  617. static void M410();
  618. #if ENABLED(HOST_PROMPT_SUPPORT)
  619. static void M876();
  620. #endif
  621. #endif
  622. static void M110();
  623. static void M111();
  624. #if ENABLED(HOST_KEEPALIVE_FEATURE)
  625. static void M113();
  626. #endif
  627. static void M114();
  628. static void M115();
  629. #if HAS_STATUS_MESSAGE
  630. static void M117();
  631. #endif
  632. static void M118();
  633. static void M119();
  634. static void M120();
  635. static void M121();
  636. #if ENABLED(PARK_HEAD_ON_PAUSE)
  637. static void M125();
  638. #endif
  639. #if ENABLED(BARICUDA)
  640. #if HAS_HEATER_1
  641. static void M126();
  642. static void M127();
  643. #endif
  644. #if HAS_HEATER_2
  645. static void M128();
  646. static void M129();
  647. #endif
  648. #endif
  649. #if HAS_HEATED_BED
  650. static void M140_M190(const bool isM190);
  651. FORCE_INLINE static void M140() { M140_M190(false); }
  652. FORCE_INLINE static void M190() { M140_M190(true); }
  653. #endif
  654. #if HAS_HEATED_CHAMBER
  655. static void M141();
  656. static void M191();
  657. #endif
  658. #if HAS_COOLER
  659. static void M143();
  660. static void M193();
  661. #endif
  662. #if PREHEAT_COUNT
  663. static void M145();
  664. static void M145_report(const bool forReplay=true);
  665. #endif
  666. #if ENABLED(TEMPERATURE_UNITS_SUPPORT)
  667. static void M149();
  668. static void M149_report(const bool forReplay=true);
  669. #endif
  670. #if HAS_COLOR_LEDS
  671. static void M150();
  672. #endif
  673. #if ENABLED(AUTO_REPORT_POSITION)
  674. static void M154();
  675. #endif
  676. #if BOTH(AUTO_REPORT_TEMPERATURES, HAS_TEMP_SENSOR)
  677. static void M155();
  678. #endif
  679. #if ENABLED(MIXING_EXTRUDER)
  680. static void M163();
  681. static void M164();
  682. #if ENABLED(DIRECT_MIXING_IN_G1)
  683. static void M165();
  684. #endif
  685. #if ENABLED(GRADIENT_MIX)
  686. static void M166();
  687. #endif
  688. #endif
  689. #if DISABLED(NO_VOLUMETRICS)
  690. static void M200();
  691. static void M200_report(const bool forReplay=true);
  692. #endif
  693. static void M201();
  694. static void M201_report(const bool forReplay=true);
  695. #if 0
  696. static void M202(); // Not used for Sprinter/grbl gen6
  697. #endif
  698. static void M203();
  699. static void M203_report(const bool forReplay=true);
  700. static void M204();
  701. static void M204_report(const bool forReplay=true);
  702. static void M205();
  703. static void M205_report(const bool forReplay=true);
  704. #if HAS_M206_COMMAND
  705. static void M206();
  706. static void M206_report(const bool forReplay=true);
  707. #endif
  708. #if ENABLED(FWRETRACT)
  709. static void M207();
  710. static void M207_report(const bool forReplay=true);
  711. static void M208();
  712. static void M208_report(const bool forReplay=true);
  713. #if ENABLED(FWRETRACT_AUTORETRACT)
  714. static void M209();
  715. static void M209_report(const bool forReplay=true);
  716. #endif
  717. #endif
  718. static void M211();
  719. static void M211_report(const bool forReplay=true);
  720. #if HAS_MULTI_EXTRUDER
  721. static void M217();
  722. static void M217_report(const bool forReplay=true);
  723. #endif
  724. #if HAS_HOTEND_OFFSET
  725. static void M218();
  726. static void M218_report(const bool forReplay=true);
  727. #endif
  728. static void M220();
  729. #if HAS_EXTRUDERS
  730. static void M221();
  731. #endif
  732. #if ENABLED(DIRECT_PIN_CONTROL)
  733. static void M226();
  734. #endif
  735. #if ENABLED(PHOTO_GCODE)
  736. static void M240();
  737. #endif
  738. #if HAS_LCD_CONTRAST
  739. static void M250();
  740. static void M250_report(const bool forReplay=true);
  741. #endif
  742. #if HAS_LCD_BRIGHTNESS
  743. static void M256();
  744. static void M256_report(const bool forReplay=true);
  745. #endif
  746. #if ENABLED(EXPERIMENTAL_I2CBUS)
  747. static void M260();
  748. static void M261();
  749. #endif
  750. #if HAS_SERVOS
  751. static void M280();
  752. #if ENABLED(EDITABLE_SERVO_ANGLES)
  753. static void M281();
  754. static void M281_report(const bool forReplay=true);
  755. #endif
  756. #if ENABLED(SERVO_DETACH_GCODE)
  757. static void M282();
  758. #endif
  759. #endif
  760. #if ENABLED(BABYSTEPPING)
  761. static void M290();
  762. #endif
  763. #if HAS_BUZZER
  764. static void M300();
  765. #endif
  766. #if ENABLED(PIDTEMP)
  767. static void M301();
  768. static void M301_report(const bool forReplay=true, const int8_t eindex=-1);
  769. #endif
  770. #if ENABLED(PREVENT_COLD_EXTRUSION)
  771. static void M302();
  772. #endif
  773. #if HAS_PID_HEATING
  774. static void M303();
  775. #endif
  776. #if ENABLED(PIDTEMPBED)
  777. static void M304();
  778. static void M304_report(const bool forReplay=true);
  779. #endif
  780. #if HAS_USER_THERMISTORS
  781. static void M305();
  782. #endif
  783. #if ENABLED(PIDTEMPCHAMBER)
  784. static void M309();
  785. static void M309_report(const bool forReplay=true);
  786. #endif
  787. #if HAS_MICROSTEPS
  788. static void M350();
  789. static void M351();
  790. #endif
  791. #if ENABLED(CASE_LIGHT_ENABLE)
  792. static void M355();
  793. #endif
  794. #if ENABLED(REPETIER_GCODE_M360)
  795. static void M360();
  796. #endif
  797. #if ENABLED(MORGAN_SCARA)
  798. static bool M360();
  799. static bool M361();
  800. static bool M362();
  801. static bool M363();
  802. static bool M364();
  803. #endif
  804. #if EITHER(EXT_SOLENOID, MANUAL_SOLENOID_CONTROL)
  805. static void M380();
  806. static void M381();
  807. #endif
  808. static void M400();
  809. #if HAS_BED_PROBE
  810. static void M401();
  811. static void M402();
  812. #endif
  813. #if HAS_PRUSA_MMU2
  814. static void M403();
  815. #endif
  816. #if ENABLED(FILAMENT_WIDTH_SENSOR)
  817. static void M404();
  818. static void M405();
  819. static void M406();
  820. static void M407();
  821. #endif
  822. #if HAS_FILAMENT_SENSOR
  823. static void M412();
  824. static void M412_report(const bool forReplay=true);
  825. #endif
  826. #if HAS_MULTI_LANGUAGE
  827. static void M414();
  828. static void M414_report(const bool forReplay=true);
  829. #endif
  830. #if HAS_LEVELING
  831. static void M420();
  832. static void M420_report(const bool forReplay=true);
  833. static void M421();
  834. #endif
  835. #if ENABLED(BACKLASH_GCODE)
  836. static void M425();
  837. static void M425_report(const bool forReplay=true);
  838. #endif
  839. #if HAS_M206_COMMAND
  840. static void M428();
  841. #endif
  842. #if HAS_POWER_MONITOR
  843. static void M430();
  844. #endif
  845. #if ENABLED(CANCEL_OBJECTS)
  846. static void M486();
  847. #endif
  848. static void M500();
  849. static void M501();
  850. static void M502();
  851. #if DISABLED(DISABLE_M503)
  852. static void M503();
  853. #endif
  854. #if ENABLED(EEPROM_SETTINGS)
  855. static void M504();
  856. #endif
  857. #if ENABLED(PASSWORD_FEATURE)
  858. static void M510();
  859. #if ENABLED(PASSWORD_UNLOCK_GCODE)
  860. static void M511();
  861. #endif
  862. #if ENABLED(PASSWORD_CHANGE_GCODE)
  863. static void M512();
  864. #endif
  865. #endif
  866. #if ENABLED(SDSUPPORT)
  867. static void M524();
  868. #endif
  869. #if ENABLED(SD_ABORT_ON_ENDSTOP_HIT)
  870. static void M540();
  871. #endif
  872. #if HAS_ETHERNET
  873. static void M552();
  874. static void M552_report();
  875. static void M553();
  876. static void M553_report();
  877. static void M554();
  878. static void M554_report();
  879. #endif
  880. #if HAS_STEALTHCHOP
  881. static void M569();
  882. static void M569_report(const bool forReplay=true);
  883. #endif
  884. #if ENABLED(BAUD_RATE_GCODE)
  885. static void M575();
  886. #endif
  887. #if ENABLED(ADVANCED_PAUSE_FEATURE)
  888. static void M600();
  889. static void M603();
  890. static void M603_report(const bool forReplay=true);
  891. #endif
  892. #if HAS_DUPLICATION_MODE
  893. static void M605();
  894. #endif
  895. #if IS_KINEMATIC
  896. static void M665();
  897. static void M665_report(const bool forReplay=true);
  898. #endif
  899. #if EITHER(DELTA, HAS_EXTRA_ENDSTOPS)
  900. static void M666();
  901. static void M666_report(const bool forReplay=true);
  902. #endif
  903. #if ENABLED(DUET_SMART_EFFECTOR) && PIN_EXISTS(SMART_EFFECTOR_MOD)
  904. static void M672();
  905. #endif
  906. #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)
  907. static void M701();
  908. static void M702();
  909. #endif
  910. #if ENABLED(GCODE_REPEAT_MARKERS)
  911. static void M808();
  912. #endif
  913. #if ENABLED(GCODE_MACROS)
  914. static void M810_819();
  915. #endif
  916. #if HAS_BED_PROBE
  917. static void M851();
  918. static void M851_report(const bool forReplay=true);
  919. #endif
  920. #if ENABLED(SKEW_CORRECTION_GCODE)
  921. static void M852();
  922. static void M852_report(const bool forReplay=true);
  923. #endif
  924. #if ENABLED(I2C_POSITION_ENCODERS)
  925. FORCE_INLINE static void M860() { I2CPEM.M860(); }
  926. FORCE_INLINE static void M861() { I2CPEM.M861(); }
  927. FORCE_INLINE static void M862() { I2CPEM.M862(); }
  928. FORCE_INLINE static void M863() { I2CPEM.M863(); }
  929. FORCE_INLINE static void M864() { I2CPEM.M864(); }
  930. FORCE_INLINE static void M865() { I2CPEM.M865(); }
  931. FORCE_INLINE static void M866() { I2CPEM.M866(); }
  932. FORCE_INLINE static void M867() { I2CPEM.M867(); }
  933. FORCE_INLINE static void M868() { I2CPEM.M868(); }
  934. FORCE_INLINE static void M869() { I2CPEM.M869(); }
  935. #endif
  936. #if ENABLED(PROBE_TEMP_COMPENSATION)
  937. static void M192();
  938. static void M871();
  939. #endif
  940. #if ENABLED(LIN_ADVANCE)
  941. static void M900();
  942. static void M900_report(const bool forReplay=true);
  943. #endif
  944. #if HAS_TRINAMIC_CONFIG
  945. static void M122();
  946. static void M906();
  947. static void M906_report(const bool forReplay=true);
  948. #if ENABLED(MONITOR_DRIVER_STATUS)
  949. static void M911();
  950. static void M912();
  951. #endif
  952. #if ENABLED(HYBRID_THRESHOLD)
  953. static void M913();
  954. static void M913_report(const bool forReplay=true);
  955. #endif
  956. #if ENABLED(USE_SENSORLESS)
  957. static void M914();
  958. static void M914_report(const bool forReplay=true);
  959. #endif
  960. #endif
  961. #if HAS_L64XX
  962. static void M122();
  963. static void M906();
  964. static void M916();
  965. static void M917();
  966. static void M918();
  967. #endif
  968. #if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM || HAS_MOTOR_CURRENT_I2C || HAS_MOTOR_CURRENT_DAC
  969. static void M907();
  970. #if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM
  971. static void M907_report(const bool forReplay=true);
  972. #endif
  973. #endif
  974. #if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_DAC
  975. static void M908();
  976. #endif
  977. #if HAS_MOTOR_CURRENT_DAC
  978. static void M909();
  979. static void M910();
  980. #endif
  981. #if ENABLED(SDSUPPORT)
  982. static void M928();
  983. #endif
  984. #if ENABLED(MAGNETIC_PARKING_EXTRUDER)
  985. static void M951();
  986. #endif
  987. #if ENABLED(TOUCH_SCREEN_CALIBRATION)
  988. static void M995();
  989. #endif
  990. #if BOTH(HAS_SPI_FLASH, SDSUPPORT)
  991. static void M993();
  992. static void M994();
  993. #endif
  994. #if ENABLED(PLATFORM_M997_SUPPORT)
  995. static void M997();
  996. #endif
  997. static void M999();
  998. #if ENABLED(POWER_LOSS_RECOVERY)
  999. static void M413();
  1000. static void M413_report(const bool forReplay=true);
  1001. static void M1000();
  1002. #endif
  1003. #if ENABLED(SDSUPPORT)
  1004. static void M1001();
  1005. #endif
  1006. #if ENABLED(DGUS_LCD_UI_MKS)
  1007. static void M1002();
  1008. #endif
  1009. #if ENABLED(UBL_MESH_WIZARD)
  1010. static void M1004();
  1011. #endif
  1012. #if ENABLED(MAX7219_GCODE)
  1013. static void M7219();
  1014. #endif
  1015. #if ENABLED(CONTROLLER_FAN_EDITABLE)
  1016. static void M710();
  1017. static void M710_report(const bool forReplay=true);
  1018. #endif
  1019. static void T(const int8_t tool_index);
  1020. };
  1021. extern GcodeSuite gcode;