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
Tannoo 7 years ago
parent
commit
74d6dee920
26 changed files with 589 additions and 0 deletions
  1. 1
    0
      .travis.yml
  2. 23
    0
      Marlin/Configuration_adv.h
  3. 23
    0
      Marlin/example_configurations/Cartesio/Configuration_adv.h
  4. 23
    0
      Marlin/example_configurations/Felix/Configuration_adv.h
  5. 23
    0
      Marlin/example_configurations/FolgerTech-i3-2020/Configuration_adv.h
  6. 23
    0
      Marlin/example_configurations/Hephestos/Configuration_adv.h
  7. 23
    0
      Marlin/example_configurations/Hephestos_2/Configuration_adv.h
  8. 23
    0
      Marlin/example_configurations/K8200/Configuration_adv.h
  9. 23
    0
      Marlin/example_configurations/K8400/Configuration_adv.h
  10. 23
    0
      Marlin/example_configurations/RigidBot/Configuration_adv.h
  11. 23
    0
      Marlin/example_configurations/SCARA/Configuration_adv.h
  12. 23
    0
      Marlin/example_configurations/TAZ4/Configuration_adv.h
  13. 23
    0
      Marlin/example_configurations/TinyBoy2/Configuration_adv.h
  14. 23
    0
      Marlin/example_configurations/WITBOX/Configuration_adv.h
  15. 23
    0
      Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h
  16. 23
    0
      Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h
  17. 23
    0
      Marlin/example_configurations/delta/generic/Configuration_adv.h
  18. 23
    0
      Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
  19. 23
    0
      Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
  20. 23
    0
      Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
  21. 23
    0
      Marlin/example_configurations/gCreate_gMax1.5+/Configuration_adv.h
  22. 23
    0
      Marlin/example_configurations/makibox/Configuration_adv.h
  23. 23
    0
      Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
  24. 23
    0
      Marlin/example_configurations/wt150/Configuration_adv.h
  25. 3
    0
      Marlin/language_en.h
  26. 56
    0
      Marlin/ultralcd.cpp

+ 1
- 0
.travis.yml View File

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

+ 23
- 0
Marlin/Configuration_adv.h View File

@@ -1234,4 +1234,27 @@
1234 1234
  */
1235 1235
 #define FASTER_GCODE_PARSER
1236 1236
 
1237
+/**
1238
+ * User-defined menu items that execute custom GCode
1239
+ */
1240
+//#define CUSTOM_USER_MENUS
1241
+#if ENABLED(CUSTOM_USER_MENUS)
1242
+  #define USER_SCRIPT_DONE "M117 User Script Done"
1243
+
1244
+  #define USER_DESC_1 "Home & UBL Info"
1245
+  #define USER_GCODE_1 "G28\nG29 W"
1246
+
1247
+  #define USER_DESC_2 "Preheat for PLA"
1248
+  #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
1249
+
1250
+  #define USER_DESC_3 "Preheat for ABS"
1251
+  #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
1252
+
1253
+  #define USER_DESC_4 "Heat Bed/Home/Level"
1254
+  #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
1255
+
1256
+  #define USER_DESC_5 "Home & Info"
1257
+  #define USER_GCODE_5 "G28\nM503"
1258
+#endif
1259
+
1237 1260
 #endif // CONFIGURATION_ADV_H

+ 23
- 0
Marlin/example_configurations/Cartesio/Configuration_adv.h View File

@@ -1227,4 +1227,27 @@
1227 1227
  */
1228 1228
 #define FASTER_GCODE_PARSER
1229 1229
 
1230
+/**
1231
+ * User-defined menu items that execute custom GCode
1232
+ */
1233
+//#define CUSTOM_USER_MENUS
1234
+#if ENABLED(CUSTOM_USER_MENUS)
1235
+  #define USER_SCRIPT_DONE "M117 User Script Done"
1236
+
1237
+  #define USER_DESC_1 "Home & UBL Info"
1238
+  #define USER_GCODE_1 "G28\nG29 W"
1239
+
1240
+  #define USER_DESC_2 "Preheat for PLA"
1241
+  #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
1242
+
1243
+  #define USER_DESC_3 "Preheat for ABS"
1244
+  #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
1245
+
1246
+  #define USER_DESC_4 "Heat Bed/Home/Level"
1247
+  #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
1248
+
1249
+  #define USER_DESC_5 "Home & Info"
1250
+  #define USER_GCODE_5 "G28\nM503"
1251
+#endif
1252
+
1230 1253
 #endif // CONFIGURATION_ADV_H

+ 23
- 0
Marlin/example_configurations/Felix/Configuration_adv.h View File

@@ -1227,4 +1227,27 @@
1227 1227
  */
1228 1228
 #define FASTER_GCODE_PARSER
1229 1229
 
1230
+/**
1231
+ * User-defined menu items that execute custom GCode
1232
+ */
1233
+//#define CUSTOM_USER_MENUS
1234
+#if ENABLED(CUSTOM_USER_MENUS)
1235
+  #define USER_SCRIPT_DONE "M117 User Script Done"
1236
+
1237
+  #define USER_DESC_1 "Home & UBL Info"
1238
+  #define USER_GCODE_1 "G28\nG29 W"
1239
+
1240
+  #define USER_DESC_2 "Preheat for PLA"
1241
+  #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
1242
+
1243
+  #define USER_DESC_3 "Preheat for ABS"
1244
+  #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
1245
+
1246
+  #define USER_DESC_4 "Heat Bed/Home/Level"
1247
+  #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
1248
+
1249
+  //#define USER_DESC_5 "Home & Info"
1250
+  //#define USER_GCODE_5 "G28\nM503"
1251
+#endif
1252
+
1230 1253
 #endif // CONFIGURATION_ADV_H

+ 23
- 0
Marlin/example_configurations/FolgerTech-i3-2020/Configuration_adv.h View File

@@ -1240,4 +1240,27 @@
1240 1240
  */
1241 1241
 #define FASTER_GCODE_PARSER
1242 1242
 
1243
+/**
1244
+ * User-defined menu items that execute custom GCode
1245
+ */
1246
+//#define CUSTOM_USER_MENUS
1247
+#if ENABLED(CUSTOM_USER_MENUS)
1248
+  #define USER_SCRIPT_DONE "M117 User Script Done"
1249
+
1250
+  #define USER_DESC_1 "Home & UBL Info"
1251
+  #define USER_GCODE_1 "G28\nG29 W"
1252
+
1253
+  #define USER_DESC_2 "Preheat for PLA"
1254
+  #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
1255
+
1256
+  #define USER_DESC_3 "Preheat for ABS"
1257
+  #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
1258
+
1259
+  #define USER_DESC_4 "Heat Bed/Home/Level"
1260
+  #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
1261
+
1262
+  //#define USER_DESC_5 "Home & Info"
1263
+  //#define USER_GCODE_5 "G28\nM503"
1264
+#endif
1265
+
1243 1266
 #endif // CONFIGURATION_ADV_H

+ 23
- 0
Marlin/example_configurations/Hephestos/Configuration_adv.h View File

@@ -1227,4 +1227,27 @@
1227 1227
  */
1228 1228
 #define FASTER_GCODE_PARSER
1229 1229
 
1230
+/**
1231
+ * User-defined menu items that execute custom GCode
1232
+ */
1233
+//#define CUSTOM_USER_MENUS
1234
+#if ENABLED(CUSTOM_USER_MENUS)
1235
+  #define USER_SCRIPT_DONE "M117 User Script Done"
1236
+
1237
+  #define USER_DESC_1 "Home & UBL Info"
1238
+  #define USER_GCODE_1 "G28\nG29 W"
1239
+
1240
+  #define USER_DESC_2 "Preheat for PLA"
1241
+  #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
1242
+
1243
+  #define USER_DESC_3 "Preheat for ABS"
1244
+  #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
1245
+
1246
+  #define USER_DESC_4 "Heat Bed/Home/Level"
1247
+  #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
1248
+
1249
+  //#define USER_DESC_5 "Home & Info"
1250
+  //#define USER_GCODE_5 "G28\nM503"
1251
+#endif
1252
+
1230 1253
 #endif // CONFIGURATION_ADV_H

+ 23
- 0
Marlin/example_configurations/Hephestos_2/Configuration_adv.h View File

@@ -1211,4 +1211,27 @@
1211 1211
  */
1212 1212
 #define FASTER_GCODE_PARSER
1213 1213
 
1214
+/**
1215
+ * User-defined menu items that execute custom GCode
1216
+ */
1217
+//#define CUSTOM_USER_MENUS
1218
+#if ENABLED(CUSTOM_USER_MENUS)
1219
+  #define USER_SCRIPT_DONE "M117 User Script Done"
1220
+
1221
+  #define USER_DESC_1 "Home & UBL Info"
1222
+  #define USER_GCODE_1 "G28\nG29 W"
1223
+
1224
+  #define USER_DESC_2 "Preheat for PLA"
1225
+  #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
1226
+
1227
+  #define USER_DESC_3 "Preheat for ABS"
1228
+  #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
1229
+
1230
+  #define USER_DESC_4 "Heat Bed/Home/Level"
1231
+  #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
1232
+
1233
+  //#define USER_DESC_5 "Home & Info"
1234
+  //#define USER_GCODE_5 "G28\nM503"
1235
+#endif
1236
+
1214 1237
 #endif // CONFIGURATION_ADV_H

+ 23
- 0
Marlin/example_configurations/K8200/Configuration_adv.h View File

@@ -1240,4 +1240,27 @@
1240 1240
  */
1241 1241
 #define FASTER_GCODE_PARSER
1242 1242
 
1243
+/**
1244
+ * User-defined menu items that execute custom GCode
1245
+ */
1246
+//#define CUSTOM_USER_MENUS
1247
+#if ENABLED(CUSTOM_USER_MENUS)
1248
+  #define USER_SCRIPT_DONE "M117 User Script Done"
1249
+
1250
+  #define USER_DESC_1 "Home & UBL Info"
1251
+  #define USER_GCODE_1 "G28\nG29 W"
1252
+
1253
+  #define USER_DESC_2 "Preheat for PLA"
1254
+  #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
1255
+
1256
+  #define USER_DESC_3 "Preheat for ABS"
1257
+  #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
1258
+
1259
+  #define USER_DESC_4 "Heat Bed/Home/Level"
1260
+  #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
1261
+
1262
+  //#define USER_DESC_5 "Home & Info"
1263
+  //#define USER_GCODE_5 "G28\nM503"
1264
+#endif
1265
+
1243 1266
 #endif // CONFIGURATION_ADV_H

+ 23
- 0
Marlin/example_configurations/K8400/Configuration_adv.h View File

@@ -1227,4 +1227,27 @@
1227 1227
  */
1228 1228
 #define FASTER_GCODE_PARSER
1229 1229
 
1230
+/**
1231
+ * User-defined menu items that execute custom GCode
1232
+ */
1233
+//#define CUSTOM_USER_MENUS
1234
+#if ENABLED(CUSTOM_USER_MENUS)
1235
+  #define USER_SCRIPT_DONE "M117 User Script Done"
1236
+
1237
+  #define USER_DESC_1 "Home & UBL Info"
1238
+  #define USER_GCODE_1 "G28\nG29 W"
1239
+
1240
+  #define USER_DESC_2 "Preheat for PLA"
1241
+  #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
1242
+
1243
+  #define USER_DESC_3 "Preheat for ABS"
1244
+  #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
1245
+
1246
+  #define USER_DESC_4 "Heat Bed/Home/Level"
1247
+  #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
1248
+
1249
+  //#define USER_DESC_5 "Home & Info"
1250
+  //#define USER_GCODE_5 "G28\nM503"
1251
+#endif
1252
+
1230 1253
 #endif // CONFIGURATION_ADV_H

+ 23
- 0
Marlin/example_configurations/RigidBot/Configuration_adv.h View File

@@ -1227,4 +1227,27 @@
1227 1227
  */
1228 1228
 #define FASTER_GCODE_PARSER
1229 1229
 
1230
+/**
1231
+ * User-defined menu items that execute custom GCode
1232
+ */
1233
+//#define CUSTOM_USER_MENUS
1234
+#if ENABLED(CUSTOM_USER_MENUS)
1235
+  #define USER_SCRIPT_DONE "M117 User Script Done"
1236
+
1237
+  #define USER_DESC_1 "Home & UBL Info"
1238
+  #define USER_GCODE_1 "G28\nG29 W"
1239
+
1240
+  #define USER_DESC_2 "Preheat for PLA"
1241
+  #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
1242
+
1243
+  #define USER_DESC_3 "Preheat for ABS"
1244
+  #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
1245
+
1246
+  #define USER_DESC_4 "Heat Bed/Home/Level"
1247
+  #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
1248
+
1249
+  //#define USER_DESC_5 "Home & Info"
1250
+  //#define USER_GCODE_5 "G28\nM503"
1251
+#endif
1252
+
1230 1253
 #endif // CONFIGURATION_ADV_H

+ 23
- 0
Marlin/example_configurations/SCARA/Configuration_adv.h View File

@@ -1227,4 +1227,27 @@
1227 1227
  */
1228 1228
 #define FASTER_GCODE_PARSER
1229 1229
 
1230
+/**
1231
+ * User-defined menu items that execute custom GCode
1232
+ */
1233
+//#define CUSTOM_USER_MENUS
1234
+#if ENABLED(CUSTOM_USER_MENUS)
1235
+  #define USER_SCRIPT_DONE "M117 User Script Done"
1236
+
1237
+  #define USER_DESC_1 "Home & UBL Info"
1238
+  #define USER_GCODE_1 "G28\nG29 W"
1239
+
1240
+  #define USER_DESC_2 "Preheat for PLA"
1241
+  #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
1242
+
1243
+  #define USER_DESC_3 "Preheat for ABS"
1244
+  #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
1245
+
1246
+  #define USER_DESC_4 "Heat Bed/Home/Level"
1247
+  #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
1248
+
1249
+  //#define USER_DESC_5 "Home & Info"
1250
+  //#define USER_GCODE_5 "G28\nM503"
1251
+#endif
1252
+
1230 1253
 #endif // CONFIGURATION_ADV_H

+ 23
- 0
Marlin/example_configurations/TAZ4/Configuration_adv.h View File

@@ -1227,4 +1227,27 @@
1227 1227
  */
1228 1228
 #define FASTER_GCODE_PARSER
1229 1229
 
1230
+/**
1231
+ * User-defined menu items that execute custom GCode
1232
+ */
1233
+//#define CUSTOM_USER_MENUS
1234
+#if ENABLED(CUSTOM_USER_MENUS)
1235
+  #define USER_SCRIPT_DONE "M117 User Script Done"
1236
+
1237
+  #define USER_DESC_1 "Home & UBL Info"
1238
+  #define USER_GCODE_1 "G28\nG29 W"
1239
+
1240
+  #define USER_DESC_2 "Preheat for PLA"
1241
+  #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
1242
+
1243
+  #define USER_DESC_3 "Preheat for ABS"
1244
+  #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
1245
+
1246
+  #define USER_DESC_4 "Heat Bed/Home/Level"
1247
+  #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
1248
+
1249
+  //#define USER_DESC_5 "Home & Info"
1250
+  //#define USER_GCODE_5 "G28\nM503"
1251
+#endif
1252
+
1230 1253
 #endif // CONFIGURATION_ADV_H

+ 23
- 0
Marlin/example_configurations/TinyBoy2/Configuration_adv.h View File

@@ -1230,4 +1230,27 @@
1230 1230
  */
1231 1231
 #define FASTER_GCODE_PARSER
1232 1232
 
1233
+/**
1234
+ * User-defined menu items that execute custom GCode
1235
+ */
1236
+//#define CUSTOM_USER_MENUS
1237
+#if ENABLED(CUSTOM_USER_MENUS)
1238
+  #define USER_SCRIPT_DONE "M117 User Script Done"
1239
+
1240
+  #define USER_DESC_1 "Home & UBL Info"
1241
+  #define USER_GCODE_1 "G28\nG29 W"
1242
+
1243
+  #define USER_DESC_2 "Preheat for PLA"
1244
+  #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
1245
+
1246
+  #define USER_DESC_3 "Preheat for ABS"
1247
+  #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
1248
+
1249
+  #define USER_DESC_4 "Heat Bed/Home/Level"
1250
+  #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
1251
+
1252
+  //#define USER_DESC_5 "Home & Info"
1253
+  //#define USER_GCODE_5 "G28\nM503"
1254
+#endif
1255
+
1233 1256
 #endif // CONFIGURATION_ADV_H

+ 23
- 0
Marlin/example_configurations/WITBOX/Configuration_adv.h View File

@@ -1227,4 +1227,27 @@
1227 1227
  */
1228 1228
 #define FASTER_GCODE_PARSER
1229 1229
 
1230
+/**
1231
+ * User-defined menu items that execute custom GCode
1232
+ */
1233
+//#define CUSTOM_USER_MENUS
1234
+#if ENABLED(CUSTOM_USER_MENUS)
1235
+  #define USER_SCRIPT_DONE "M117 User Script Done"
1236
+
1237
+  #define USER_DESC_1 "Home & UBL Info"
1238
+  #define USER_GCODE_1 "G28\nG29 W"
1239
+
1240
+  #define USER_DESC_2 "Preheat for PLA"
1241
+  #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
1242
+
1243
+  #define USER_DESC_3 "Preheat for ABS"
1244
+  #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
1245
+
1246
+  #define USER_DESC_4 "Heat Bed/Home/Level"
1247
+  #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
1248
+
1249
+  //#define USER_DESC_5 "Home & Info"
1250
+  //#define USER_GCODE_5 "G28\nM503"
1251
+#endif
1252
+
1230 1253
 #endif // CONFIGURATION_ADV_H

+ 23
- 0
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h View File

@@ -1232,4 +1232,27 @@
1232 1232
  */
1233 1233
 #define FASTER_GCODE_PARSER
1234 1234
 
1235
+/**
1236
+ * User-defined menu items that execute custom GCode
1237
+ */
1238
+//#define CUSTOM_USER_MENUS
1239
+#if ENABLED(CUSTOM_USER_MENUS)
1240
+  #define USER_SCRIPT_DONE "M117 User Script Done"
1241
+
1242
+  #define USER_DESC_1 "Home & UBL Info"
1243
+  #define USER_GCODE_1 "G28\nG29 W"
1244
+
1245
+  #define USER_DESC_2 "Preheat for PLA"
1246
+  #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
1247
+
1248
+  #define USER_DESC_3 "Preheat for ABS"
1249
+  #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
1250
+
1251
+  #define USER_DESC_4 "Heat Bed/Home/Level"
1252
+  #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
1253
+
1254
+  #define USER_DESC_5 "Home & Info"
1255
+  #define USER_GCODE_5 "G28\nM503"
1256
+#endif
1257
+
1235 1258
 #endif // CONFIGURATION_ADV_H

+ 23
- 0
Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h View File

@@ -1231,4 +1231,27 @@
1231 1231
  */
1232 1232
 #define FASTER_GCODE_PARSER
1233 1233
 
1234
+/**
1235
+ * User-defined menu items that execute custom GCode
1236
+ */
1237
+//#define CUSTOM_USER_MENUS
1238
+#if ENABLED(CUSTOM_USER_MENUS)
1239
+  #define USER_SCRIPT_DONE "M117 User Script Done"
1240
+
1241
+  #define USER_DESC_1 "Home & UBL Info"
1242
+  #define USER_GCODE_1 "G28\nG29 W"
1243
+
1244
+  #define USER_DESC_2 "Preheat for PLA"
1245
+  #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
1246
+
1247
+  #define USER_DESC_3 "Preheat for ABS"
1248
+  #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
1249
+
1250
+  #define USER_DESC_4 "Heat Bed/Home/Level"
1251
+  #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
1252
+
1253
+  #define USER_DESC_5 "Home & Info"
1254
+  #define USER_GCODE_5 "G28\nM503"
1255
+#endif
1256
+
1234 1257
 #endif // CONFIGURATION_ADV_H

+ 23
- 0
Marlin/example_configurations/delta/generic/Configuration_adv.h View File

@@ -1229,4 +1229,27 @@
1229 1229
  */
1230 1230
 #define FASTER_GCODE_PARSER
1231 1231
 
1232
+/**
1233
+ * User-defined menu items that execute custom GCode
1234
+ */
1235
+//#define CUSTOM_USER_MENUS
1236
+#if ENABLED(CUSTOM_USER_MENUS)
1237
+  #define USER_SCRIPT_DONE "M117 User Script Done"
1238
+
1239
+  #define USER_DESC_1 "Home & UBL Info"
1240
+  #define USER_GCODE_1 "G28\nG29 W"
1241
+
1242
+  #define USER_DESC_2 "Preheat for PLA"
1243
+  #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
1244
+
1245
+  #define USER_DESC_3 "Preheat for ABS"
1246
+  #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
1247
+
1248
+  #define USER_DESC_4 "Heat Bed/Home/Level"
1249
+  #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
1250
+
1251
+  #define USER_DESC_5 "Home & Info"
1252
+  #define USER_GCODE_5 "G28\nM503"
1253
+#endif
1254
+
1232 1255
 #endif // CONFIGURATION_ADV_H

+ 23
- 0
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h View File

@@ -1229,4 +1229,27 @@
1229 1229
  */
1230 1230
 #define FASTER_GCODE_PARSER
1231 1231
 
1232
+/**
1233
+ * User-defined menu items that execute custom GCode
1234
+ */
1235
+//#define CUSTOM_USER_MENUS
1236
+#if ENABLED(CUSTOM_USER_MENUS)
1237
+  #define USER_SCRIPT_DONE "M117 User Script Done"
1238
+
1239
+  #define USER_DESC_1 "Home & UBL Info"
1240
+  #define USER_GCODE_1 "G28\nG29 W"
1241
+
1242
+  #define USER_DESC_2 "Preheat for PLA"
1243
+  #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
1244
+
1245
+  #define USER_DESC_3 "Preheat for ABS"
1246
+  #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
1247
+
1248
+  #define USER_DESC_4 "Heat Bed/Home/Level"
1249
+  #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
1250
+
1251
+  #define USER_DESC_5 "Home & Info"
1252
+  #define USER_GCODE_5 "G28\nM503"
1253
+#endif
1254
+
1232 1255
 #endif // CONFIGURATION_ADV_H

+ 23
- 0
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h View File

@@ -1234,4 +1234,27 @@
1234 1234
  */
1235 1235
 #define FASTER_GCODE_PARSER
1236 1236
 
1237
+/**
1238
+ * User-defined menu items that execute custom GCode
1239
+ */
1240
+//#define CUSTOM_USER_MENUS
1241
+#if ENABLED(CUSTOM_USER_MENUS)
1242
+  #define USER_SCRIPT_DONE "M117 User Script Done"
1243
+
1244
+  #define USER_DESC_1 "Home & UBL Info"
1245
+  #define USER_GCODE_1 "G28\nG29 W"
1246
+
1247
+  #define USER_DESC_2 "Preheat for PLA"
1248
+  #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
1249
+
1250
+  #define USER_DESC_3 "Preheat for ABS"
1251
+  #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
1252
+
1253
+  #define USER_DESC_4 "Heat Bed/Home/Level"
1254
+  #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
1255
+
1256
+  #define USER_DESC_5 "Home & Info"
1257
+  #define USER_GCODE_5 "G28\nM503"
1258
+#endif
1259
+
1237 1260
 #endif // CONFIGURATION_ADV_H

+ 23
- 0
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h View File

@@ -1229,4 +1229,27 @@
1229 1229
  */
1230 1230
 #define FASTER_GCODE_PARSER
1231 1231
 
1232
+/**
1233
+ * User-defined menu items that execute custom GCode
1234
+ */
1235
+//#define CUSTOM_USER_MENUS
1236
+#if ENABLED(CUSTOM_USER_MENUS)
1237
+  #define USER_SCRIPT_DONE "M117 User Script Done"
1238
+
1239
+  #define USER_DESC_1 "Home & UBL Info"
1240
+  #define USER_GCODE_1 "G28\nG29 W"
1241
+
1242
+  #define USER_DESC_2 "Preheat for PLA"
1243
+  #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
1244
+
1245
+  #define USER_DESC_3 "Preheat for ABS"
1246
+  #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
1247
+
1248
+  #define USER_DESC_4 "Heat Bed/Home/Level"
1249
+  #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
1250
+
1251
+  //#define USER_DESC_5 "Home & Info"
1252
+  //#define USER_GCODE_5 "G28\nM503"
1253
+#endif
1254
+
1232 1255
 #endif // CONFIGURATION_ADV_H

+ 23
- 0
Marlin/example_configurations/gCreate_gMax1.5+/Configuration_adv.h View File

@@ -1236,4 +1236,27 @@
1236 1236
  */
1237 1237
 #define FASTER_GCODE_PARSER
1238 1238
 
1239
+/**
1240
+ * User-defined menu items that execute custom GCode
1241
+ */
1242
+//#define CUSTOM_USER_MENUS
1243
+#if ENABLED(CUSTOM_USER_MENUS)
1244
+  #define USER_SCRIPT_DONE "M117 User Script Done"
1245
+
1246
+  #define USER_DESC_1 "Home & UBL Info"
1247
+  #define USER_GCODE_1 "G28\nG29 W"
1248
+
1249
+  #define USER_DESC_2 "Preheat for PLA"
1250
+  #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
1251
+
1252
+  #define USER_DESC_3 "Preheat for ABS"
1253
+  #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
1254
+
1255
+  #define USER_DESC_4 "Heat Bed/Home/Level"
1256
+  #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
1257
+
1258
+  //#define USER_DESC_5 "Home & Info"
1259
+  //#define USER_GCODE_5 "G28\nM503"
1260
+#endif
1261
+
1239 1262
 #endif // CONFIGURATION_ADV_H

+ 23
- 0
Marlin/example_configurations/makibox/Configuration_adv.h View File

@@ -1227,4 +1227,27 @@
1227 1227
  */
1228 1228
 #define FASTER_GCODE_PARSER
1229 1229
 
1230
+/**
1231
+ * User-defined menu items that execute custom GCode
1232
+ */
1233
+//#define CUSTOM_USER_MENUS
1234
+#if ENABLED(CUSTOM_USER_MENUS)
1235
+  #define USER_SCRIPT_DONE "M117 User Script Done"
1236
+
1237
+  #define USER_DESC_1 "Home & UBL Info"
1238
+  #define USER_GCODE_1 "G28\nG29 W"
1239
+
1240
+  #define USER_DESC_2 "Preheat for PLA"
1241
+  #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
1242
+
1243
+  #define USER_DESC_3 "Preheat for ABS"
1244
+  #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
1245
+
1246
+  #define USER_DESC_4 "Heat Bed/Home/Level"
1247
+  #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
1248
+
1249
+  //#define USER_DESC_5 "Home & Info"
1250
+  //#define USER_GCODE_5 "G28\nM503"
1251
+#endif
1252
+
1230 1253
 #endif // CONFIGURATION_ADV_H

+ 23
- 0
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h View File

@@ -1227,4 +1227,27 @@
1227 1227
  */
1228 1228
 #define FASTER_GCODE_PARSER
1229 1229
 
1230
+/**
1231
+ * User-defined menu items that execute custom GCode
1232
+ */
1233
+//#define CUSTOM_USER_MENUS
1234
+#if ENABLED(CUSTOM_USER_MENUS)
1235
+  #define USER_SCRIPT_DONE "M117 User Script Done"
1236
+
1237
+  #define USER_DESC_1 "Home & UBL Info"
1238
+  #define USER_GCODE_1 "G28\nG29 W"
1239
+
1240
+  #define USER_DESC_2 "Preheat for PLA"
1241
+  #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
1242
+
1243
+  #define USER_DESC_3 "Preheat for ABS"
1244
+  #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
1245
+
1246
+  #define USER_DESC_4 "Heat Bed/Home/Level"
1247
+  #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
1248
+
1249
+  //#define USER_DESC_5 "Home & Info"
1250
+  //#define USER_GCODE_5 "G28\nM503"
1251
+#endif
1252
+
1230 1253
 #endif // CONFIGURATION_ADV_H

+ 23
- 0
Marlin/example_configurations/wt150/Configuration_adv.h View File

@@ -1230,4 +1230,27 @@
1230 1230
  */
1231 1231
 #define FASTER_GCODE_PARSER
1232 1232
 
1233
+/**
1234
+ * User-defined menu items that execute custom GCode
1235
+ */
1236
+//#define CUSTOM_USER_MENUS
1237
+#if ENABLED(CUSTOM_USER_MENUS)
1238
+  #define USER_SCRIPT_DONE "M117 User Script Done"
1239
+
1240
+  #define USER_DESC_1 "Home & UBL Info"
1241
+  #define USER_GCODE_1 "G28\nG29 W"
1242
+
1243
+  #define USER_DESC_2 "Preheat for PLA"
1244
+  #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
1245
+
1246
+  #define USER_DESC_3 "Preheat for ABS"
1247
+  #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
1248
+
1249
+  #define USER_DESC_4 "Heat Bed/Home/Level"
1250
+  #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29"
1251
+
1252
+  //#define USER_DESC_5 "Home & Info"
1253
+  //#define USER_GCODE_5 "G28\nM503"
1254
+#endif
1255
+
1233 1256
 #endif // CONFIGURATION_ADV_H

+ 3
- 0
Marlin/language_en.h View File

@@ -156,6 +156,9 @@
156 156
 #ifndef MSG_LEVEL_BED
157 157
   #define MSG_LEVEL_BED                       _UxGT("Level bed")
158 158
 #endif
159
+#ifndef MSG_USER_MENU
160
+  #define MSG_USER_MENU                       _UxGT("Custom Commands")
161
+#endif
159 162
 
160 163
 #if ENABLED(AUTO_BED_LEVELING_UBL)
161 164
   #ifndef MSG_UBL_UNHOMED

+ 56
- 0
Marlin/ultralcd.cpp View File

@@ -789,6 +789,58 @@ void kill_screen(const char* lcd_msg) {
789 789
 
790 790
   #endif // HAS_DEBUG_MENU
791 791
 
792
+  #if ENABLED(CUSTOM_USER_MENUS)
793
+
794
+    #ifdef USER_SCRIPT_DONE
795
+      #define _DONE_SCRIPT "\n" USER_SCRIPT_DONE
796
+    #else
797
+      #define _DONE_SCRIPT ""
798
+    #endif
799
+
800
+    void _lcd_user_gcode(const char * const cmd) {
801
+      lcd_return_to_status();
802
+      enqueue_and_echo_commands_P(cmd);
803
+    }
804
+
805
+    #if defined(USER_DESC_1) && defined(USER_GCODE_1)
806
+      void lcd_user_gcode_1() { _lcd_user_gcode(PSTR(USER_GCODE_1 _DONE_SCRIPT)); }
807
+    #endif
808
+    #if defined(USER_DESC_2) && defined(USER_GCODE_2)
809
+      void lcd_user_gcode_2() { _lcd_user_gcode(PSTR(USER_GCODE_2 _DONE_SCRIPT)); }
810
+    #endif
811
+    #if defined(USER_DESC_3) && defined(USER_GCODE_3)
812
+      void lcd_user_gcode_3() { _lcd_user_gcode(PSTR(USER_GCODE_3 _DONE_SCRIPT)); }
813
+    #endif
814
+    #if defined(USER_DESC_4) && defined(USER_GCODE_4)
815
+      void lcd_user_gcode_4() { _lcd_user_gcode(PSTR(USER_GCODE_4 _DONE_SCRIPT)); }
816
+    #endif
817
+    #if defined(USER_DESC_5) && defined(USER_GCODE_5)
818
+      void lcd_user_gcode_5() { _lcd_user_gcode(PSTR(USER_GCODE_5 _DONE_SCRIPT)); }
819
+    #endif
820
+
821
+    void _lcd_user_menu() {
822
+      START_MENU();
823
+      MENU_BACK(MSG_MAIN);
824
+      #if defined(USER_DESC_1) && defined(USER_GCODE_1)
825
+        MENU_ITEM(function, USER_DESC_1, lcd_user_gcode_1);
826
+      #endif
827
+      #if defined(USER_DESC_2) && defined(USER_GCODE_2)
828
+        MENU_ITEM(function, USER_DESC_2, lcd_user_gcode_2);
829
+      #endif
830
+      #if defined(USER_DESC_3) && defined(USER_GCODE_3)
831
+        MENU_ITEM(function, USER_DESC_3, lcd_user_gcode_3);
832
+      #endif
833
+      #if defined(USER_DESC_4) && defined(USER_GCODE_4)
834
+        MENU_ITEM(function, USER_DESC_4, lcd_user_gcode_4);
835
+      #endif
836
+      #if defined(USER_DESC_5) && defined(USER_GCODE_5)
837
+        MENU_ITEM(function, USER_DESC_5, lcd_user_gcode_5);
838
+      #endif
839
+      END_MENU();
840
+    }
841
+
842
+  #endif
843
+
792 844
   /**
793 845
    *
794 846
    * "Main" menu
@@ -804,6 +856,10 @@ void kill_screen(const char* lcd_msg) {
804 856
     START_MENU();
805 857
     MENU_BACK(MSG_WATCH);
806 858
 
859
+    #if ENABLED(CUSTOM_USER_MENUS)
860
+      MENU_ITEM(submenu, MSG_USER_MENU, _lcd_user_menu);
861
+    #endif
862
+
807 863
     //
808 864
     // Debug Menu when certain options are enabled
809 865
     //

Loading…
Cancel
Save