|
@@ -0,0 +1,87 @@
|
|
1
|
+/**
|
|
2
|
+ * Marlin 3D Printer Firmware
|
|
3
|
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
|
4
|
+ *
|
|
5
|
+ * Based on Sprinter and grbl.
|
|
6
|
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
|
|
7
|
+ *
|
|
8
|
+ * This program is free software: you can redistribute it and/or modify
|
|
9
|
+ * it under the terms of the GNU General Public License as published by
|
|
10
|
+ * the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+ * (at your option) any later version.
|
|
12
|
+ *
|
|
13
|
+ * This program is distributed in the hope that it will be useful,
|
|
14
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+ * GNU General Public License for more details.
|
|
17
|
+ *
|
|
18
|
+ * You should have received a copy of the GNU General Public License
|
|
19
|
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+ *
|
|
21
|
+ */
|
|
22
|
+
|
|
23
|
+//
|
|
24
|
+// Custom User Menu
|
|
25
|
+//
|
|
26
|
+
|
|
27
|
+#include "../../inc/MarlinConfigPre.h"
|
|
28
|
+
|
|
29
|
+#if HAS_LCD_MENU && ENABLED(CUSTOM_USER_MENUS)
|
|
30
|
+
|
|
31
|
+#include "menu.h"
|
|
32
|
+#include "../../gcode/queue.h"
|
|
33
|
+
|
|
34
|
+#ifdef USER_SCRIPT_DONE
|
|
35
|
+ #define _DONE_SCRIPT "\n" USER_SCRIPT_DONE
|
|
36
|
+#else
|
|
37
|
+ #define _DONE_SCRIPT ""
|
|
38
|
+#endif
|
|
39
|
+
|
|
40
|
+void _lcd_user_gcode(PGM_P const cmd) {
|
|
41
|
+ enqueue_and_echo_commands_P(cmd);
|
|
42
|
+ #if ENABLED(USER_SCRIPT_AUDIBLE_FEEDBACK)
|
|
43
|
+ lcd_completion_feedback();
|
|
44
|
+ #endif
|
|
45
|
+ #if ENABLED(USER_SCRIPT_RETURN)
|
|
46
|
+ lcd_return_to_status();
|
|
47
|
+ #endif
|
|
48
|
+}
|
|
49
|
+
|
|
50
|
+#if defined(USER_DESC_1) && defined(USER_GCODE_1)
|
|
51
|
+ void lcd_user_gcode_1() { _lcd_user_gcode(PSTR(USER_GCODE_1 _DONE_SCRIPT)); }
|
|
52
|
+#endif
|
|
53
|
+#if defined(USER_DESC_2) && defined(USER_GCODE_2)
|
|
54
|
+ void lcd_user_gcode_2() { _lcd_user_gcode(PSTR(USER_GCODE_2 _DONE_SCRIPT)); }
|
|
55
|
+#endif
|
|
56
|
+#if defined(USER_DESC_3) && defined(USER_GCODE_3)
|
|
57
|
+ void lcd_user_gcode_3() { _lcd_user_gcode(PSTR(USER_GCODE_3 _DONE_SCRIPT)); }
|
|
58
|
+#endif
|
|
59
|
+#if defined(USER_DESC_4) && defined(USER_GCODE_4)
|
|
60
|
+ void lcd_user_gcode_4() { _lcd_user_gcode(PSTR(USER_GCODE_4 _DONE_SCRIPT)); }
|
|
61
|
+#endif
|
|
62
|
+#if defined(USER_DESC_5) && defined(USER_GCODE_5)
|
|
63
|
+ void lcd_user_gcode_5() { _lcd_user_gcode(PSTR(USER_GCODE_5 _DONE_SCRIPT)); }
|
|
64
|
+#endif
|
|
65
|
+
|
|
66
|
+void menu_user() {
|
|
67
|
+ START_MENU();
|
|
68
|
+ MENU_BACK(MSG_MAIN);
|
|
69
|
+ #if defined(USER_DESC_1) && defined(USER_GCODE_1)
|
|
70
|
+ MENU_ITEM(function, USER_DESC_1, lcd_user_gcode_1);
|
|
71
|
+ #endif
|
|
72
|
+ #if defined(USER_DESC_2) && defined(USER_GCODE_2)
|
|
73
|
+ MENU_ITEM(function, USER_DESC_2, lcd_user_gcode_2);
|
|
74
|
+ #endif
|
|
75
|
+ #if defined(USER_DESC_3) && defined(USER_GCODE_3)
|
|
76
|
+ MENU_ITEM(function, USER_DESC_3, lcd_user_gcode_3);
|
|
77
|
+ #endif
|
|
78
|
+ #if defined(USER_DESC_4) && defined(USER_GCODE_4)
|
|
79
|
+ MENU_ITEM(function, USER_DESC_4, lcd_user_gcode_4);
|
|
80
|
+ #endif
|
|
81
|
+ #if defined(USER_DESC_5) && defined(USER_GCODE_5)
|
|
82
|
+ MENU_ITEM(function, USER_DESC_5, lcd_user_gcode_5);
|
|
83
|
+ #endif
|
|
84
|
+ END_MENU();
|
|
85
|
+}
|
|
86
|
+
|
|
87
|
+#endif // HAS_LCD_MENU && CUSTOM_USER_MENUS
|