From b60abc7c378e47959fb11f890d49ee7e90588d3d Mon Sep 17 00:00:00 2001 From: revilor Date: Fri, 9 Nov 2018 12:25:08 +0100 Subject: [PATCH] [2.0.x] Macro G-codes (#9365) --- Marlin/Configuration_adv.h | 12 ++++ Marlin/src/config/default/Configuration_adv.h | 12 ++++ .../AlephObjects/TAZ4/Configuration_adv.h | 12 ++++ .../examples/Anet/A2/Configuration_adv.h | 12 ++++ .../examples/Anet/A2plus/Configuration_adv.h | 12 ++++ .../examples/Anet/A6/Configuration_adv.h | 12 ++++ .../examples/Anet/A8/Configuration_adv.h | 12 ++++ .../config/examples/ArmEd/Configuration_adv.h | 12 ++++ .../BIBO/TouchX/cyclops/Configuration_adv.h | 12 ++++ .../BIBO/TouchX/default/Configuration_adv.h | 12 ++++ .../examples/BQ/Hephestos/Configuration_adv.h | 12 ++++ .../BQ/Hephestos_2/Configuration_adv.h | 13 ++++ .../examples/BQ/WITBOX/Configuration_adv.h | 12 ++++ .../examples/Cartesio/Configuration_adv.h | 12 ++++ .../Creality/CR-10/Configuration_adv.h | 12 ++++ .../Creality/CR-10S/Configuration_adv.h | 12 ++++ .../Creality/CR-10mini/Configuration_adv.h | 12 ++++ .../Creality/CR-8/Configuration_adv.h | 12 ++++ .../Creality/Ender-2/Configuration_adv.h | 12 ++++ .../Creality/Ender-3/Configuration_adv.h | 12 ++++ .../Creality/Ender-4/Configuration_adv.h | 12 ++++ .../examples/Einstart-S/Configuration_adv.h | 12 ++++ .../config/examples/Felix/Configuration_adv.h | 12 ++++ .../FolgerTech/i3-2020/Configuration_adv.h | 12 ++++ .../Formbot/Raptor/Configuration_adv.h | 12 ++++ .../Formbot/T_Rex_2+/Configuration_adv.h | 12 ++++ .../Formbot/T_Rex_3/Configuration_adv.h | 12 ++++ .../Geeetech/MeCreator2/Configuration_adv.h | 12 ++++ .../Prusa i3 Pro C/Configuration_adv.h | 12 ++++ .../Prusa i3 Pro W/Configuration_adv.h | 12 ++++ .../Infitary/i3-M508/Configuration_adv.h | 12 ++++ .../examples/JGAurora/A5/Configuration_adv.h | 12 ++++ .../examples/MakerParts/Configuration_adv.h | 12 ++++ .../examples/Malyan/M150/Configuration_adv.h | 12 ++++ .../examples/Malyan/M200/Configuration_adv.h | 12 ++++ .../Micromake/C1/enhanced/Configuration_adv.h | 12 ++++ .../examples/Mks/Sbase/Configuration_adv.h | 12 ++++ .../examples/RigidBot/Configuration_adv.h | 12 ++++ .../config/examples/SCARA/Configuration_adv.h | 12 ++++ .../examples/Sanguinololu/Configuration_adv.h | 12 ++++ .../examples/TheBorg/Configuration_adv.h | 12 ++++ .../examples/TinyBoy2/Configuration_adv.h | 12 ++++ .../examples/Tronxy/X3A/Configuration_adv.h | 12 ++++ .../UltiMachine/Archim2/Configuration_adv.h | 12 ++++ .../Velleman/K8200/Configuration_adv.h | 12 ++++ .../Velleman/K8400/Configuration_adv.h | 12 ++++ .../Wanhao/Duplicator 6/Configuration_adv.h | 12 ++++ .../delta/Anycubic/Kossel/Configuration_adv.h | 12 ++++ .../FLSUN/auto_calibrate/Configuration_adv.h | 12 ++++ .../delta/FLSUN/kossel/Configuration_adv.h | 12 ++++ .../FLSUN/kossel_mini/Configuration_adv.h | 12 ++++ .../Geeetech/Rostock 301/Configuration_adv.h | 12 ++++ .../delta/generic/Configuration_adv.h | 12 ++++ .../delta/kossel_mini/Configuration_adv.h | 12 ++++ .../delta/kossel_xl/Configuration_adv.h | 12 ++++ .../gCreate/gMax1.5+/Configuration_adv.h | 12 ++++ .../examples/makibox/Configuration_adv.h | 12 ++++ .../tvrrug/Round2/Configuration_adv.h | 12 ++++ .../config/examples/wt150/Configuration_adv.h | 12 ++++ Marlin/src/gcode/feature/macro/M810-M819.cpp | 67 +++++++++++++++++++ Marlin/src/gcode/gcode.cpp | 6 ++ Marlin/src/gcode/gcode.h | 9 ++- Marlin/src/gcode/parser.cpp | 9 ++- Marlin/src/gcode/queue.cpp | 4 +- Marlin/src/inc/Conditionals_post.h | 2 +- Marlin/src/inc/SanityCheck.h | 4 ++ buildroot/share/tests/teensy35_tests | 1 + 67 files changed, 806 insertions(+), 5 deletions(-) create mode 100644 Marlin/src/gcode/feature/macro/M810-M819.cpp diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index de9c1015b6..e9c273780b 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1691,6 +1691,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/default/Configuration_adv.h b/Marlin/src/config/default/Configuration_adv.h index de9c1015b6..e9c273780b 100755 --- a/Marlin/src/config/default/Configuration_adv.h +++ b/Marlin/src/config/default/Configuration_adv.h @@ -1691,6 +1691,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h index 9a66d6906e..970b201cdb 100644 --- a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h +++ b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Anet/A2/Configuration_adv.h b/Marlin/src/config/examples/Anet/A2/Configuration_adv.h index 15899240fc..2ff456d28a 100644 --- a/Marlin/src/config/examples/Anet/A2/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A2/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Anet/A2plus/Configuration_adv.h b/Marlin/src/config/examples/Anet/A2plus/Configuration_adv.h index 15899240fc..2ff456d28a 100644 --- a/Marlin/src/config/examples/Anet/A2plus/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A2plus/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Anet/A6/Configuration_adv.h b/Marlin/src/config/examples/Anet/A6/Configuration_adv.h index e44b750918..c49c0f9aa8 100644 --- a/Marlin/src/config/examples/Anet/A6/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A6/Configuration_adv.h @@ -1689,6 +1689,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Anet/A8/Configuration_adv.h b/Marlin/src/config/examples/Anet/A8/Configuration_adv.h index 960f71758d..62a4127bf1 100644 --- a/Marlin/src/config/examples/Anet/A8/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A8/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/ArmEd/Configuration_adv.h b/Marlin/src/config/examples/ArmEd/Configuration_adv.h index b0259df42b..c8c823e333 100644 --- a/Marlin/src/config/examples/ArmEd/Configuration_adv.h +++ b/Marlin/src/config/examples/ArmEd/Configuration_adv.h @@ -1664,6 +1664,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h b/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h index 0290c42d17..b77d57bbbf 100644 --- a/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h +++ b/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h @@ -1689,6 +1689,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h b/Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h index 83c2de2feb..87426b386d 100644 --- a/Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h +++ b/Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h b/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h index e4c67c895a..6b02701fc5 100644 --- a/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h index 9fdf4e4282..0e46abc1be 100644 --- a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h @@ -1697,6 +1697,19 @@ #ifdef G0_FEEDRATE //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h b/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h index e4c67c895a..6b02701fc5 100644 --- a/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Cartesio/Configuration_adv.h b/Marlin/src/config/examples/Cartesio/Configuration_adv.h index cd3f217309..0c574a9b88 100644 --- a/Marlin/src/config/examples/Cartesio/Configuration_adv.h +++ b/Marlin/src/config/examples/Cartesio/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h b/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h index 33dca58df6..944ee1db99 100755 --- a/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h @@ -1693,6 +1693,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h b/Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h index 7320d4f91b..9a856c6488 100644 --- a/Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h b/Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h index 417925a2c1..689bb16811 100644 --- a/Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h b/Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h index 5b8d3c5f52..da34a421b4 100644 --- a/Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h b/Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h index 4f38bcae84..d2ff9289b7 100644 --- a/Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h b/Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h index 8a5daeb0a3..6a556568a0 100644 --- a/Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h b/Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h index 4594d85e45..2224cd3c9b 100644 --- a/Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Einstart-S/Configuration_adv.h b/Marlin/src/config/examples/Einstart-S/Configuration_adv.h index 9930139e42..78aacb61c7 100644 --- a/Marlin/src/config/examples/Einstart-S/Configuration_adv.h +++ b/Marlin/src/config/examples/Einstart-S/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Felix/Configuration_adv.h b/Marlin/src/config/examples/Felix/Configuration_adv.h index 6139389992..c425e5e899 100644 --- a/Marlin/src/config/examples/Felix/Configuration_adv.h +++ b/Marlin/src/config/examples/Felix/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h b/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h index 084ef9a075..1b0209a6bc 100644 --- a/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h +++ b/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Formbot/Raptor/Configuration_adv.h b/Marlin/src/config/examples/Formbot/Raptor/Configuration_adv.h index 964de539d7..6be3a02d15 100644 --- a/Marlin/src/config/examples/Formbot/Raptor/Configuration_adv.h +++ b/Marlin/src/config/examples/Formbot/Raptor/Configuration_adv.h @@ -1692,6 +1692,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration_adv.h b/Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration_adv.h index bfff9cd95e..ad385fdcb5 100644 --- a/Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration_adv.h +++ b/Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration_adv.h @@ -1694,6 +1694,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Formbot/T_Rex_3/Configuration_adv.h b/Marlin/src/config/examples/Formbot/T_Rex_3/Configuration_adv.h index b3d423039b..270e6f7e1a 100644 --- a/Marlin/src/config/examples/Formbot/T_Rex_3/Configuration_adv.h +++ b/Marlin/src/config/examples/Formbot/T_Rex_3/Configuration_adv.h @@ -1695,6 +1695,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Geeetech/MeCreator2/Configuration_adv.h b/Marlin/src/config/examples/Geeetech/MeCreator2/Configuration_adv.h index 13b4448e07..0cb4ac4582 100644 --- a/Marlin/src/config/examples/Geeetech/MeCreator2/Configuration_adv.h +++ b/Marlin/src/config/examples/Geeetech/MeCreator2/Configuration_adv.h @@ -1676,6 +1676,18 @@ */ #define FASTER_GCODE_PARSER +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h index 2f9ae9eae3..fb631297b7 100644 --- a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h +++ b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h index 2f9ae9eae3..fb631297b7 100644 --- a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h +++ b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h b/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h index d1ef05b4d9..a310eb1fdb 100644 --- a/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h +++ b/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h b/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h index 0a65c7784a..f731003c22 100644 --- a/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h +++ b/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/MakerParts/Configuration_adv.h b/Marlin/src/config/examples/MakerParts/Configuration_adv.h index c39e91a7ad..672781e4da 100644 --- a/Marlin/src/config/examples/MakerParts/Configuration_adv.h +++ b/Marlin/src/config/examples/MakerParts/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h b/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h index 96e9f21a7b..30062018a5 100644 --- a/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h +++ b/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h b/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h index 49a9126b96..8c1bf6a6e8 100644 --- a/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h +++ b/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h b/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h index d378f46b61..bf26b8846c 100644 --- a/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h +++ b/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h b/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h index b3977b2d75..6f1365bef4 100644 --- a/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h +++ b/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h @@ -1698,6 +1698,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/RigidBot/Configuration_adv.h b/Marlin/src/config/examples/RigidBot/Configuration_adv.h index 9775520b59..b9751f915a 100644 --- a/Marlin/src/config/examples/RigidBot/Configuration_adv.h +++ b/Marlin/src/config/examples/RigidBot/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/SCARA/Configuration_adv.h b/Marlin/src/config/examples/SCARA/Configuration_adv.h index 4a960304b4..81dd0a46d2 100644 --- a/Marlin/src/config/examples/SCARA/Configuration_adv.h +++ b/Marlin/src/config/examples/SCARA/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h b/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h index 4071f721ed..b2fd2efb06 100644 --- a/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h +++ b/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/TheBorg/Configuration_adv.h b/Marlin/src/config/examples/TheBorg/Configuration_adv.h index b4c498c8bd..4b3f85eb86 100644 --- a/Marlin/src/config/examples/TheBorg/Configuration_adv.h +++ b/Marlin/src/config/examples/TheBorg/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h b/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h index 6dfbc99023..e7326dc44c 100644 --- a/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h +++ b/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Tronxy/X3A/Configuration_adv.h b/Marlin/src/config/examples/Tronxy/X3A/Configuration_adv.h index b6a32f3bbe..5e7c1501e1 100644 --- a/Marlin/src/config/examples/Tronxy/X3A/Configuration_adv.h +++ b/Marlin/src/config/examples/Tronxy/X3A/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h b/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h index 4b841c091b..b974fc03f0 100644 --- a/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h +++ b/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h b/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h index 4ca547705b..605bce04a2 100644 --- a/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h +++ b/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h @@ -1703,6 +1703,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h b/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h index 77ffaa1885..2649829f5c 100644 --- a/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h +++ b/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h b/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h index 9a8a234b5b..f30b97a1b6 100644 --- a/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h +++ b/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h @@ -1692,6 +1692,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration_adv.h b/Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration_adv.h index 50c6d08538..376f359d8e 100644 --- a/Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration_adv.h @@ -1692,6 +1692,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h index 4337f6203e..07a7f63035 100644 --- a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h @@ -1692,6 +1692,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h b/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h index 4337f6203e..07a7f63035 100644 --- a/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h @@ -1692,6 +1692,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h index a2a175cdc6..a5bd5af9b7 100644 --- a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h @@ -1692,6 +1692,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h b/Marlin/src/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h index 9dafd9cc85..6835432c59 100644 --- a/Marlin/src/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h @@ -1665,6 +1665,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/delta/generic/Configuration_adv.h b/Marlin/src/config/examples/delta/generic/Configuration_adv.h index a2a175cdc6..a5bd5af9b7 100644 --- a/Marlin/src/config/examples/delta/generic/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/generic/Configuration_adv.h @@ -1692,6 +1692,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h b/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h index a2a175cdc6..a5bd5af9b7 100644 --- a/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h @@ -1692,6 +1692,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h b/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h index 462d51ea90..4c319979b1 100644 --- a/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h @@ -1692,6 +1692,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h index 615fb398fd..1012a6a563 100644 --- a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h +++ b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/makibox/Configuration_adv.h b/Marlin/src/config/examples/makibox/Configuration_adv.h index be1b1c0e48..c28b1ede83 100644 --- a/Marlin/src/config/examples/makibox/Configuration_adv.h +++ b/Marlin/src/config/examples/makibox/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h b/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h index 751914c8ff..0ed22b85f2 100644 --- a/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h @@ -1690,6 +1690,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/wt150/Configuration_adv.h b/Marlin/src/config/examples/wt150/Configuration_adv.h index ac751eb77e..fa46e8f2b7 100644 --- a/Marlin/src/config/examples/wt150/Configuration_adv.h +++ b/Marlin/src/config/examples/wt150/Configuration_adv.h @@ -1691,6 +1691,18 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/gcode/feature/macro/M810-M819.cpp b/Marlin/src/gcode/feature/macro/M810-M819.cpp new file mode 100644 index 0000000000..3e8a0e04b4 --- /dev/null +++ b/Marlin/src/gcode/feature/macro/M810-M819.cpp @@ -0,0 +1,67 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * 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 . + * + */ + +#include "../../../inc/MarlinConfig.h" + +#if ENABLED(GCODE_MACROS) + +#include "../../gcode.h" +#include "../../queue.h" +#include "../../parser.h" + +char gcode_macros[GCODE_MACROS_SLOTS][GCODE_MACROS_SLOT_SIZE + 1] = {{ 0 }}; + +/** + * M810_819: Set/execute a G-code macro. + * + * Usage: + * M810 |... Set Macro 0 to the given commands, separated by the pipe character + * M810 Execute Macro 0 + */ +void GcodeSuite::M810_819() { + const uint8_t index = parser.codenum - 810; + if (index >= GCODE_MACROS_SLOTS) return; + + const size_t len = strlen(parser.string_arg); + + if (len) { + // Set a macro + if (len > GCODE_MACROS_SLOT_SIZE) { + SERIAL_ERROR_START(); + SERIAL_ERRORLNPGM("Macro too long."); + } + else { + char c, *s = parser.string_arg, *d = gcode_macros[index]; + do { + c = *s++; + *d++ = c == '|' ? '\n' : c; + } while (c); + } + } + else { + // Execute a macro + char * const cmd = gcode_macros[index]; + if (strlen(cmd)) process_subcommands_now(cmd); + } +} + +#endif // GCODE_MACROS diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 0d26e86689..1281f4519e 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -624,6 +624,12 @@ void GcodeSuite::process_parsed_command( case 7219: M7219(); break; // M7219: Set LEDs, columns, and rows #endif + #if ENABLED(GCODE_MACROS) + case 810: case 811: case 812: case 813: case 814: + case 815: case 816: case 817: case 818: case 819: + M810_819(); break; // M810-M819: Define/execute G-code macro + #endif + #if ENABLED(LIN_ADVANCE) case 900: M900(); break; // M900: Set advance K factor. #endif diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index 9e3e551ebf..cb29abed56 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -211,8 +211,9 @@ * M605 - Set Dual X-Carriage movement mode: "M605 S [X] [R]". (Requires DUAL_X_CARRIAGE) * M665 - Set delta configurations: "M665 H L R S B X Y Z (Requires DELTA) * M666 - Set/get offsets for delta (Requires DELTA) or dual endstops (Requires [XYZ]_DUAL_ENDSTOPS). - * M701 - Load filament (requires FILAMENT_LOAD_UNLOAD_GCODES) - * M702 - Unload filament (requires FILAMENT_LOAD_UNLOAD_GCODES) + * 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) * M851 - Set Z probe's Z offset in current units. (Negative = below the nozzle.) * M852 - Set skew factors: "M852 [I] [J] [K]". (Requires SKEW_CORRECTION_GCODE, and SKEW_CORRECTION_FOR_Z for IJ) * M860 - Report the position of position encoder modules. @@ -760,6 +761,10 @@ private: static void M7219(); #endif + #if ENABLED(GCODE_MACROS) + static void M810_819(); + #endif + #if HAS_BED_PROBE static void M851(); #endif diff --git a/Marlin/src/gcode/parser.cpp b/Marlin/src/gcode/parser.cpp index 7c3fe76b60..2b678d7e20 100644 --- a/Marlin/src/gcode/parser.cpp +++ b/Marlin/src/gcode/parser.cpp @@ -209,7 +209,14 @@ void GCodeParser::parse(char *p) { #endif // Only use string_arg for these M codes - if (letter == 'M') switch (codenum) { case 23: case 28: case 30: case 117: case 118: case 928: string_arg = p; return; default: break; } + if (letter == 'M') switch (codenum) { + #if ENABLED(GCODE_MACROS) + case 810: case 811: case 812: case 813: case 814: + case 815: case 816: case 817: case 818: case 819: + #endif + case 23: case 28: case 30: case 117: case 118: case 928: string_arg = p; return; + default: break; + } #if ENABLED(DEBUG_GCODE_PARSER) const bool debug = codenum == 800; diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index 57d26dec78..70c2b3e0ce 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -188,7 +188,8 @@ void enqueue_and_echo_commands_P(PGM_P const pgcode) { #if HAS_QUEUE_NOW /** - * Enqueue and return only when commands are actually enqueued + * Enqueue and return only when commands are actually enqueued. + * Never call this from a G-code handler! */ void enqueue_and_echo_command_now(const char* cmd) { while (!enqueue_and_echo_command(cmd)) idle(); @@ -196,6 +197,7 @@ void enqueue_and_echo_commands_P(PGM_P const pgcode) { #if HAS_LCD_QUEUE_NOW /** * Enqueue from program memory and return only when commands are actually enqueued + * Never call this from a G-code handler! */ void enqueue_and_echo_commands_now_P(PGM_P const pgcode) { enqueue_and_echo_commands_P(pgcode); diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index b331c1c236..a20ab25a73 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -1619,7 +1619,7 @@ // If platform requires early initialization of watchdog to properly boot #define EARLY_WATCHDOG (ENABLED(USE_WATCHDOG) && defined(ARDUINO_ARCH_SAM)) -#define USE_EXECUTE_COMMANDS_IMMEDIATE ENABLED(G29_RETRY_AND_RECOVER) +#define USE_EXECUTE_COMMANDS_IMMEDIATE (ENABLED(G29_RETRY_AND_RECOVER) || ENABLED(GCODE_MACROS)) #if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) #define Z_STEPPER_COUNT 3 diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 9199b187fa..2fd385aad2 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1962,3 +1962,7 @@ static_assert(COUNT(sanity_arr_3) <= XYZE_N, "DEFAULT_MAX_ACCELERATION has too m #if ENABLED(SD_FIRMWARE_UPDATE) && !defined(__AVR_ATmega2560__) #error "SD_FIRMWARE_UPDATE requires an ATmega2560-based (Arduino Mega) board." #endif + +#if ENABLED(GCODE_MACROS) && !WITHIN(GCODE_MACROS_SLOTS, 1, 10) + #error "GCODE_MACROS_SLOTS must be a number from 1 to 10." +#endif diff --git a/buildroot/share/tests/teensy35_tests b/buildroot/share/tests/teensy35_tests index abfdc23f1c..185c960c1b 100755 --- a/buildroot/share/tests/teensy35_tests +++ b/buildroot/share/tests/teensy35_tests @@ -35,6 +35,7 @@ exec_test $1 $2 "Teensy3.5 with many features" restore_configs opt_enable EEPROM_SETTINGS \ Z_PROBE_SLED AUTO_BED_LEVELING_LINEAR DEBUG_LEVELING_FEATURE +opt_enable_adv GCODE_MACROS exec_test $1 $2 "Sled Z Probe with Linear leveling" #