Browse Source

User Command (Script) Menu

The menu (commands / scripts) is configurable in `Configuration_adv.h`.

- Added conditionals.
- Changed script handling.
- Slimmed and working!
- Added Status message.
- Returning to lcd status screen now!
- Example Configs Updated.
- Cleanups by @thinkyhead
pull/1/head
Tannoo 8 years ago
committed by Scott Lahteine
parent
commit
74d6dee920
  1. 1
      .travis.yml
  2. 23
      Marlin/Configuration_adv.h
  3. 23
      Marlin/example_configurations/Cartesio/Configuration_adv.h
  4. 23
      Marlin/example_configurations/Felix/Configuration_adv.h
  5. 23
      Marlin/example_configurations/FolgerTech-i3-2020/Configuration_adv.h
  6. 23
      Marlin/example_configurations/Hephestos/Configuration_adv.h
  7. 23
      Marlin/example_configurations/Hephestos_2/Configuration_adv.h
  8. 23
      Marlin/example_configurations/K8200/Configuration_adv.h
  9. 23
      Marlin/example_configurations/K8400/Configuration_adv.h
  10. 23
      Marlin/example_configurations/RigidBot/Configuration_adv.h
  11. 23
      Marlin/example_configurations/SCARA/Configuration_adv.h
  12. 23
      Marlin/example_configurations/TAZ4/Configuration_adv.h
  13. 23
      Marlin/example_configurations/TinyBoy2/Configuration_adv.h
  14. 23
      Marlin/example_configurations/WITBOX/Configuration_adv.h
  15. 23
      Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h
  16. 23
      Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h
  17. 23
      Marlin/example_configurations/delta/generic/Configuration_adv.h
  18. 23
      Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
  19. 23
      Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
  20. 23
      Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
  21. 23
      Marlin/example_configurations/gCreate_gMax1.5+/Configuration_adv.h
  22. 23
      Marlin/example_configurations/makibox/Configuration_adv.h
  23. 23
      Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
  24. 23
      Marlin/example_configurations/wt150/Configuration_adv.h
  25. 3
      Marlin/language_en.h
  26. 56
      Marlin/ultralcd.cpp

1
.travis.yml

@ -126,6 +126,7 @@ script:
# #
- restore_configs - restore_configs
- opt_enable AUTO_BED_LEVELING_UBL UBL_G26_MESH_EDITING ENABLE_LEVELING_FADE_HEIGHT FIX_MOUNTED_PROBE EEPROM_SETTINGS G3D_PANEL - opt_enable AUTO_BED_LEVELING_UBL UBL_G26_MESH_EDITING ENABLE_LEVELING_FADE_HEIGHT FIX_MOUNTED_PROBE EEPROM_SETTINGS G3D_PANEL
- opt_enable_adv CUSTOM_USER_MENUS
- build_marlin - build_marlin
# #
# Test a Sled Z Probe # Test a Sled Z Probe

23
Marlin/Configuration_adv.h

@ -1234,4 +1234,27 @@
*/ */
#define FASTER_GCODE_PARSER #define FASTER_GCODE_PARSER
/**
* User-defined menu items that execute custom GCode
*/
//#define CUSTOM_USER_MENUS
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"
#define USER_DESC_2 "Preheat for PLA"
#define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
#define USER_DESC_3 "Preheat for ABS"
#define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
#define USER_DESC_4 "Heat Bed/Home/Level"
#define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
#define USER_DESC_5 "Home & Info"
#define USER_GCODE_5 "G28\nM503"
#endif
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

23
Marlin/example_configurations/Cartesio/Configuration_adv.h

@ -1227,4 +1227,27 @@
*/ */
#define FASTER_GCODE_PARSER #define FASTER_GCODE_PARSER
/**
* User-defined menu items that execute custom GCode
*/
//#define CUSTOM_USER_MENUS
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"
#define USER_DESC_2 "Preheat for PLA"
#define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
#define USER_DESC_3 "Preheat for ABS"
#define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
#define USER_DESC_4 "Heat Bed/Home/Level"
#define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
#define USER_DESC_5 "Home & Info"
#define USER_GCODE_5 "G28\nM503"
#endif
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

23
Marlin/example_configurations/Felix/Configuration_adv.h

@ -1227,4 +1227,27 @@
*/ */
#define FASTER_GCODE_PARSER #define FASTER_GCODE_PARSER
/**
* User-defined menu items that execute custom GCode
*/
//#define CUSTOM_USER_MENUS
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"
#define USER_DESC_2 "Preheat for PLA"
#define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
#define USER_DESC_3 "Preheat for ABS"
#define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
#define USER_DESC_4 "Heat Bed/Home/Level"
#define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
//#define USER_DESC_5 "Home & Info"
//#define USER_GCODE_5 "G28\nM503"
#endif
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

23
Marlin/example_configurations/FolgerTech-i3-2020/Configuration_adv.h

@ -1240,4 +1240,27 @@
*/ */
#define FASTER_GCODE_PARSER #define FASTER_GCODE_PARSER
/**
* User-defined menu items that execute custom GCode
*/
//#define CUSTOM_USER_MENUS
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"
#define USER_DESC_2 "Preheat for PLA"
#define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
#define USER_DESC_3 "Preheat for ABS"
#define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
#define USER_DESC_4 "Heat Bed/Home/Level"
#define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
//#define USER_DESC_5 "Home & Info"
//#define USER_GCODE_5 "G28\nM503"
#endif
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

23
Marlin/example_configurations/Hephestos/Configuration_adv.h

@ -1227,4 +1227,27 @@
*/ */
#define FASTER_GCODE_PARSER #define FASTER_GCODE_PARSER
/**
* User-defined menu items that execute custom GCode
*/
//#define CUSTOM_USER_MENUS
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"
#define USER_DESC_2 "Preheat for PLA"
#define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
#define USER_DESC_3 "Preheat for ABS"
#define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
#define USER_DESC_4 "Heat Bed/Home/Level"
#define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
//#define USER_DESC_5 "Home & Info"
//#define USER_GCODE_5 "G28\nM503"
#endif
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

23
Marlin/example_configurations/Hephestos_2/Configuration_adv.h

@ -1211,4 +1211,27 @@
*/ */
#define FASTER_GCODE_PARSER #define FASTER_GCODE_PARSER
/**
* User-defined menu items that execute custom GCode
*/
//#define CUSTOM_USER_MENUS
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"
#define USER_DESC_2 "Preheat for PLA"
#define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
#define USER_DESC_3 "Preheat for ABS"
#define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
#define USER_DESC_4 "Heat Bed/Home/Level"
#define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
//#define USER_DESC_5 "Home & Info"
//#define USER_GCODE_5 "G28\nM503"
#endif
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

23
Marlin/example_configurations/K8200/Configuration_adv.h

@ -1240,4 +1240,27 @@
*/ */
#define FASTER_GCODE_PARSER #define FASTER_GCODE_PARSER
/**
* User-defined menu items that execute custom GCode
*/
//#define CUSTOM_USER_MENUS
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"
#define USER_DESC_2 "Preheat for PLA"
#define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
#define USER_DESC_3 "Preheat for ABS"
#define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
#define USER_DESC_4 "Heat Bed/Home/Level"
#define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
//#define USER_DESC_5 "Home & Info"
//#define USER_GCODE_5 "G28\nM503"
#endif
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

23
Marlin/example_configurations/K8400/Configuration_adv.h

@ -1227,4 +1227,27 @@
*/ */
#define FASTER_GCODE_PARSER #define FASTER_GCODE_PARSER
/**
* User-defined menu items that execute custom GCode
*/
//#define CUSTOM_USER_MENUS
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"
#define USER_DESC_2 "Preheat for PLA"
#define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
#define USER_DESC_3 "Preheat for ABS"
#define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
#define USER_DESC_4 "Heat Bed/Home/Level"
#define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
//#define USER_DESC_5 "Home & Info"
//#define USER_GCODE_5 "G28\nM503"
#endif
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

23
Marlin/example_configurations/RigidBot/Configuration_adv.h

@ -1227,4 +1227,27 @@
*/ */
#define FASTER_GCODE_PARSER #define FASTER_GCODE_PARSER
/**
* User-defined menu items that execute custom GCode
*/
//#define CUSTOM_USER_MENUS
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"
#define USER_DESC_2 "Preheat for PLA"
#define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
#define USER_DESC_3 "Preheat for ABS"
#define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
#define USER_DESC_4 "Heat Bed/Home/Level"
#define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
//#define USER_DESC_5 "Home & Info"
//#define USER_GCODE_5 "G28\nM503"
#endif
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

23
Marlin/example_configurations/SCARA/Configuration_adv.h

@ -1227,4 +1227,27 @@
*/ */
#define FASTER_GCODE_PARSER #define FASTER_GCODE_PARSER
/**
* User-defined menu items that execute custom GCode
*/
//#define CUSTOM_USER_MENUS
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"
#define USER_DESC_2 "Preheat for PLA"
#define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
#define USER_DESC_3 "Preheat for ABS"
#define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
#define USER_DESC_4 "Heat Bed/Home/Level"
#define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
//#define USER_DESC_5 "Home & Info"
//#define USER_GCODE_5 "G28\nM503"
#endif
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

23
Marlin/example_configurations/TAZ4/Configuration_adv.h

@ -1227,4 +1227,27 @@
*/ */
#define FASTER_GCODE_PARSER #define FASTER_GCODE_PARSER
/**
* User-defined menu items that execute custom GCode
*/
//#define CUSTOM_USER_MENUS
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"
#define USER_DESC_2 "Preheat for PLA"
#define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
#define USER_DESC_3 "Preheat for ABS"
#define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
#define USER_DESC_4 "Heat Bed/Home/Level"
#define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
//#define USER_DESC_5 "Home & Info"
//#define USER_GCODE_5 "G28\nM503"
#endif
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

23
Marlin/example_configurations/TinyBoy2/Configuration_adv.h

@ -1230,4 +1230,27 @@
*/ */
#define FASTER_GCODE_PARSER #define FASTER_GCODE_PARSER
/**
* User-defined menu items that execute custom GCode
*/
//#define CUSTOM_USER_MENUS
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"
#define USER_DESC_2 "Preheat for PLA"
#define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
#define USER_DESC_3 "Preheat for ABS"
#define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
#define USER_DESC_4 "Heat Bed/Home/Level"
#define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
//#define USER_DESC_5 "Home & Info"
//#define USER_GCODE_5 "G28\nM503"
#endif
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

23
Marlin/example_configurations/WITBOX/Configuration_adv.h

@ -1227,4 +1227,27 @@
*/ */
#define FASTER_GCODE_PARSER #define FASTER_GCODE_PARSER
/**
* User-defined menu items that execute custom GCode
*/
//#define CUSTOM_USER_MENUS
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"
#define USER_DESC_2 "Preheat for PLA"
#define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
#define USER_DESC_3 "Preheat for ABS"
#define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
#define USER_DESC_4 "Heat Bed/Home/Level"
#define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
//#define USER_DESC_5 "Home & Info"
//#define USER_GCODE_5 "G28\nM503"
#endif
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

23
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h

@ -1232,4 +1232,27 @@
*/ */
#define FASTER_GCODE_PARSER #define FASTER_GCODE_PARSER
/**
* User-defined menu items that execute custom GCode
*/
//#define CUSTOM_USER_MENUS
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"
#define USER_DESC_2 "Preheat for PLA"
#define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
#define USER_DESC_3 "Preheat for ABS"
#define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
#define USER_DESC_4 "Heat Bed/Home/Level"
#define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
#define USER_DESC_5 "Home & Info"
#define USER_GCODE_5 "G28\nM503"
#endif
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

23
Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h

@ -1231,4 +1231,27 @@
*/ */
#define FASTER_GCODE_PARSER #define FASTER_GCODE_PARSER
/**
* User-defined menu items that execute custom GCode
*/
//#define CUSTOM_USER_MENUS
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"
#define USER_DESC_2 "Preheat for PLA"
#define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
#define USER_DESC_3 "Preheat for ABS"
#define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
#define USER_DESC_4 "Heat Bed/Home/Level"
#define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
#define USER_DESC_5 "Home & Info"
#define USER_GCODE_5 "G28\nM503"
#endif
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

23
Marlin/example_configurations/delta/generic/Configuration_adv.h

@ -1229,4 +1229,27 @@
*/ */
#define FASTER_GCODE_PARSER #define FASTER_GCODE_PARSER
/**
* User-defined menu items that execute custom GCode
*/
//#define CUSTOM_USER_MENUS
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"
#define USER_DESC_2 "Preheat for PLA"
#define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
#define USER_DESC_3 "Preheat for ABS"
#define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
#define USER_DESC_4 "Heat Bed/Home/Level"
#define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
#define USER_DESC_5 "Home & Info"
#define USER_GCODE_5 "G28\nM503"
#endif
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

23
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h

@ -1229,4 +1229,27 @@
*/ */
#define FASTER_GCODE_PARSER #define FASTER_GCODE_PARSER
/**
* User-defined menu items that execute custom GCode
*/
//#define CUSTOM_USER_MENUS
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"
#define USER_DESC_2 "Preheat for PLA"
#define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
#define USER_DESC_3 "Preheat for ABS"
#define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
#define USER_DESC_4 "Heat Bed/Home/Level"
#define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
#define USER_DESC_5 "Home & Info"
#define USER_GCODE_5 "G28\nM503"
#endif
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

23
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h

@ -1234,4 +1234,27 @@
*/ */
#define FASTER_GCODE_PARSER #define FASTER_GCODE_PARSER
/**
* User-defined menu items that execute custom GCode
*/
//#define CUSTOM_USER_MENUS
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"
#define USER_DESC_2 "Preheat for PLA"
#define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
#define USER_DESC_3 "Preheat for ABS"
#define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
#define USER_DESC_4 "Heat Bed/Home/Level"
#define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
#define USER_DESC_5 "Home & Info"
#define USER_GCODE_5 "G28\nM503"
#endif
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

23
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h

@ -1229,4 +1229,27 @@
*/ */
#define FASTER_GCODE_PARSER #define FASTER_GCODE_PARSER
/**
* User-defined menu items that execute custom GCode
*/
//#define CUSTOM_USER_MENUS
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"
#define USER_DESC_2 "Preheat for PLA"
#define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
#define USER_DESC_3 "Preheat for ABS"
#define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
#define USER_DESC_4 "Heat Bed/Home/Level"
#define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
//#define USER_DESC_5 "Home & Info"
//#define USER_GCODE_5 "G28\nM503"
#endif
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

23
Marlin/example_configurations/gCreate_gMax1.5+/Configuration_adv.h

@ -1236,4 +1236,27 @@
*/ */
#define FASTER_GCODE_PARSER #define FASTER_GCODE_PARSER
/**
* User-defined menu items that execute custom GCode
*/
//#define CUSTOM_USER_MENUS
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"
#define USER_DESC_2 "Preheat for PLA"
#define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
#define USER_DESC_3 "Preheat for ABS"
#define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
#define USER_DESC_4 "Heat Bed/Home/Level"
#define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
//#define USER_DESC_5 "Home & Info"
//#define USER_GCODE_5 "G28\nM503"
#endif
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

23
Marlin/example_configurations/makibox/Configuration_adv.h

@ -1227,4 +1227,27 @@
*/ */
#define FASTER_GCODE_PARSER #define FASTER_GCODE_PARSER
/**
* User-defined menu items that execute custom GCode
*/
//#define CUSTOM_USER_MENUS
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"
#define USER_DESC_2 "Preheat for PLA"
#define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
#define USER_DESC_3 "Preheat for ABS"
#define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
#define USER_DESC_4 "Heat Bed/Home/Level"
#define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
//#define USER_DESC_5 "Home & Info"
//#define USER_GCODE_5 "G28\nM503"
#endif
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

23
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h

@ -1227,4 +1227,27 @@
*/ */
#define FASTER_GCODE_PARSER #define FASTER_GCODE_PARSER
/**
* User-defined menu items that execute custom GCode
*/
//#define CUSTOM_USER_MENUS
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"
#define USER_DESC_2 "Preheat for PLA"
#define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
#define USER_DESC_3 "Preheat for ABS"
#define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
#define USER_DESC_4 "Heat Bed/Home/Level"
#define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
//#define USER_DESC_5 "Home & Info"
//#define USER_GCODE_5 "G28\nM503"
#endif
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

23
Marlin/example_configurations/wt150/Configuration_adv.h

@ -1230,4 +1230,27 @@
*/ */
#define FASTER_GCODE_PARSER #define FASTER_GCODE_PARSER
/**
* User-defined menu items that execute custom GCode
*/
//#define CUSTOM_USER_MENUS
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"
#define USER_DESC_2 "Preheat for PLA"
#define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
#define USER_DESC_3 "Preheat for ABS"
#define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
#define USER_DESC_4 "Heat Bed/Home/Level"
#define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
//#define USER_DESC_5 "Home & Info"
//#define USER_GCODE_5 "G28\nM503"
#endif
#endif // CONFIGURATION_ADV_H #endif // CONFIGURATION_ADV_H

3
Marlin/language_en.h

@ -156,6 +156,9 @@
#ifndef MSG_LEVEL_BED #ifndef MSG_LEVEL_BED
#define MSG_LEVEL_BED _UxGT("Level bed") #define MSG_LEVEL_BED _UxGT("Level bed")
#endif #endif
#ifndef MSG_USER_MENU
#define MSG_USER_MENU _UxGT("Custom Commands")
#endif
#if ENABLED(AUTO_BED_LEVELING_UBL) #if ENABLED(AUTO_BED_LEVELING_UBL)
#ifndef MSG_UBL_UNHOMED #ifndef MSG_UBL_UNHOMED

56
Marlin/ultralcd.cpp

@ -789,6 +789,58 @@ void kill_screen(const char* lcd_msg) {
#endif // HAS_DEBUG_MENU #endif // HAS_DEBUG_MENU
#if ENABLED(CUSTOM_USER_MENUS)
#ifdef USER_SCRIPT_DONE
#define _DONE_SCRIPT "\n" USER_SCRIPT_DONE
#else
#define _DONE_SCRIPT ""
#endif
void _lcd_user_gcode(const char * const cmd) {
lcd_return_to_status();
enqueue_and_echo_commands_P(cmd);
}
#if defined(USER_DESC_1) && defined(USER_GCODE_1)
void lcd_user_gcode_1() { _lcd_user_gcode(PSTR(USER_GCODE_1 _DONE_SCRIPT)); }
#endif
#if defined(USER_DESC_2) && defined(USER_GCODE_2)
void lcd_user_gcode_2() { _lcd_user_gcode(PSTR(USER_GCODE_2 _DONE_SCRIPT)); }
#endif
#if defined(USER_DESC_3) && defined(USER_GCODE_3)
void lcd_user_gcode_3() { _lcd_user_gcode(PSTR(USER_GCODE_3 _DONE_SCRIPT)); }
#endif
#if defined(USER_DESC_4) && defined(USER_GCODE_4)
void lcd_user_gcode_4() { _lcd_user_gcode(PSTR(USER_GCODE_4 _DONE_SCRIPT)); }
#endif
#if defined(USER_DESC_5) && defined(USER_GCODE_5)
void lcd_user_gcode_5() { _lcd_user_gcode(PSTR(USER_GCODE_5 _DONE_SCRIPT)); }
#endif
void _lcd_user_menu() {
START_MENU();
MENU_BACK(MSG_MAIN);
#if defined(USER_DESC_1) && defined(USER_GCODE_1)
MENU_ITEM(function, USER_DESC_1, lcd_user_gcode_1);
#endif
#if defined(USER_DESC_2) && defined(USER_GCODE_2)
MENU_ITEM(function, USER_DESC_2, lcd_user_gcode_2);
#endif
#if defined(USER_DESC_3) && defined(USER_GCODE_3)
MENU_ITEM(function, USER_DESC_3, lcd_user_gcode_3);
#endif
#if defined(USER_DESC_4) && defined(USER_GCODE_4)
MENU_ITEM(function, USER_DESC_4, lcd_user_gcode_4);
#endif
#if defined(USER_DESC_5) && defined(USER_GCODE_5)
MENU_ITEM(function, USER_DESC_5, lcd_user_gcode_5);
#endif
END_MENU();
}
#endif
/** /**
* *
* "Main" menu * "Main" menu
@ -804,6 +856,10 @@ void kill_screen(const char* lcd_msg) {
START_MENU(); START_MENU();
MENU_BACK(MSG_WATCH); MENU_BACK(MSG_WATCH);
#if ENABLED(CUSTOM_USER_MENUS)
MENU_ITEM(submenu, MSG_USER_MENU, _lcd_user_menu);
#endif
// //
// Debug Menu when certain options are enabled // Debug Menu when certain options are enabled
// //

Loading…
Cancel
Save