My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

gcode.h 25KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (C) 2016 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 <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. /**
  23. * gcode.h - Temporary container for all gcode handlers
  24. */
  25. /**
  26. * -----------------
  27. * G-Codes in Marlin
  28. * -----------------
  29. *
  30. * Helpful G-code references:
  31. * - http://linuxcnc.org/handbook/gcode/g-code.html
  32. * - http://objects.reprap.org/wiki/Mendel_User_Manual:_RepRapGCodes
  33. *
  34. * Help to document Marlin's G-codes online:
  35. * - http://reprap.org/wiki/G-code
  36. * - https://github.com/MarlinFirmware/MarlinDocumentation
  37. *
  38. * -----------------
  39. *
  40. * "G" Codes
  41. *
  42. * G0 -> G1
  43. * G1 - Coordinated Movement X Y Z E
  44. * G2 - CW ARC
  45. * G3 - CCW ARC
  46. * G4 - Dwell S<seconds> or P<milliseconds>
  47. * G5 - Cubic B-spline with XYZE destination and IJPQ offsets
  48. * G10 - Retract filament according to settings of M207 (Requires FWRETRACT)
  49. * G11 - Retract recover filament according to settings of M208 (Requires FWRETRACT)
  50. * G12 - Clean tool (Requires NOZZLE_CLEAN_FEATURE)
  51. * G17 - Select Plane XY (Requires CNC_WORKSPACE_PLANES)
  52. * G18 - Select Plane ZX (Requires CNC_WORKSPACE_PLANES)
  53. * G19 - Select Plane YZ (Requires CNC_WORKSPACE_PLANES)
  54. * G20 - Set input units to inches (Requires INCH_MODE_SUPPORT)
  55. * G21 - Set input units to millimeters (Requires INCH_MODE_SUPPORT)
  56. * G26 - Mesh Validation Pattern (Requires G26_MESH_VALIDATION)
  57. * G27 - Park Nozzle (Requires NOZZLE_PARK_FEATURE)
  58. * G28 - Home one or more axes
  59. * G29 - Start or continue the bed leveling probe procedure (Requires bed leveling)
  60. * G30 - Single Z probe, probes bed at X Y location (defaults to current XY location)
  61. * G31 - Dock sled (Z_PROBE_SLED only)
  62. * G32 - Undock sled (Z_PROBE_SLED only)
  63. * G33 - Delta Auto-Calibration (Requires DELTA_AUTO_CALIBRATION)
  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. * G90 - Use Absolute Coordinates
  67. * G91 - Use Relative Coordinates
  68. * G92 - Set current position to coordinates given
  69. *
  70. * "M" Codes
  71. *
  72. * M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
  73. * M1 -> M0
  74. * M3 - Turn laser/spindle on, set spindle/laser speed/power, set rotation to clockwise
  75. * M4 - Turn laser/spindle on, set spindle/laser speed/power, set rotation to counter-clockwise
  76. * M5 - Turn laser/spindle off
  77. * M17 - Enable/Power all stepper motors
  78. * M18 - Disable all stepper motors; same as M84
  79. * M20 - List SD card. (Requires SDSUPPORT)
  80. * M21 - Init SD card. (Requires SDSUPPORT)
  81. * M22 - Release SD card. (Requires SDSUPPORT)
  82. * M23 - Select SD file: "M23 /path/file.gco". (Requires SDSUPPORT)
  83. * M24 - Start/resume SD print. (Requires SDSUPPORT)
  84. * M25 - Pause SD print. (Requires SDSUPPORT)
  85. * M26 - Set SD position in bytes: "M26 S12345". (Requires SDSUPPORT)
  86. * M27 - Report SD print status. (Requires SDSUPPORT)
  87. * M28 - Start SD write: "M28 /path/file.gco". (Requires SDSUPPORT)
  88. * M29 - Stop SD write. (Requires SDSUPPORT)
  89. * M30 - Delete file from SD: "M30 /path/file.gco"
  90. * M31 - Report time since last M109 or SD card start to serial.
  91. * M32 - Select file and start SD print: "M32 [S<bytepos>] !/path/file.gco#". (Requires SDSUPPORT)
  92. * Use P to run other files as sub-programs: "M32 P !filename#"
  93. * The '#' is necessary when calling from within sd files, as it stops buffer prereading
  94. * M33 - Get the longname version of a path. (Requires LONG_FILENAME_HOST_SUPPORT)
  95. * M34 - Set SD Card sorting options. (Requires SDCARD_SORT_ALPHA)
  96. * M42 - Change pin status via gcode: M42 P<pin> S<value>. LED pin assumed if P is omitted.
  97. * M43 - Display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins
  98. * M48 - Measure Z Probe repeatability: M48 P<points> X<pos> Y<pos> V<level> E<engage> L<legs>. (Requires Z_MIN_PROBE_REPEATABILITY_TEST)
  99. * M75 - Start the print job timer.
  100. * M76 - Pause the print job timer.
  101. * M77 - Stop the print job timer.
  102. * M78 - Show statistical information about the print jobs. (Requires PRINTCOUNTER)
  103. * M80 - Turn on Power Supply. (Requires POWER_SUPPLY > 0)
  104. * M81 - Turn off Power Supply. (Requires POWER_SUPPLY > 0)
  105. * M82 - Set E codes absolute (default).
  106. * M83 - Set E codes relative while in Absolute (G90) mode.
  107. * M84 - Disable steppers until next move, or use S<seconds> to specify an idle
  108. * duration after which steppers should turn off. S0 disables the timeout.
  109. * M85 - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
  110. * M92 - Set planner.axis_steps_per_mm for one or more axes.
  111. * M100 - Watch Free Memory (for debugging) (Requires M100_FREE_MEMORY_WATCHER)
  112. * M104 - Set extruder target temp.
  113. * M105 - Report current temperatures.
  114. * M106 - Set print fan speed.
  115. * M107 - Print fan off.
  116. * M108 - Break out of heating loops (M109, M190, M303). With no controller, breaks out of M0/M1. (Requires EMERGENCY_PARSER)
  117. * M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
  118. * Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
  119. * If AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
  120. * M110 - Set the current line number. (Used by host printing)
  121. * M111 - Set debug flags: "M111 S<flagbits>". See flag bits defined in enum.h.
  122. * M112 - Emergency stop.
  123. * M113 - Get or set the timeout interval for Host Keepalive "busy" messages. (Requires HOST_KEEPALIVE_FEATURE)
  124. * M114 - Report current position.
  125. * M115 - Report capabilities. (Extended capabilities requires EXTENDED_CAPABILITIES_REPORT)
  126. * M117 - Display a message on the controller screen. (Requires an LCD)
  127. * M118 - Display a message in the host console.
  128. * M119 - Report endstops status.
  129. * M120 - Enable endstops detection.
  130. * M121 - Disable endstops detection.
  131. * M122 - Debug stepper (Requires HAVE_TMC2130 or HAVE_TMC2208)
  132. * M125 - Save current position and move to filament change position. (Requires PARK_HEAD_ON_PAUSE)
  133. * M126 - Solenoid Air Valve Open. (Requires BARICUDA)
  134. * M127 - Solenoid Air Valve Closed. (Requires BARICUDA)
  135. * M128 - EtoP Open. (Requires BARICUDA)
  136. * M129 - EtoP Closed. (Requires BARICUDA)
  137. * M140 - Set bed target temp. S<temp>
  138. * M145 - Set heatup values for materials on the LCD. H<hotend> B<bed> F<fan speed> for S<material> (0=PLA, 1=ABS)
  139. * M149 - Set temperature units. (Requires TEMPERATURE_UNITS_SUPPORT)
  140. * 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, or PCA9632).
  141. * M155 - Auto-report temperatures with interval of S<seconds>. (Requires AUTO_REPORT_TEMPERATURES)
  142. * M163 - Set a single proportion for a mixing extruder. (Requires MIXING_EXTRUDER)
  143. * M164 - Save the mix as a virtual extruder. (Requires MIXING_EXTRUDER and MIXING_VIRTUAL_TOOLS)
  144. * M165 - Set the proportions for a mixing extruder. Use parameters ABCDHI to set the mixing factors. (Requires MIXING_EXTRUDER)
  145. * M190 - Sxxx Wait for bed current temp to reach target temp. ** Waits only when heating! **
  146. * Rxxx Wait for bed current temp to reach target temp. ** Waits for heating or cooling. **
  147. * M200 - Set filament diameter, D<diameter>, setting E axis units to cubic. (Use S0 to revert to linear units.)
  148. * M201 - Set max acceleration in units/s^2 for print moves: "M201 X<accel> Y<accel> Z<accel> E<accel>"
  149. * M202 - Set max acceleration in units/s^2 for travel moves: "M202 X<accel> Y<accel> Z<accel> E<accel>" ** UNUSED IN MARLIN! **
  150. * M203 - Set maximum feedrate: "M203 X<fr> Y<fr> Z<fr> E<fr>" in units/sec.
  151. * M204 - Set default acceleration in units/sec^2: P<printing> R<extruder_only> T<travel>
  152. * M205 - Set advanced settings. Current units apply:
  153. S<print> T<travel> minimum speeds
  154. B<minimum segment time>
  155. X<max X jerk>, Y<max Y jerk>, Z<max Z jerk>, E<max E jerk>
  156. * M206 - Set additional homing offset. (Disabled by NO_WORKSPACE_OFFSETS or DELTA)
  157. * M207 - Set Retract Length: S<length>, Feedrate: F<units/min>, and Z lift: Z<distance>. (Requires FWRETRACT)
  158. * M208 - Set Recover (unretract) Additional (!) Length: S<length> and Feedrate: F<units/min>. (Requires FWRETRACT)
  159. * M209 - Turn Automatic Retract Detection on/off: S<0|1> (For slicers that don't support G10/11). (Requires FWRETRACT)
  160. Every normal extrude-only move will be classified as retract depending on the direction.
  161. * M211 - Enable, Disable, and/or Report software endstops: S<0|1> (Requires MIN_SOFTWARE_ENDSTOPS or MAX_SOFTWARE_ENDSTOPS)
  162. * M218 - Set a tool offset: "M218 T<index> X<offset> Y<offset>". (Requires 2 or more extruders)
  163. * M220 - Set Feedrate Percentage: "M220 S<percent>" (i.e., "FR" on the LCD)
  164. * M221 - Set Flow Percentage: "M221 S<percent>"
  165. * M226 - Wait until a pin is in a given state: "M226 P<pin> S<state>"
  166. * M240 - Trigger a camera to take a photograph. (Requires CHDK or PHOTOGRAPH_PIN)
  167. * M250 - Set LCD contrast: "M250 C<contrast>" (0-63). (Requires LCD support)
  168. * M260 - i2c Send Data (Requires EXPERIMENTAL_I2CBUS)
  169. * M261 - i2c Request Data (Requires EXPERIMENTAL_I2CBUS)
  170. * M280 - Set servo position absolute: "M280 P<index> S<angle|µs>". (Requires servos)
  171. * M290 - Babystepping (Requires BABYSTEPPING)
  172. * M300 - Play beep sound S<frequency Hz> P<duration ms>
  173. * M301 - Set PID parameters P I and D. (Requires PIDTEMP)
  174. * M302 - Allow cold extrudes, or set the minimum extrude S<temperature>. (Requires PREVENT_COLD_EXTRUSION)
  175. * M303 - PID relay autotune S<temperature> sets the target temperature. Default 150C. (Requires PIDTEMP)
  176. * M304 - Set bed PID parameters P I and D. (Requires PIDTEMPBED)
  177. * M350 - Set microstepping mode. (Requires digital microstepping pins.)
  178. * M351 - Toggle MS1 MS2 pins directly. (Requires digital microstepping pins.)
  179. * M355 - Set Case Light on/off and set brightness. (Requires CASE_LIGHT_PIN)
  180. * M380 - Activate solenoid on active extruder. (Requires EXT_SOLENOID)
  181. * M381 - Disable all solenoids. (Requires EXT_SOLENOID)
  182. * M400 - Finish all moves.
  183. * M401 - Lower Z probe. (Requires a probe)
  184. * M402 - Raise Z probe. (Requires a probe)
  185. * M404 - Display or set the Nominal Filament Width: "W<diameter>". (Requires FILAMENT_WIDTH_SENSOR)
  186. * M405 - Enable Filament Sensor flow control. "M405 D<delay_cm>". (Requires FILAMENT_WIDTH_SENSOR)
  187. * M406 - Disable Filament Sensor flow control. (Requires FILAMENT_WIDTH_SENSOR)
  188. * M407 - Display measured filament diameter in millimeters. (Requires FILAMENT_WIDTH_SENSOR)
  189. * M410 - Quickstop. Abort all planned moves.
  190. * M420 - Enable/Disable Leveling (with current values) S1=enable S0=disable (Requires MESH_BED_LEVELING or ABL)
  191. * M421 - Set a single Z coordinate in the Mesh Leveling grid. X<units> Y<units> Z<units> (Requires MESH_BED_LEVELING or AUTO_BED_LEVELING_UBL)
  192. * M428 - Set the home_offset based on the current_position. Nearest edge applies. (Disabled by NO_WORKSPACE_OFFSETS or DELTA)
  193. * M500 - Store parameters in EEPROM. (Requires EEPROM_SETTINGS)
  194. * M501 - Restore parameters from EEPROM. (Requires EEPROM_SETTINGS)
  195. * M502 - Revert to the default "factory settings". ** Does not write them to EEPROM! **
  196. * M503 - Print the current settings (in memory): "M503 S<verbose>". S0 specifies compact output.
  197. * M540 - Enable/disable SD card abort on endstop hit: "M540 S<state>". (Requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
  198. * M600 - Pause for filament change: "M600 X<pos> Y<pos> Z<raise> E<first_retract> L<later_retract>". (Requires ADVANCED_PAUSE_FEATURE)
  199. * M665 - Set delta configurations: "M665 L<diagonal rod> R<delta radius> S<segments/s> A<rod A trim mm> B<rod B trim mm> C<rod C trim mm> I<tower A trim angle> J<tower B trim angle> K<tower C trim angle>" (Requires DELTA)
  200. * M666 - Set delta endstop adjustment. (Requires DELTA)
  201. * M605 - Set dual x-carriage movement mode: "M605 S<mode> [X<x_offset>] [R<temp_offset>]". (Requires DUAL_X_CARRIAGE)
  202. * M851 - Set Z probe's Z offset in current units. (Negative = below the nozzle.)
  203. * M852 - Set skew factors: "M852 [I<xy>] [J<xz>] [K<yz>]". (Requires SKEW_CORRECTION_GCODE, and SKEW_CORRECTION_FOR_Z for IJ)
  204. * M860 - Report the position of position encoder modules.
  205. * M861 - Report the status of position encoder modules.
  206. * M862 - Perform an axis continuity test for position encoder modules.
  207. * M863 - Perform steps-per-mm calibration for position encoder modules.
  208. * M864 - Change position encoder module I2C address.
  209. * M865 - Check position encoder module firmware version.
  210. * M866 - Report or reset position encoder module error count.
  211. * M867 - Enable/disable or toggle error correction for position encoder modules.
  212. * M868 - Report or set position encoder module error correction threshold.
  213. * M869 - Report position encoder module error.
  214. * M900 - Get and/or Set advance K factor and WH/D ratio. (Requires LIN_ADVANCE)
  215. * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. (Requires HAVE_TMC2130)
  216. * M907 - Set digital trimpot motor current using axis codes. (Requires a board with digital trimpots)
  217. * M908 - Control digital trimpot directly. (Requires DAC_STEPPER_CURRENT or DIGIPOTSS_PIN)
  218. * M909 - Print digipot/DAC current value. (Requires DAC_STEPPER_CURRENT)
  219. * M910 - Commit digipot/DAC value to external EEPROM via I2C. (Requires DAC_STEPPER_CURRENT)
  220. * M911 - Report stepper driver overtemperature pre-warn condition. (Requires HAVE_TMC2130 or HAVE_TMC2208)
  221. * M912 - Clear stepper driver overtemperature pre-warn condition flag. (Requires HAVE_TMC2130 or HAVE_TMC2208)
  222. * M913 - Set HYBRID_THRESHOLD speed. (Requires HYBRID_THRESHOLD)
  223. * M914 - Set SENSORLESS_HOMING sensitivity. (Requires SENSORLESS_HOMING)
  224. *
  225. * M360 - SCARA calibration: Move to cal-position ThetaA (0 deg calibration)
  226. * M361 - SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree)
  227. * M362 - SCARA calibration: Move to cal-position PsiA (0 deg calibration)
  228. * M363 - SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree)
  229. * M364 - SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position)
  230. *
  231. * ************ Custom codes - This can change to suit future G-code regulations
  232. * M928 - Start SD logging: "M928 filename.gco". Stop with M29. (Requires SDSUPPORT)
  233. * M999 - Restart after being stopped by error
  234. *
  235. * "T" Codes
  236. *
  237. * T0-T3 - Select an extruder (tool) by index: "T<n> F<units/min>"
  238. *
  239. */
  240. #ifndef _GCODE_H_
  241. #define _GCODE_H_
  242. #include "../inc/MarlinConfig.h"
  243. #include "parser.h"
  244. #if ENABLED(I2C_POSITION_ENCODERS)
  245. #include "../feature/I2CPositionEncoder.h"
  246. #endif
  247. class GcodeSuite {
  248. public:
  249. GcodeSuite() {}
  250. static uint8_t target_extruder;
  251. static bool axis_relative_modes[];
  252. #if ENABLED(CNC_WORKSPACE_PLANES)
  253. /**
  254. * Workspace planes only apply to G2/G3 moves
  255. * (and "canned cycles" - not a current feature)
  256. */
  257. enum WorkspacePlane { PLANE_XY, PLANE_ZX, PLANE_YZ };
  258. static WorkspacePlane workspace_plane;
  259. #endif
  260. #if ENABLED(CNC_COORDINATE_SYSTEMS)
  261. #define MAX_COORDINATE_SYSTEMS 9
  262. static int8_t active_coordinate_system;
  263. static float coordinate_system[MAX_COORDINATE_SYSTEMS][XYZ];
  264. static bool select_coordinate_system(const int8_t _new);
  265. #endif
  266. static millis_t previous_cmd_ms;
  267. FORCE_INLINE static void refresh_cmd_timeout() { previous_cmd_ms = millis(); }
  268. static bool get_target_extruder_from_command();
  269. static void get_destination_from_command();
  270. static void process_parsed_command();
  271. static void process_next_command();
  272. FORCE_INLINE static void home_all_axes() { G28(true); }
  273. /**
  274. * Multi-stepper support for M92, M201, M203
  275. */
  276. #if ENABLED(DISTINCT_E_FACTORS)
  277. #define GET_TARGET_EXTRUDER() if (gcode.get_target_extruder_from_command()) return
  278. #define TARGET_EXTRUDER gcode.target_extruder
  279. #else
  280. #define GET_TARGET_EXTRUDER() NOOP
  281. #define TARGET_EXTRUDER 0
  282. #endif
  283. #if ENABLED(HOST_KEEPALIVE_FEATURE)
  284. /**
  285. * States for managing Marlin and host communication
  286. * Marlin sends messages if blocked or busy
  287. */
  288. enum MarlinBusyState {
  289. NOT_BUSY, // Not in a handler
  290. IN_HANDLER, // Processing a GCode
  291. IN_PROCESS, // Known to be blocking command input (as in G29)
  292. PAUSED_FOR_USER, // Blocking pending any input
  293. PAUSED_FOR_INPUT // Blocking pending text input (concept)
  294. };
  295. static MarlinBusyState busy_state;
  296. static uint8_t host_keepalive_interval;
  297. static void host_keepalive();
  298. #define KEEPALIVE_STATE(n) gcode.busy_state = gcode.n
  299. #else
  300. #define KEEPALIVE_STATE(n) NOOP
  301. #endif
  302. static void dwell(millis_t time);
  303. private:
  304. static void G0_G1(
  305. #if IS_SCARA
  306. bool fast_move=false
  307. #endif
  308. );
  309. #if ENABLED(ARC_SUPPORT)
  310. static void G2_G3(const bool clockwise);
  311. #endif
  312. static void G4();
  313. #if ENABLED(BEZIER_CURVE_SUPPORT)
  314. static void G5();
  315. #endif
  316. #if ENABLED(FWRETRACT)
  317. static void G10();
  318. static void G11();
  319. #endif
  320. #if ENABLED(NOZZLE_CLEAN_FEATURE)
  321. static void G12();
  322. #endif
  323. #if ENABLED(CNC_WORKSPACE_PLANES)
  324. static void G17();
  325. static void G18();
  326. static void G19();
  327. #endif
  328. #if ENABLED(INCH_MODE_SUPPORT)
  329. static void G20();
  330. static void G21();
  331. #endif
  332. #if ENABLED(G26_MESH_VALIDATION)
  333. static void G26();
  334. #endif
  335. #if ENABLED(NOZZLE_PARK_FEATURE)
  336. static void G27();
  337. #endif
  338. static void G28(const bool always_home_all);
  339. #if HAS_LEVELING
  340. static void G29();
  341. #endif
  342. #if HAS_BED_PROBE
  343. static void G30();
  344. #if ENABLED(Z_PROBE_SLED)
  345. static void G31();
  346. static void G32();
  347. #endif
  348. #endif
  349. #if ENABLED(DELTA_AUTO_CALIBRATION)
  350. static void G33();
  351. #endif
  352. #if ENABLED(G38_PROBE_TARGET)
  353. static void G38(const bool is_38_2);
  354. #endif
  355. #if HAS_MESH
  356. static void G42();
  357. #endif
  358. #if ENABLED(CNC_COORDINATE_SYSTEMS)
  359. bool select_coordinate_system(const int8_t _new);
  360. static void G53();
  361. static void G54();
  362. static void G55();
  363. static void G56();
  364. static void G57();
  365. static void G58();
  366. static void G59();
  367. #endif
  368. static void G92();
  369. #if HAS_RESUME_CONTINUE
  370. static void M0_M1();
  371. #endif
  372. #if ENABLED(SPINDLE_LASER_ENABLE)
  373. static void M3_M4(bool is_M3);
  374. static void M5();
  375. #endif
  376. static void M17();
  377. static void M18_M84();
  378. #if ENABLED(SDSUPPORT)
  379. static void M20();
  380. static void M21();
  381. static void M22();
  382. static void M23();
  383. static void M24();
  384. static void M25();
  385. static void M26();
  386. static void M27();
  387. static void M28();
  388. static void M29();
  389. static void M30();
  390. #endif
  391. static void M31();
  392. #if ENABLED(SDSUPPORT)
  393. static void M32();
  394. #if ENABLED(LONG_FILENAME_HOST_SUPPORT)
  395. static void M33();
  396. #endif
  397. #if ENABLED(SDCARD_SORT_ALPHA) && ENABLED(SDSORT_GCODE)
  398. static void M34();
  399. #endif
  400. #endif
  401. static void M42();
  402. #if ENABLED(PINS_DEBUGGING)
  403. static void M43();
  404. #endif
  405. #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
  406. static void M48();
  407. #endif
  408. #if ENABLED(G26_MESH_VALIDATION)
  409. static void M49();
  410. #endif
  411. #if ENABLED(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY)
  412. static void M73();
  413. #endif
  414. static void M75();
  415. static void M76();
  416. static void M77();
  417. #if ENABLED(PRINTCOUNTER)
  418. static void M78();
  419. #endif
  420. #if HAS_POWER_SWITCH
  421. static void M80();
  422. #endif
  423. static void M81();
  424. static void M82();
  425. static void M83();
  426. static void M85();
  427. static void M92();
  428. #if ENABLED(M100_FREE_MEMORY_WATCHER)
  429. static void M100();
  430. #endif
  431. static void M104();
  432. static void M105();
  433. static void M106();
  434. static void M107();
  435. #if DISABLED(EMERGENCY_PARSER)
  436. static void M108();
  437. static void M112();
  438. static void M410();
  439. #endif
  440. static void M109();
  441. static void M110();
  442. static void M111();
  443. #if ENABLED(HOST_KEEPALIVE_FEATURE)
  444. static void M113();
  445. #endif
  446. static void M114();
  447. static void M115();
  448. static void M117();
  449. static void M118();
  450. static void M119();
  451. static void M120();
  452. static void M121();
  453. #if ENABLED(PARK_HEAD_ON_PAUSE)
  454. static void M125();
  455. #endif
  456. #if ENABLED(BARICUDA)
  457. #if HAS_HEATER_1
  458. static void M126();
  459. static void M127();
  460. #endif
  461. #if HAS_HEATER_2
  462. static void M128();
  463. static void M129();
  464. #endif
  465. #endif
  466. #if HAS_HEATER_BED && HAS_TEMP_BED
  467. static void M140();
  468. static void M190();
  469. #endif
  470. #if ENABLED(ULTIPANEL)
  471. static void M145();
  472. #endif
  473. #if ENABLED(TEMPERATURE_UNITS_SUPPORT)
  474. static void M149();
  475. #endif
  476. #if HAS_COLOR_LEDS
  477. static void M150();
  478. #endif
  479. #if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED)
  480. static void M155();
  481. #endif
  482. #if ENABLED(MIXING_EXTRUDER)
  483. static void M163();
  484. #if MIXING_VIRTUAL_TOOLS > 1
  485. static void M164();
  486. #endif
  487. #if ENABLED(DIRECT_MIXING_IN_G1)
  488. static void M165();
  489. #endif
  490. #endif
  491. static void M200();
  492. static void M201();
  493. #if 0
  494. static void M202(); // Not used for Sprinter/grbl gen6
  495. #endif
  496. static void M203();
  497. static void M204();
  498. static void M205();
  499. #if HAS_M206_COMMAND
  500. static void M206();
  501. #endif
  502. #if ENABLED(FWRETRACT)
  503. static void M207();
  504. static void M208();
  505. static void M209();
  506. #endif
  507. static void M211();
  508. #if HOTENDS > 1
  509. static void M218();
  510. #endif
  511. static void M220();
  512. static void M221();
  513. static void M226();
  514. #if defined(CHDK) || HAS_PHOTOGRAPH
  515. static void M240();
  516. #endif
  517. #if HAS_LCD_CONTRAST
  518. static void M250();
  519. #endif
  520. #if ENABLED(EXPERIMENTAL_I2CBUS)
  521. static void M260();
  522. static void M261();
  523. #endif
  524. #if HAS_SERVOS
  525. static void M280();
  526. #endif
  527. #if ENABLED(BABYSTEPPING)
  528. static void M290();
  529. #endif
  530. #if HAS_BUZZER
  531. static void M300();
  532. #endif
  533. #if ENABLED(PIDTEMP)
  534. static void M301();
  535. #endif
  536. #if ENABLED(PREVENT_COLD_EXTRUSION)
  537. static void M302();
  538. #endif
  539. static void M303();
  540. #if ENABLED(PIDTEMPBED)
  541. static void M304();
  542. #endif
  543. #if HAS_MICROSTEPS
  544. static void M350();
  545. static void M351();
  546. #endif
  547. static void M355();
  548. #if ENABLED(MORGAN_SCARA)
  549. static bool M360();
  550. static bool M361();
  551. static bool M362();
  552. static bool M363();
  553. static bool M364();
  554. #endif
  555. #if ENABLED(EXT_SOLENOID)
  556. static void M380();
  557. static void M381();
  558. #endif
  559. static void M400();
  560. #if HAS_BED_PROBE
  561. static void M401();
  562. static void M402();
  563. #endif
  564. #if ENABLED(FILAMENT_WIDTH_SENSOR)
  565. static void M404();
  566. static void M405();
  567. static void M406();
  568. static void M407();
  569. #endif
  570. #if HAS_LEVELING
  571. static void M420();
  572. static void M421();
  573. #endif
  574. #if HAS_M206_COMMAND
  575. static void M428();
  576. #endif
  577. static void M500();
  578. static void M501();
  579. static void M502();
  580. #if DISABLED(DISABLE_M503)
  581. static void M503();
  582. #endif
  583. #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
  584. static void M540();
  585. #endif
  586. #if ENABLED(ADVANCED_PAUSE_FEATURE)
  587. static void M600();
  588. #endif
  589. #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
  590. static void M605();
  591. #endif
  592. #if IS_KINEMATIC
  593. static void M665();
  594. #endif
  595. #if ENABLED(DELTA) || ENABLED(Z_DUAL_ENDSTOPS)
  596. static void M666();
  597. #endif
  598. #if ENABLED(MK2_MULTIPLEXER)
  599. static void M702();
  600. #endif
  601. #if HAS_BED_PROBE
  602. static void M851();
  603. #endif
  604. #if ENABLED(SKEW_CORRECTION_GCODE)
  605. static void M852();
  606. #endif
  607. #if ENABLED(I2C_POSITION_ENCODERS)
  608. FORCE_INLINE static void M860() { I2CPEM.M860(); }
  609. FORCE_INLINE static void M861() { I2CPEM.M861(); }
  610. FORCE_INLINE static void M862() { I2CPEM.M862(); }
  611. FORCE_INLINE static void M863() { I2CPEM.M863(); }
  612. FORCE_INLINE static void M864() { I2CPEM.M864(); }
  613. FORCE_INLINE static void M865() { I2CPEM.M865(); }
  614. FORCE_INLINE static void M866() { I2CPEM.M866(); }
  615. FORCE_INLINE static void M867() { I2CPEM.M867(); }
  616. FORCE_INLINE static void M868() { I2CPEM.M868(); }
  617. FORCE_INLINE static void M869() { I2CPEM.M869(); }
  618. #endif
  619. #if ENABLED(LIN_ADVANCE)
  620. static void M900();
  621. #endif
  622. #if HAS_TRINAMIC
  623. #if ENABLED(TMC_DEBUG)
  624. static void M122();
  625. #endif
  626. static void M906();
  627. static void M911();
  628. static void M912();
  629. #if ENABLED(HYBRID_THRESHOLD)
  630. static void M913();
  631. #endif
  632. #if ENABLED(SENSORLESS_HOMING)
  633. static void M914();
  634. #endif
  635. #if ENABLED(TMC_Z_CALIBRATION)
  636. static void M915();
  637. #endif
  638. #endif
  639. #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || ENABLED(DIGIPOT_I2C) || ENABLED(DAC_STEPPER_CURRENT)
  640. static void M907();
  641. #if HAS_DIGIPOTSS || ENABLED(DAC_STEPPER_CURRENT)
  642. static void M908();
  643. #if ENABLED(DAC_STEPPER_CURRENT)
  644. static void M909();
  645. static void M910();
  646. #endif
  647. #endif
  648. #endif
  649. #if ENABLED(SDSUPPORT)
  650. static void M928();
  651. #endif
  652. static void M999();
  653. static void T(const uint8_t tmp_extruder);
  654. };
  655. extern GcodeSuite gcode;
  656. #endif // _GCODE_H_