|
@@ -0,0 +1,83 @@
|
|
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
|
+// LED Menu
|
|
25
|
+//
|
|
26
|
+
|
|
27
|
+#include "../../inc/MarlinConfigPre.h"
|
|
28
|
+
|
|
29
|
+#if HAS_LCD_MENU && ENABLED(LED_CONTROL_MENU)
|
|
30
|
+
|
|
31
|
+#include "menu.h"
|
|
32
|
+#include "../../feature/leds/leds.h"
|
|
33
|
+
|
|
34
|
+#if ENABLED(LED_COLOR_PRESETS)
|
|
35
|
+
|
|
36
|
+ void menu_led_presets() {
|
|
37
|
+ START_MENU();
|
|
38
|
+ #if LCD_HEIGHT > 2
|
|
39
|
+ STATIC_ITEM(MSG_LED_PRESETS, true, true);
|
|
40
|
+ #endif
|
|
41
|
+ MENU_BACK(MSG_LED_CONTROL);
|
|
42
|
+ MENU_ITEM(function, MSG_SET_LEDS_WHITE, leds.set_white);
|
|
43
|
+ MENU_ITEM(function, MSG_SET_LEDS_RED, leds.set_red);
|
|
44
|
+ MENU_ITEM(function, MSG_SET_LEDS_ORANGE, leds.set_orange);
|
|
45
|
+ MENU_ITEM(function, MSG_SET_LEDS_YELLOW,leds.set_yellow);
|
|
46
|
+ MENU_ITEM(function, MSG_SET_LEDS_GREEN, leds.set_green);
|
|
47
|
+ MENU_ITEM(function, MSG_SET_LEDS_BLUE, leds.set_blue);
|
|
48
|
+ MENU_ITEM(function, MSG_SET_LEDS_INDIGO, leds.set_indigo);
|
|
49
|
+ MENU_ITEM(function, MSG_SET_LEDS_VIOLET, leds.set_violet);
|
|
50
|
+ END_MENU();
|
|
51
|
+ }
|
|
52
|
+
|
|
53
|
+#endif
|
|
54
|
+
|
|
55
|
+void menu_led_custom() {
|
|
56
|
+ START_MENU();
|
|
57
|
+ MENU_BACK(MSG_LED_CONTROL);
|
|
58
|
+ MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_R, &leds.color.r, 0, 255, leds.update, true);
|
|
59
|
+ MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_G, &leds.color.g, 0, 255, leds.update, true);
|
|
60
|
+ MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_B, &leds.color.b, 0, 255, leds.update, true);
|
|
61
|
+ #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED)
|
|
62
|
+ MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_W, &leds.color.w, 0, 255, leds.update, true);
|
|
63
|
+ #if ENABLED(NEOPIXEL_LED)
|
|
64
|
+ MENU_ITEM_EDIT_CALLBACK(int8, MSG_LED_BRIGHTNESS, &leds.color.i, 0, 255, leds.update, true);
|
|
65
|
+ #endif
|
|
66
|
+ #endif
|
|
67
|
+ END_MENU();
|
|
68
|
+}
|
|
69
|
+
|
|
70
|
+void menu_led() {
|
|
71
|
+ START_MENU();
|
|
72
|
+ MENU_BACK(MSG_MAIN);
|
|
73
|
+ bool led_on = leds.lights_on;
|
|
74
|
+ MENU_ITEM_EDIT_CALLBACK(bool, MSG_LEDS, &led_on, leds.toggle);
|
|
75
|
+ MENU_ITEM(function, MSG_SET_LEDS_DEFAULT, leds.set_default);
|
|
76
|
+ #if ENABLED(LED_COLOR_PRESETS)
|
|
77
|
+ MENU_ITEM(submenu, MSG_LED_PRESETS, menu_led_presets);
|
|
78
|
+ #endif
|
|
79
|
+ MENU_ITEM(submenu, MSG_CUSTOM_LEDS, menu_led_custom);
|
|
80
|
+ END_MENU();
|
|
81
|
+}
|
|
82
|
+
|
|
83
|
+#endif // HAS_LCD_MENU && LED_CONTROL_MENU
|