Browse Source

Add example configs. Expand custom menu. (#16286)

- Anet E10
- Geeetech D200
- Geeetech M201
- JGAurora Magic
- MakerFarm Pegasus 12
Vertabreaker 4 years ago
parent
commit
b841b9bd01

+ 72
- 10
Marlin/src/lcd/menu/menu_custom.cpp View File

@@ -50,20 +50,82 @@ void _lcd_user_gcode(PGM_P const cmd) {
50 50
 void menu_user() {
51 51
   START_MENU();
52 52
   BACK_ITEM(MSG_MAIN);
53
-  #if defined(USER_DESC_1) && defined(USER_GCODE_1)
54
-    ACTION_ITEM_P(PSTR(USER_DESC_1), []{ _lcd_user_gcode(PSTR(USER_GCODE_1 _DONE_SCRIPT)); });
53
+  #define HAS_USER_ITEM(N) (defined(USER_DESC_##N) && defined(USER_GCODE_##N))
54
+  #define USER_ITEM(N) ACTION_ITEM_P(PSTR(USER_DESC_##N), []{ _lcd_user_gcode(PSTR(USER_GCODE_##N _DONE_SCRIPT)); });
55
+  #if HAS_USER_ITEM(1)
56
+    USER_ITEM(1);
55 57
   #endif
56
-  #if defined(USER_DESC_2) && defined(USER_GCODE_2)
57
-    ACTION_ITEM_P(PSTR(USER_DESC_2), []{ _lcd_user_gcode(PSTR(USER_GCODE_2 _DONE_SCRIPT)); });
58
+  #if HAS_USER_ITEM(2)
59
+    USER_ITEM(2);
58 60
   #endif
59
-  #if defined(USER_DESC_3) && defined(USER_GCODE_3)
60
-    ACTION_ITEM_P(PSTR(USER_DESC_3), []{ _lcd_user_gcode(PSTR(USER_GCODE_3 _DONE_SCRIPT)); });
61
+  #if HAS_USER_ITEM(3)
62
+    USER_ITEM(3);
61 63
   #endif
62
-  #if defined(USER_DESC_4) && defined(USER_GCODE_4)
63
-    ACTION_ITEM_P(PSTR(USER_DESC_4), []{ _lcd_user_gcode(PSTR(USER_GCODE_4 _DONE_SCRIPT)); });
64
+  #if HAS_USER_ITEM(4)
65
+    USER_ITEM(4);
64 66
   #endif
65
-  #if defined(USER_DESC_5) && defined(USER_GCODE_5)
66
-    ACTION_ITEM_P(PSTR(USER_DESC_5), []{ _lcd_user_gcode(PSTR(USER_GCODE_5 _DONE_SCRIPT)); });
67
+  #if HAS_USER_ITEM(5)
68
+    USER_ITEM(5);
69
+  #endif
70
+  #if HAS_USER_ITEM(6)
71
+    USER_ITEM(6);
72
+  #endif
73
+  #if HAS_USER_ITEM(7)
74
+    USER_ITEM(7);
75
+  #endif
76
+  #if HAS_USER_ITEM(8)
77
+    USER_ITEM(8);
78
+  #endif
79
+  #if HAS_USER_ITEM(9)
80
+    USER_ITEM(9);
81
+  #endif
82
+  #if HAS_USER_ITEM(10)
83
+    USER_ITEM(10);
84
+  #endif
85
+  #if HAS_USER_ITEM(11)
86
+    USER_ITEM(11);
87
+  #endif
88
+  #if HAS_USER_ITEM(12)
89
+    USER_ITEM(12);
90
+  #endif
91
+  #if HAS_USER_ITEM(13)
92
+    USER_ITEM(13);
93
+  #endif
94
+  #if HAS_USER_ITEM(14)
95
+    USER_ITEM(14);
96
+  #endif
97
+  #if HAS_USER_ITEM(15)
98
+    USER_ITEM(15);
99
+  #endif
100
+  #if HAS_USER_ITEM(16)
101
+    USER_ITEM(16);
102
+  #endif
103
+  #if HAS_USER_ITEM(17)
104
+    USER_ITEM(17);
105
+  #endif
106
+  #if HAS_USER_ITEM(18)
107
+    USER_ITEM(18);
108
+  #endif
109
+  #if HAS_USER_ITEM(19)
110
+    USER_ITEM(19);
111
+  #endif
112
+  #if HAS_USER_ITEM(20)
113
+    USER_ITEM(20);
114
+  #endif
115
+  #if HAS_USER_ITEM(21)
116
+    USER_ITEM(21);
117
+  #endif
118
+  #if HAS_USER_ITEM(22)
119
+    USER_ITEM(22);
120
+  #endif
121
+  #if HAS_USER_ITEM(23)
122
+    USER_ITEM(23);
123
+  #endif
124
+  #if HAS_USER_ITEM(24)
125
+    USER_ITEM(24);
126
+  #endif
127
+  #if HAS_USER_ITEM(25)
128
+    USER_ITEM(25);
67 129
   #endif
68 130
   END_MENU();
69 131
 }

+ 2221
- 0
config/examples/Anet/E10/Configuration.h
File diff suppressed because it is too large
View File


+ 2866
- 0
config/examples/Anet/E10/Configuration_adv.h
File diff suppressed because it is too large
View File


+ 2206
- 0
config/examples/Geeetech/D200/Configuration.h
File diff suppressed because it is too large
View File


+ 2866
- 0
config/examples/Geeetech/D200/Configuration_adv.h
File diff suppressed because it is too large
View File


+ 2206
- 0
config/examples/Geeetech/M201/Configuration.h
File diff suppressed because it is too large
View File


+ 2866
- 0
config/examples/Geeetech/M201/Configuration_adv.h
File diff suppressed because it is too large
View File


+ 2218
- 0
config/examples/JGAurora/Magic/Configuration.h
File diff suppressed because it is too large
View File


+ 2866
- 0
config/examples/JGAurora/Magic/Configuration_adv.h
File diff suppressed because it is too large
View File


+ 2223
- 0
config/examples/MakerFarm/Pegasus_12/Configuration.h
File diff suppressed because it is too large
View File


+ 2863
- 0
config/examples/MakerFarm/Pegasus_12/Configuration_adv.h
File diff suppressed because it is too large
View File


Loading…
Cancel
Save