|
@ -26,57 +26,88 @@ |
|
|
|
|
|
|
|
|
#include "../../inc/MarlinConfigPre.h" |
|
|
#include "../../inc/MarlinConfigPre.h" |
|
|
|
|
|
|
|
|
#if BOTH(HAS_LCD_MENU, LED_CONTROL_MENU) |
|
|
#if HAS_LCD_MENU && EITHER(LED_CONTROL_MENU, CASE_LIGHT_MENU) |
|
|
|
|
|
|
|
|
#include "menu.h" |
|
|
#include "menu.h" |
|
|
#include "../../feature/leds/leds.h" |
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(LED_COLOR_PRESETS) |
|
|
#if ENABLED(LED_CONTROL_MENU) |
|
|
|
|
|
#include "../../feature/leds/leds.h" |
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(LED_COLOR_PRESETS) |
|
|
|
|
|
void menu_led_presets() { |
|
|
|
|
|
START_MENU(); |
|
|
|
|
|
#if LCD_HEIGHT > 2 |
|
|
|
|
|
STATIC_ITEM(MSG_LED_PRESETS, SS_CENTER|SS_INVERT); |
|
|
|
|
|
#endif |
|
|
|
|
|
BACK_ITEM(MSG_LED_CONTROL); |
|
|
|
|
|
ACTION_ITEM(MSG_SET_LEDS_WHITE, leds.set_white); |
|
|
|
|
|
ACTION_ITEM(MSG_SET_LEDS_RED, leds.set_red); |
|
|
|
|
|
ACTION_ITEM(MSG_SET_LEDS_ORANGE, leds.set_orange); |
|
|
|
|
|
ACTION_ITEM(MSG_SET_LEDS_YELLOW,leds.set_yellow); |
|
|
|
|
|
ACTION_ITEM(MSG_SET_LEDS_GREEN, leds.set_green); |
|
|
|
|
|
ACTION_ITEM(MSG_SET_LEDS_BLUE, leds.set_blue); |
|
|
|
|
|
ACTION_ITEM(MSG_SET_LEDS_INDIGO, leds.set_indigo); |
|
|
|
|
|
ACTION_ITEM(MSG_SET_LEDS_VIOLET, leds.set_violet); |
|
|
|
|
|
END_MENU(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
void menu_led_presets() { |
|
|
void menu_led_custom() { |
|
|
START_MENU(); |
|
|
START_MENU(); |
|
|
#if LCD_HEIGHT > 2 |
|
|
|
|
|
STATIC_ITEM(MSG_LED_PRESETS, SS_CENTER|SS_INVERT); |
|
|
|
|
|
#endif |
|
|
|
|
|
BACK_ITEM(MSG_LED_CONTROL); |
|
|
BACK_ITEM(MSG_LED_CONTROL); |
|
|
ACTION_ITEM(MSG_SET_LEDS_WHITE, leds.set_white); |
|
|
EDIT_ITEM(uint8, MSG_INTENSITY_R, &leds.color.r, 0, 255, leds.update, true); |
|
|
ACTION_ITEM(MSG_SET_LEDS_RED, leds.set_red); |
|
|
EDIT_ITEM(uint8, MSG_INTENSITY_G, &leds.color.g, 0, 255, leds.update, true); |
|
|
ACTION_ITEM(MSG_SET_LEDS_ORANGE, leds.set_orange); |
|
|
EDIT_ITEM(uint8, MSG_INTENSITY_B, &leds.color.b, 0, 255, leds.update, true); |
|
|
ACTION_ITEM(MSG_SET_LEDS_YELLOW,leds.set_yellow); |
|
|
#if EITHER(RGBW_LED, NEOPIXEL_LED) |
|
|
ACTION_ITEM(MSG_SET_LEDS_GREEN, leds.set_green); |
|
|
EDIT_ITEM(uint8, MSG_INTENSITY_W, &leds.color.w, 0, 255, leds.update, true); |
|
|
ACTION_ITEM(MSG_SET_LEDS_BLUE, leds.set_blue); |
|
|
#if ENABLED(NEOPIXEL_LED) |
|
|
ACTION_ITEM(MSG_SET_LEDS_INDIGO, leds.set_indigo); |
|
|
EDIT_ITEM(uint8, MSG_LED_BRIGHTNESS, &leds.color.i, 0, 255, leds.update, true); |
|
|
ACTION_ITEM(MSG_SET_LEDS_VIOLET, leds.set_violet); |
|
|
#endif |
|
|
|
|
|
#endif |
|
|
END_MENU(); |
|
|
END_MENU(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
void menu_led_custom() { |
|
|
#if ENABLED(CASE_LIGHT_MENU) |
|
|
START_MENU(); |
|
|
#include "../../feature/caselight.h" |
|
|
BACK_ITEM(MSG_LED_CONTROL); |
|
|
|
|
|
EDIT_ITEM(uint8, MSG_INTENSITY_R, &leds.color.r, 0, 255, leds.update, true); |
|
|
#if DISABLED(CASE_LIGHT_NO_BRIGHTNESS) |
|
|
EDIT_ITEM(uint8, MSG_INTENSITY_G, &leds.color.g, 0, 255, leds.update, true); |
|
|
void menu_case_light() { |
|
|
EDIT_ITEM(uint8, MSG_INTENSITY_B, &leds.color.b, 0, 255, leds.update, true); |
|
|
START_MENU(); |
|
|
#if EITHER(RGBW_LED, NEOPIXEL_LED) |
|
|
BACK_ITEM(MSG_CONFIGURATION); |
|
|
EDIT_ITEM(uint8, MSG_INTENSITY_W, &leds.color.w, 0, 255, leds.update, true); |
|
|
EDIT_ITEM(percent, MSG_CASE_LIGHT_BRIGHTNESS, &case_light_brightness, 0, 255, update_case_light, true); |
|
|
#if ENABLED(NEOPIXEL_LED) |
|
|
EDIT_ITEM(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light); |
|
|
EDIT_ITEM(uint8, MSG_LED_BRIGHTNESS, &leds.color.i, 0, 255, leds.update, true); |
|
|
END_MENU(); |
|
|
#endif |
|
|
} |
|
|
#endif |
|
|
#endif |
|
|
END_MENU(); |
|
|
#endif |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void menu_led() { |
|
|
void menu_led() { |
|
|
START_MENU(); |
|
|
START_MENU(); |
|
|
BACK_ITEM(MSG_MAIN); |
|
|
BACK_ITEM(MSG_MAIN); |
|
|
bool led_on = leds.lights_on; |
|
|
#if ENABLED(LED_CONTROL_MENU) |
|
|
EDIT_ITEM(bool, MSG_LEDS, &led_on, leds.toggle); |
|
|
bool led_on = leds.lights_on; |
|
|
ACTION_ITEM(MSG_SET_LEDS_DEFAULT, leds.set_default); |
|
|
EDIT_ITEM(bool, MSG_LEDS, &led_on, leds.toggle); |
|
|
#if ENABLED(LED_COLOR_PRESETS) |
|
|
ACTION_ITEM(MSG_SET_LEDS_DEFAULT, leds.set_default); |
|
|
SUBMENU(MSG_LED_PRESETS, menu_led_presets); |
|
|
#if ENABLED(LED_COLOR_PRESETS) |
|
|
|
|
|
SUBMENU(MSG_LED_PRESETS, menu_led_presets); |
|
|
|
|
|
#endif |
|
|
|
|
|
SUBMENU(MSG_CUSTOM_LEDS, menu_led_custom); |
|
|
|
|
|
#endif |
|
|
|
|
|
//
|
|
|
|
|
|
// Set Case light on/off/brightness
|
|
|
|
|
|
//
|
|
|
|
|
|
#if ENABLED(CASE_LIGHT_MENU) |
|
|
|
|
|
#if DISABLED(CASE_LIGHT_NO_BRIGHTNESS) |
|
|
|
|
|
if (TERN1(CASE_LIGHT_USE_NEOPIXEL, PWM_PIN(CASE_LIGHT_PIN))) |
|
|
|
|
|
SUBMENU(MSG_CASE_LIGHT, menu_case_light); |
|
|
|
|
|
else |
|
|
|
|
|
#endif |
|
|
|
|
|
EDIT_ITEM(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light); |
|
|
#endif |
|
|
#endif |
|
|
SUBMENU(MSG_CUSTOM_LEDS, menu_led_custom); |
|
|
|
|
|
END_MENU(); |
|
|
END_MENU(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|