|
@@ -26,57 +26,88 @@
|
26
|
26
|
|
27
|
27
|
#include "../../inc/MarlinConfigPre.h"
|
28
|
28
|
|
29
|
|
-#if BOTH(HAS_LCD_MENU, LED_CONTROL_MENU)
|
|
29
|
+#if HAS_LCD_MENU && EITHER(LED_CONTROL_MENU, CASE_LIGHT_MENU)
|
30
|
30
|
|
31
|
31
|
#include "menu.h"
|
32
|
|
-#include "../../feature/leds/leds.h"
|
33
|
32
|
|
34
|
|
-#if ENABLED(LED_COLOR_PRESETS)
|
|
33
|
+#if ENABLED(LED_CONTROL_MENU)
|
|
34
|
+ #include "../../feature/leds/leds.h"
|
|
35
|
+
|
|
36
|
+ #if ENABLED(LED_COLOR_PRESETS)
|
|
37
|
+ void menu_led_presets() {
|
|
38
|
+ START_MENU();
|
|
39
|
+ #if LCD_HEIGHT > 2
|
|
40
|
+ STATIC_ITEM(MSG_LED_PRESETS, SS_CENTER|SS_INVERT);
|
|
41
|
+ #endif
|
|
42
|
+ BACK_ITEM(MSG_LED_CONTROL);
|
|
43
|
+ ACTION_ITEM(MSG_SET_LEDS_WHITE, leds.set_white);
|
|
44
|
+ ACTION_ITEM(MSG_SET_LEDS_RED, leds.set_red);
|
|
45
|
+ ACTION_ITEM(MSG_SET_LEDS_ORANGE, leds.set_orange);
|
|
46
|
+ ACTION_ITEM(MSG_SET_LEDS_YELLOW,leds.set_yellow);
|
|
47
|
+ ACTION_ITEM(MSG_SET_LEDS_GREEN, leds.set_green);
|
|
48
|
+ ACTION_ITEM(MSG_SET_LEDS_BLUE, leds.set_blue);
|
|
49
|
+ ACTION_ITEM(MSG_SET_LEDS_INDIGO, leds.set_indigo);
|
|
50
|
+ ACTION_ITEM(MSG_SET_LEDS_VIOLET, leds.set_violet);
|
|
51
|
+ END_MENU();
|
|
52
|
+ }
|
|
53
|
+
|
|
54
|
+ #endif
|
35
|
55
|
|
36
|
|
- void menu_led_presets() {
|
|
56
|
+ void menu_led_custom() {
|
37
|
57
|
START_MENU();
|
38
|
|
- #if LCD_HEIGHT > 2
|
39
|
|
- STATIC_ITEM(MSG_LED_PRESETS, SS_CENTER|SS_INVERT);
|
40
|
|
- #endif
|
41
|
58
|
BACK_ITEM(MSG_LED_CONTROL);
|
42
|
|
- ACTION_ITEM(MSG_SET_LEDS_WHITE, leds.set_white);
|
43
|
|
- ACTION_ITEM(MSG_SET_LEDS_RED, leds.set_red);
|
44
|
|
- ACTION_ITEM(MSG_SET_LEDS_ORANGE, leds.set_orange);
|
45
|
|
- ACTION_ITEM(MSG_SET_LEDS_YELLOW,leds.set_yellow);
|
46
|
|
- ACTION_ITEM(MSG_SET_LEDS_GREEN, leds.set_green);
|
47
|
|
- ACTION_ITEM(MSG_SET_LEDS_BLUE, leds.set_blue);
|
48
|
|
- ACTION_ITEM(MSG_SET_LEDS_INDIGO, leds.set_indigo);
|
49
|
|
- ACTION_ITEM(MSG_SET_LEDS_VIOLET, leds.set_violet);
|
|
59
|
+ EDIT_ITEM(uint8, MSG_INTENSITY_R, &leds.color.r, 0, 255, leds.update, true);
|
|
60
|
+ EDIT_ITEM(uint8, MSG_INTENSITY_G, &leds.color.g, 0, 255, leds.update, true);
|
|
61
|
+ EDIT_ITEM(uint8, MSG_INTENSITY_B, &leds.color.b, 0, 255, leds.update, true);
|
|
62
|
+ #if EITHER(RGBW_LED, NEOPIXEL_LED)
|
|
63
|
+ EDIT_ITEM(uint8, MSG_INTENSITY_W, &leds.color.w, 0, 255, leds.update, true);
|
|
64
|
+ #if ENABLED(NEOPIXEL_LED)
|
|
65
|
+ EDIT_ITEM(uint8, MSG_LED_BRIGHTNESS, &leds.color.i, 0, 255, leds.update, true);
|
|
66
|
+ #endif
|
|
67
|
+ #endif
|
50
|
68
|
END_MENU();
|
51
|
69
|
}
|
52
|
|
-
|
53
|
70
|
#endif
|
54
|
71
|
|
55
|
|
-void menu_led_custom() {
|
56
|
|
- START_MENU();
|
57
|
|
- BACK_ITEM(MSG_LED_CONTROL);
|
58
|
|
- EDIT_ITEM(uint8, MSG_INTENSITY_R, &leds.color.r, 0, 255, leds.update, true);
|
59
|
|
- EDIT_ITEM(uint8, MSG_INTENSITY_G, &leds.color.g, 0, 255, leds.update, true);
|
60
|
|
- EDIT_ITEM(uint8, MSG_INTENSITY_B, &leds.color.b, 0, 255, leds.update, true);
|
61
|
|
- #if EITHER(RGBW_LED, NEOPIXEL_LED)
|
62
|
|
- EDIT_ITEM(uint8, MSG_INTENSITY_W, &leds.color.w, 0, 255, leds.update, true);
|
63
|
|
- #if ENABLED(NEOPIXEL_LED)
|
64
|
|
- EDIT_ITEM(uint8, MSG_LED_BRIGHTNESS, &leds.color.i, 0, 255, leds.update, true);
|
65
|
|
- #endif
|
|
72
|
+#if ENABLED(CASE_LIGHT_MENU)
|
|
73
|
+ #include "../../feature/caselight.h"
|
|
74
|
+
|
|
75
|
+ #if DISABLED(CASE_LIGHT_NO_BRIGHTNESS)
|
|
76
|
+ void menu_case_light() {
|
|
77
|
+ START_MENU();
|
|
78
|
+ BACK_ITEM(MSG_CONFIGURATION);
|
|
79
|
+ EDIT_ITEM(percent, MSG_CASE_LIGHT_BRIGHTNESS, &case_light_brightness, 0, 255, update_case_light, true);
|
|
80
|
+ EDIT_ITEM(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light);
|
|
81
|
+ END_MENU();
|
|
82
|
+ }
|
66
|
83
|
#endif
|
67
|
|
- END_MENU();
|
68
|
|
-}
|
|
84
|
+#endif
|
|
85
|
+
|
|
86
|
+
|
69
|
87
|
|
70
|
88
|
void menu_led() {
|
71
|
89
|
START_MENU();
|
72
|
90
|
BACK_ITEM(MSG_MAIN);
|
73
|
|
- bool led_on = leds.lights_on;
|
74
|
|
- EDIT_ITEM(bool, MSG_LEDS, &led_on, leds.toggle);
|
75
|
|
- ACTION_ITEM(MSG_SET_LEDS_DEFAULT, leds.set_default);
|
76
|
|
- #if ENABLED(LED_COLOR_PRESETS)
|
77
|
|
- SUBMENU(MSG_LED_PRESETS, menu_led_presets);
|
|
91
|
+ #if ENABLED(LED_CONTROL_MENU)
|
|
92
|
+ bool led_on = leds.lights_on;
|
|
93
|
+ EDIT_ITEM(bool, MSG_LEDS, &led_on, leds.toggle);
|
|
94
|
+ ACTION_ITEM(MSG_SET_LEDS_DEFAULT, leds.set_default);
|
|
95
|
+ #if ENABLED(LED_COLOR_PRESETS)
|
|
96
|
+ SUBMENU(MSG_LED_PRESETS, menu_led_presets);
|
|
97
|
+ #endif
|
|
98
|
+ SUBMENU(MSG_CUSTOM_LEDS, menu_led_custom);
|
|
99
|
+ #endif
|
|
100
|
+ //
|
|
101
|
+ // Set Case light on/off/brightness
|
|
102
|
+ //
|
|
103
|
+ #if ENABLED(CASE_LIGHT_MENU)
|
|
104
|
+ #if DISABLED(CASE_LIGHT_NO_BRIGHTNESS)
|
|
105
|
+ if (TERN1(CASE_LIGHT_USE_NEOPIXEL, PWM_PIN(CASE_LIGHT_PIN)))
|
|
106
|
+ SUBMENU(MSG_CASE_LIGHT, menu_case_light);
|
|
107
|
+ else
|
|
108
|
+ #endif
|
|
109
|
+ EDIT_ITEM(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light);
|
78
|
110
|
#endif
|
79
|
|
- SUBMENU(MSG_CUSTOM_LEDS, menu_led_custom);
|
80
|
111
|
END_MENU();
|
81
|
112
|
}
|
82
|
113
|
|