From 9951f28892cfbf253610ce7438fca2d4a44aa675 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 29 Nov 2017 20:53:17 -0600 Subject: [PATCH 1/4] Apply const to some planner vars --- Marlin/planner.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 31236bff3..f15064381 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -1312,7 +1312,7 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const // The junction velocity will be shared between successive segments. Limit the junction velocity to their minimum. const bool prev_speed_larger = previous_nominal_speed > block->nominal_speed; - float smaller_speed_factor = prev_speed_larger ? (block->nominal_speed / previous_nominal_speed) : (previous_nominal_speed / block->nominal_speed); + const float smaller_speed_factor = prev_speed_larger ? (block->nominal_speed / previous_nominal_speed) : (previous_nominal_speed / block->nominal_speed); // Pick the smaller of the nominal speeds. Higher speed shall not be achieved at the junction during coasting. vmax_junction = prev_speed_larger ? block->nominal_speed : previous_nominal_speed; // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities. @@ -1444,10 +1444,10 @@ void Planner::_set_position_mm(const float &a, const float &b, const float &c, c #else #define _EINDEX E_AXIS #endif - long na = position[X_AXIS] = LROUND(a * axis_steps_per_mm[X_AXIS]), - nb = position[Y_AXIS] = LROUND(b * axis_steps_per_mm[Y_AXIS]), - nc = position[Z_AXIS] = LROUND(c * axis_steps_per_mm[Z_AXIS]), - ne = position[E_AXIS] = LROUND(e * axis_steps_per_mm[_EINDEX]); + const long na = position[X_AXIS] = LROUND(a * axis_steps_per_mm[X_AXIS]), + nb = position[Y_AXIS] = LROUND(b * axis_steps_per_mm[Y_AXIS]), + nc = position[Z_AXIS] = LROUND(c * axis_steps_per_mm[Z_AXIS]), + ne = position[E_AXIS] = LROUND(e * axis_steps_per_mm[_EINDEX]); #if ENABLED(LIN_ADVANCE) position_float[X_AXIS] = a; position_float[Y_AXIS] = b; From e25567a5dde80b8c9b69bc77e4a3019a266b19fe Mon Sep 17 00:00:00 2001 From: Tannoo Date: Sat, 18 Nov 2017 12:52:06 -0700 Subject: [PATCH 2/4] New feature: LED_CONTROL_MENU --- Marlin/Configuration_adv.h | 15 ++ Marlin/Marlin_main.cpp | 52 +++++++ .../AlephObjects/TAZ4/Configuration_adv.h | 15 ++ .../Anet/A6/Configuration_adv.h | 15 ++ .../Anet/A8/Configuration_adv.h | 15 ++ .../BQ/Hephestos/Configuration_adv.h | 15 ++ .../BQ/Hephestos_2/Configuration_adv.h | 15 ++ .../BQ/WITBOX/Configuration_adv.h | 15 ++ .../Cartesio/Configuration_adv.h | 15 ++ .../Creality/CR-10/Configuration_adv.h | 15 ++ .../Felix/Configuration_adv.h | 15 ++ .../FolgerTech/i3-2020/Configuration_adv.h | 15 ++ .../Infitary/i3-M508/Configuration_adv.h | 15 ++ .../Malyan/M150/Configuration_adv.h | 15 ++ .../Micromake/C1/enhanced/Configuration_adv.h | 15 ++ .../RigidBot/Configuration_adv.h | 15 ++ .../SCARA/Configuration_adv.h | 15 ++ .../Sanguinololu/Configuration_adv.h | 15 ++ .../TinyBoy2/Configuration_adv.h | 15 ++ .../Velleman/K8200/Configuration_adv.h | 15 ++ .../Velleman/K8400/Configuration_adv.h | 15 ++ .../FLSUN/auto_calibrate/Configuration_adv.h | 15 ++ .../FLSUN/kossel_mini/Configuration_adv.h | 15 ++ .../delta/generic/Configuration_adv.h | 15 ++ .../delta/kossel_mini/Configuration_adv.h | 15 ++ .../delta/kossel_pro/Configuration_adv.h | 15 ++ .../delta/kossel_xl/Configuration_adv.h | 15 ++ .../gCreate/gMax1.5+/Configuration_adv.h | 15 ++ .../makibox/Configuration_adv.h | 15 ++ .../tvrrug/Round2/Configuration_adv.h | 15 ++ .../wt150/Configuration_adv.h | 15 ++ Marlin/language_en.h | 58 ++++++- Marlin/ultralcd.cpp | 147 ++++++++++++++++++ 33 files changed, 706 insertions(+), 1 deletion(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index a241265c3..bf30570c6 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -482,6 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 96ab28493..089917c14 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -331,6 +331,32 @@ void gcode_G26(); #endif +#if ENABLED(LED_CONTROL_MENU) + #if ENABLED(LED_COLOR_PRESETS) + uint8_t led_intensity_red = LED_USER_PRESET_RED, + led_intensity_green = LED_USER_PRESET_GREEN, + led_intensity_blue = LED_USER_PRESET_BLUE + #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED) + , led_intensity_white = LED_USER_PRESET_WHITE + #endif + #if ENABLED(NEOPIXEL_LED) + , led_intensity = NEOPIXEL_BRIGHTNESS + #endif + ; + #else + uint8_t led_intensity_red = 255, + led_intensity_green = 255, + led_intensity_blue = 255 + #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED) + , led_intensity_white = 0 + #endif + #if ENABLED(NEOPIXEL_LED) + , led_intensity = NEOPIXEL_BRIGHTNESS + #endif + ; + #endif +#endif + #if ENABLED(SDSUPPORT) CardReader card; #endif @@ -1101,6 +1127,32 @@ void servo_init() { // Update I2C LED driver PCA9632_SetColor(r, g, b); #endif + + #if ENABLED(LED_CONTROL_MENU) + if ((r + g + b + #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED) + + w + #endif + ) >= 3) { + led_intensity_red = r; + led_intensity_green = g; + led_intensity_blue = b; + #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED) + led_intensity_white = w; + #endif + #if ENABLED(NEOPIXEL_LED) + led_intensity = p; + #endif + } + #endif + } + + void set_led_white() { + #if ENABLED(NEOPIXEL_LED) + set_neopixel_color(pixels.Color(NEO_WHITE)); + #else + set_led_color(LED_WHITE); + #endif } #endif // HAS_COLOR_LEDS diff --git a/Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h b/Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h index 8db7d3515..8b59e94a6 100644 --- a/Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h @@ -482,6 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/Anet/A6/Configuration_adv.h b/Marlin/example_configurations/Anet/A6/Configuration_adv.h index fce1386dd..52513b255 100644 --- a/Marlin/example_configurations/Anet/A6/Configuration_adv.h +++ b/Marlin/example_configurations/Anet/A6/Configuration_adv.h @@ -482,6 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/Anet/A8/Configuration_adv.h b/Marlin/example_configurations/Anet/A8/Configuration_adv.h index 9e81dd2d6..1c79c297b 100644 --- a/Marlin/example_configurations/Anet/A8/Configuration_adv.h +++ b/Marlin/example_configurations/Anet/A8/Configuration_adv.h @@ -482,6 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h b/Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h index 8681aca12..f82173845 100644 --- a/Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h @@ -482,6 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h index 23beb7fa6..b4f24e370 100644 --- a/Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h @@ -482,6 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h b/Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h index 8681aca12..f82173845 100644 --- a/Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h @@ -482,6 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index 44bffa75f..ac3f1fbe6 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -482,6 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/Creality/CR-10/Configuration_adv.h b/Marlin/example_configurations/Creality/CR-10/Configuration_adv.h index a64a46b68..d4a657571 100755 --- a/Marlin/example_configurations/Creality/CR-10/Configuration_adv.h +++ b/Marlin/example_configurations/Creality/CR-10/Configuration_adv.h @@ -482,6 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index 3a8e8b6ef..c8342c4f0 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -482,6 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/FolgerTech/i3-2020/Configuration_adv.h b/Marlin/example_configurations/FolgerTech/i3-2020/Configuration_adv.h index 8828b9e57..194c13aa5 100644 --- a/Marlin/example_configurations/FolgerTech/i3-2020/Configuration_adv.h +++ b/Marlin/example_configurations/FolgerTech/i3-2020/Configuration_adv.h @@ -482,6 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h b/Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h index 12cd0dbf8..b5a7d952b 100644 --- a/Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h +++ b/Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h @@ -482,6 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/Malyan/M150/Configuration_adv.h b/Marlin/example_configurations/Malyan/M150/Configuration_adv.h index 7d5b73389..627e2c955 100644 --- a/Marlin/example_configurations/Malyan/M150/Configuration_adv.h +++ b/Marlin/example_configurations/Malyan/M150/Configuration_adv.h @@ -482,6 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/Micromake/C1/enhanced/Configuration_adv.h b/Marlin/example_configurations/Micromake/C1/enhanced/Configuration_adv.h index 7fbc77c8e..db02de456 100644 --- a/Marlin/example_configurations/Micromake/C1/enhanced/Configuration_adv.h +++ b/Marlin/example_configurations/Micromake/C1/enhanced/Configuration_adv.h @@ -482,6 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index d1413213d..e8f7bddae 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -482,6 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index 7c79955e2..7f7deb689 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -482,6 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/Sanguinololu/Configuration_adv.h b/Marlin/example_configurations/Sanguinololu/Configuration_adv.h index 37df22e6c..cf3aeab06 100644 --- a/Marlin/example_configurations/Sanguinololu/Configuration_adv.h +++ b/Marlin/example_configurations/Sanguinololu/Configuration_adv.h @@ -471,6 +471,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/TinyBoy2/Configuration_adv.h b/Marlin/example_configurations/TinyBoy2/Configuration_adv.h index a0ae3dead..16e97e41f 100644 --- a/Marlin/example_configurations/TinyBoy2/Configuration_adv.h +++ b/Marlin/example_configurations/TinyBoy2/Configuration_adv.h @@ -482,6 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/Velleman/K8200/Configuration_adv.h b/Marlin/example_configurations/Velleman/K8200/Configuration_adv.h index 10512609e..e7e0969c9 100644 --- a/Marlin/example_configurations/Velleman/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/Velleman/K8200/Configuration_adv.h @@ -495,6 +495,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/Velleman/K8400/Configuration_adv.h b/Marlin/example_configurations/Velleman/K8400/Configuration_adv.h index 728c554fe..0985886ae 100644 --- a/Marlin/example_configurations/Velleman/K8400/Configuration_adv.h +++ b/Marlin/example_configurations/Velleman/K8400/Configuration_adv.h @@ -482,6 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h b/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h index b3c9d71b3..4fd8ff511 100644 --- a/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h +++ b/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h @@ -484,6 +484,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h index 3d1c07236..bf4155454 100644 --- a/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h @@ -484,6 +484,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index 3d1c07236..bf4155454 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -484,6 +484,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index 3d1c07236..bf4155454 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -484,6 +484,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index c8dc04f9b..336feb6ad 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -489,6 +489,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index 172458902..302d0b1d1 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -484,6 +484,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h b/Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h index e7566d583..978310b6e 100644 --- a/Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h +++ b/Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h @@ -482,6 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 3ad0babf8..238fbd6d9 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -482,6 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index 1acaef4e8..17e1c8be4 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -482,6 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/example_configurations/wt150/Configuration_adv.h b/Marlin/example_configurations/wt150/Configuration_adv.h index 891a85cf9..0438f6801 100644 --- a/Marlin/example_configurations/wt150/Configuration_adv.h +++ b/Marlin/example_configurations/wt150/Configuration_adv.h @@ -472,6 +472,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 +//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +#if ENABLED(LED_CONTROL_MENU) + + #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_INTENSITY 255 // User defined intensity + + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + #if ENABLED(SDSUPPORT) // Some RAMPS and other boards don't detect when an SD card is inserted. You can work diff --git a/Marlin/language_en.h b/Marlin/language_en.h index 3b4027ba3..d2d93dc59 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -361,7 +361,63 @@ #ifndef MSG_UBL_STEP_BY_STEP_MENU #define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Step-By-Step UBL") #endif - +#ifndef MSG_LED_CONTROL + #define MSG_LED_CONTROL _UxGT("LED Control") +#endif +#ifndef MSG_LEDS_OFF + #define MSG_LEDS_OFF _UxGT("Turn Off Lights") +#endif +#ifndef MSG_LED_ON + #define MSG_LED_ON _UxGT("Turn on ") +#endif +#ifndef MSG_RED + #define MSG_RED _UxGT("Red ") +#endif +#ifndef MSG_ORANGE + #define MSG_ORANGE _UxGT("Orange ") +#endif +#ifndef MSG_YELLOW + #define MSG_YELLOW _UxGT("Yellow ") +#endif +#ifndef MSG_GREEN + #define MSG_GREEN _UxGT("Green ") +#endif +#ifndef MSG_BLUE + #define MSG_BLUE _UxGT("Blue ") +#endif +#ifndef MSG_PURPLE + #define MSG_PURPLE _UxGT("Purple ") +#endif +#ifndef MSG_WHITE + #define MSG_WHITE _UxGT("White ") +#endif +#ifndef MSG_CUSTOM + #define MSG_CUSTOM _UxGT("Custom ") +#endif +#ifndef MSG_LED_PRESET + #define MSG_LED_PRESET _UxGT("Preset ") +#endif +#ifndef MSG_LED_DEFAULT + #define MSG_LED_DEFAULT _UxGT("Default ") +#endif +#ifndef MSG_LIGHTS + #define MSG_LIGHTS _UxGT("Lights ") +#endif +#ifndef MSG_COLOR + #define MSG_COLOR _UxGT("Color") +#endif +#ifndef MSG_LED_INTENSITY + #define MSG_LED_INTENSITY _UxGT("Intensity ") +#endif +#ifndef MSG_LED_CUSTOM + #define MSG_LED_CUSTOM _UxGT("Custom LED") +#endif +#ifndef MSG_LED_SAVE + #define MSG_LED_SAVE _UxGT("Save ") +#endif +#ifndef MSG_LED_LOAD + #define MSG_LED_LOAD _UxGT("Load ") +#endif #ifndef MSG_MOVING #define MSG_MOVING _UxGT("Moving...") #endif diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index bcf2f47d6..5c41dcdcc 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -184,6 +184,23 @@ uint16_t max_display_update_time = 0; void lcd_info_menu(); #endif // LCD_INFO_MENU + #if ENABLED(LED_CONTROL_MENU) + extern void set_led_color( + const uint8_t r, const uint8_t g, const uint8_t b + #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED) + , const uint8_t w = 0 + #if ENABLED(NEOPIXEL_LED) + , const uint8_t p = NEOPIXEL_BRIGHTNESS + , bool isSequence = false + #endif + #endif + ); + + extern void set_led_white(); + void lcd_led_menu(); + void lcd_led_custom_menu(); + #endif + #if ENABLED(ADVANCED_PAUSE_FEATURE) void lcd_advanced_pause_toocold_menu(); void lcd_advanced_pause_option_menu(); @@ -1013,6 +1030,10 @@ void kill_screen(const char* lcd_msg) { MENU_ITEM(submenu, MSG_INFO_MENU, lcd_info_menu); #endif + #if ENABLED(LED_CONTROL_MENU) + MENU_ITEM(submenu, "LED Control", lcd_led_menu); + #endif + END_MENU(); } @@ -3942,6 +3963,132 @@ void kill_screen(const char* lcd_msg) { } #endif // LCD_INFO_MENU + /** + * + * LED Menu + * + */ + + #if ENABLED(LED_CONTROL_MENU) + + bool led_restore_color = + #if ENABLED(LED_USER_PRESET_STARTUP) + false; + #else + true; + #endif + + extern uint8_t led_intensity_red, + led_intensity_green, + led_intensity_blue + #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED) + , led_intensity_white + #endif + #if ENABLED(NEOPIXEL_LED) + , led_intensity + #endif + ; + + void update_leds() { + if (led_restore_color) { + #if ENABLED(LED_COLOR_PRESETS) + led_intensity_red = LED_USER_PRESET_RED; + led_intensity_green = LED_USER_PRESET_GREEN; + led_intensity_blue = LED_USER_PRESET_BLUE; + #if ENABLED(RGBW_LED) + led_intensity_white = LED_USER_PRESET_WHITE; + #endif + #if ENABLED(NEOPIXEL_LED) + led_intensity = LED_USER_PRESET_INTENSITY; + #endif + #else + led_intensity_red = 255; + led_intensity_green = 255; + led_intensity_blue = 255; + #if ENABLED(RGBW_LED) + led_intensity_white = 0; + #endif + #if ENABLED(NEOPIXEL_LED) + led_intensity = LED_USER_PRESET_INTENSITY; + #endif + #endif + led_restore_color = false; + } + + set_led_color(led_intensity_red, led_intensity_green, led_intensity_blue + #if ENABLED(RGBW_LED) + , led_intensity_white + #endif + #if ENABLED(NEOPIXEL_LED) + , 0, led_intensity + #endif + ); + led_restore_color = false; + } + + void led_restore_default() { + led_restore_color = true; + update_leds(); + } + + void set_leds_off() { + set_led_color(0, 0, 0 + #if ENABLED(RGBW) || ENABLED(NEOPIXEL_LED) + , 0 + #endif + ); + } + + void lcd_led_red() { set_led_color(255, 0, 0); } + void lcd_led_orange() { set_led_color(150, 60, 0); } + void lcd_led_yellow() { set_led_color(255, 255, 0); } + void lcd_led_green() { set_led_color(0, 255, 0); } + void lcd_led_blue() { set_led_color(0, 0, 255); } + void lcd_led_purple() { set_led_color(255, 0, 255); } + + void lcd_led_presets_menu() { + START_MENU(); + MENU_BACK(MSG_LED_CONTROL); + MENU_ITEM(function, MSG_LED_ON MSG_RED MSG_LIGHTS, lcd_led_red); + MENU_ITEM(function, MSG_LED_ON MSG_ORANGE MSG_LIGHTS, lcd_led_orange); + MENU_ITEM(function, MSG_LED_ON MSG_YELLOW MSG_LIGHTS,lcd_led_yellow); + MENU_ITEM(function, MSG_LED_ON MSG_GREEN MSG_LIGHTS, lcd_led_green); + MENU_ITEM(function, MSG_LED_ON MSG_BLUE MSG_LIGHTS, lcd_led_blue); + MENU_ITEM(function, MSG_LED_ON MSG_PURPLE MSG_LIGHTS, lcd_led_purple); + MENU_ITEM(function, MSG_LED_ON MSG_WHITE MSG_LIGHTS, set_led_white); + END_MENU(); + } + + void lcd_led_custom_menu() { + START_MENU(); + MENU_BACK(MSG_LED_CONTROL); + MENU_ITEM_EDIT_CALLBACK(int8, MSG_RED MSG_LED_INTENSITY, &led_intensity_red, 0, 255, update_leds, true); + MENU_ITEM_EDIT_CALLBACK(int8, MSG_GREEN MSG_LED_INTENSITY, &led_intensity_green, 0, 255, update_leds, true); + MENU_ITEM_EDIT_CALLBACK(int8, MSG_BLUE MSG_LED_INTENSITY, &led_intensity_blue, 0, 255, update_leds, true); + #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED) + MENU_ITEM_EDIT_CALLBACK(int8, MSG_WHITE MSG_LED_INTENSITY, &led_intensity_white, 0, 255, update_leds, true); + #endif + #if ENABLED(NEOPIXEL_LED) + MENU_ITEM_EDIT_CALLBACK(int8, MSG_LED_INTENSITY, &led_intensity, 0, 255, update_leds, true); + #endif + END_MENU(); + } + + void lcd_led_menu() { + START_MENU(); + MENU_BACK(MSG_MAIN); + MENU_ITEM(function, MSG_LIGHTS MSG_OFF, set_leds_off); // works + MENU_ITEM(function, MSG_LIGHTS MSG_ON, update_leds); // works + MENU_ITEM(function, MSG_LED_LOAD MSG_LED_DEFAULT MSG_COLOR, led_restore_default); // works + #if ENABLED(LED_COLOR_PRESETS) + MENU_ITEM(submenu, MSG_LED_PRESET MSG_LIGHTS, lcd_led_presets_menu); + #endif + MENU_ITEM(submenu, MSG_CUSTOM MSG_LIGHTS, lcd_led_custom_menu); + END_MENU(); + } + + #endif // LED_CONTROL_MENU + /** * * Filament Change Feature Screens From 1f770bb1031b19c9c30066de6e8b06c1631a612b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 27 Nov 2017 22:00:57 -0600 Subject: [PATCH 3/4] Config updates, spacing mainly --- .travis.yml | 2 +- Marlin/Conditionals_post.h | 23 ++++++++++++++++ Marlin/Configuration_adv.h | 26 ++++++++++--------- Marlin/SanityCheck.h | 4 +++ .../AlephObjects/TAZ4/Configuration_adv.h | 26 ++++++++++--------- .../Anet/A6/Configuration_adv.h | 26 ++++++++++--------- .../Anet/A8/Configuration_adv.h | 26 ++++++++++--------- .../BQ/Hephestos/Configuration_adv.h | 26 ++++++++++--------- .../BQ/Hephestos_2/Configuration_adv.h | 26 ++++++++++--------- .../BQ/WITBOX/Configuration_adv.h | 26 ++++++++++--------- .../Cartesio/Configuration_adv.h | 26 ++++++++++--------- .../Creality/CR-10/Configuration_adv.h | 26 ++++++++++--------- .../Felix/Configuration_adv.h | 26 ++++++++++--------- .../FolgerTech/i3-2020/Configuration_adv.h | 26 ++++++++++--------- .../Infitary/i3-M508/Configuration_adv.h | 26 ++++++++++--------- .../Malyan/M150/Configuration_adv.h | 26 ++++++++++--------- .../Micromake/C1/enhanced/Configuration_adv.h | 26 ++++++++++--------- .../RigidBot/Configuration_adv.h | 26 ++++++++++--------- .../SCARA/Configuration_adv.h | 26 ++++++++++--------- .../Sanguinololu/Configuration_adv.h | 26 ++++++++++--------- .../TinyBoy2/Configuration_adv.h | 26 ++++++++++--------- .../Velleman/K8200/Configuration_adv.h | 26 ++++++++++--------- .../Velleman/K8400/Configuration_adv.h | 26 ++++++++++--------- .../FLSUN/auto_calibrate/Configuration_adv.h | 26 ++++++++++--------- .../FLSUN/kossel_mini/Configuration_adv.h | 26 ++++++++++--------- .../delta/generic/Configuration_adv.h | 26 ++++++++++--------- .../delta/kossel_mini/Configuration_adv.h | 26 ++++++++++--------- .../delta/kossel_pro/Configuration_adv.h | 26 ++++++++++--------- .../delta/kossel_xl/Configuration_adv.h | 26 ++++++++++--------- .../gCreate/gMax1.5+/Configuration_adv.h | 26 ++++++++++--------- .../makibox/Configuration_adv.h | 26 ++++++++++--------- .../tvrrug/Round2/Configuration_adv.h | 26 ++++++++++--------- .../wt150/Configuration_adv.h | 26 ++++++++++--------- 33 files changed, 448 insertions(+), 361 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1f0aeb8af..21c6332b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -90,7 +90,7 @@ script: - opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS - opt_enable BLINKM PCA9632 RGB_LED NEOPIXEL_LED - opt_enable AUTO_BED_LEVELING_LINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE - - opt_enable_adv FWRETRACT MAX7219_DEBUG + - opt_enable_adv FWRETRACT MAX7219_DEBUG LED_CONTROL_MENU - opt_set ABL_GRID_POINTS_X 16 - opt_set ABL_GRID_POINTS_Y 16 - opt_set_adv FANMUX0_PIN 53 diff --git a/Marlin/Conditionals_post.h b/Marlin/Conditionals_post.h index 401b83687..5dfe82fcd 100644 --- a/Marlin/Conditionals_post.h +++ b/Marlin/Conditionals_post.h @@ -1096,4 +1096,27 @@ #define MAX_VFAT_ENTRIES (2) #endif + // Set defaults for unspecified LED user colors + #if ENABLED(LED_CONTROL_MENU) + #ifndef LED_USER_PRESET_RED + #define LED_USER_PRESET_RED 255 + #endif + #ifndef LED_USER_PRESET_GREEN + #define LED_USER_PRESET_GREEN 255 + #endif + #ifndef LED_USER_PRESET_BLUE + #define LED_USER_PRESET_BLUE 255 + #endif + #ifndef LED_USER_PRESET_WHITE + #define LED_USER_PRESET_WHITE 0 + #endif + #ifndef LED_USER_PRESET_BRIGHTNESS + #ifdef NEOPIXEL_BRIGHTNESS + #define LED_USER_PRESET_BRIGHTNESS NEOPIXEL_BRIGHTNESS + #else + #define LED_USER_PRESET_BRIGHTNESS 255 + #endif + #endif + #endif + #endif // CONDITIONALS_POST_H diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index bf30570c6..b1095f8e1 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -482,19 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index af6032bc3..520450214 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -1514,3 +1514,7 @@ static_assert(COUNT(sanity_arr_3) <= XYZE_N, "DEFAULT_MAX_ACCELERATION has too m #if !BLOCK_BUFFER_SIZE || !IS_POWER_OF_2(BLOCK_BUFFER_SIZE) #error "BLOCK_BUFFER_SIZE must be a power of 2." #endif + +#if ENABLED(LED_CONTROL_MENU) && DISABLED(ULTIPANEL) + #error "LED_CONTROL_MENU requires an LCD controller." +#endif diff --git a/Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h b/Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h index 8b59e94a6..f83ebeaa2 100644 --- a/Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h @@ -482,19 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/Anet/A6/Configuration_adv.h b/Marlin/example_configurations/Anet/A6/Configuration_adv.h index 52513b255..a5c53df43 100644 --- a/Marlin/example_configurations/Anet/A6/Configuration_adv.h +++ b/Marlin/example_configurations/Anet/A6/Configuration_adv.h @@ -482,19 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/Anet/A8/Configuration_adv.h b/Marlin/example_configurations/Anet/A8/Configuration_adv.h index 1c79c297b..a176761eb 100644 --- a/Marlin/example_configurations/Anet/A8/Configuration_adv.h +++ b/Marlin/example_configurations/Anet/A8/Configuration_adv.h @@ -482,19 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h b/Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h index f82173845..7b98a75a9 100644 --- a/Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h @@ -482,19 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h index b4f24e370..d6d75524d 100644 --- a/Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h @@ -482,19 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h b/Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h index f82173845..7b98a75a9 100644 --- a/Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h @@ -482,19 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index ac3f1fbe6..2c138d3c1 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -482,19 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/Creality/CR-10/Configuration_adv.h b/Marlin/example_configurations/Creality/CR-10/Configuration_adv.h index d4a657571..40fcca727 100755 --- a/Marlin/example_configurations/Creality/CR-10/Configuration_adv.h +++ b/Marlin/example_configurations/Creality/CR-10/Configuration_adv.h @@ -482,19 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index c8342c4f0..29b2845ed 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -482,19 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/FolgerTech/i3-2020/Configuration_adv.h b/Marlin/example_configurations/FolgerTech/i3-2020/Configuration_adv.h index 194c13aa5..31cccde0b 100644 --- a/Marlin/example_configurations/FolgerTech/i3-2020/Configuration_adv.h +++ b/Marlin/example_configurations/FolgerTech/i3-2020/Configuration_adv.h @@ -482,19 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h b/Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h index b5a7d952b..5c86932cb 100644 --- a/Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h +++ b/Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h @@ -482,19 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/Malyan/M150/Configuration_adv.h b/Marlin/example_configurations/Malyan/M150/Configuration_adv.h index 627e2c955..30294cb37 100644 --- a/Marlin/example_configurations/Malyan/M150/Configuration_adv.h +++ b/Marlin/example_configurations/Malyan/M150/Configuration_adv.h @@ -482,19 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/Micromake/C1/enhanced/Configuration_adv.h b/Marlin/example_configurations/Micromake/C1/enhanced/Configuration_adv.h index db02de456..dcd1dd67e 100644 --- a/Marlin/example_configurations/Micromake/C1/enhanced/Configuration_adv.h +++ b/Marlin/example_configurations/Micromake/C1/enhanced/Configuration_adv.h @@ -482,19 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index e8f7bddae..5dd79f5c0 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -482,19 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index 7f7deb689..ecbc3e514 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -482,19 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/Sanguinololu/Configuration_adv.h b/Marlin/example_configurations/Sanguinololu/Configuration_adv.h index cf3aeab06..038d1a0bf 100644 --- a/Marlin/example_configurations/Sanguinololu/Configuration_adv.h +++ b/Marlin/example_configurations/Sanguinololu/Configuration_adv.h @@ -471,19 +471,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/TinyBoy2/Configuration_adv.h b/Marlin/example_configurations/TinyBoy2/Configuration_adv.h index 16e97e41f..09e5443de 100644 --- a/Marlin/example_configurations/TinyBoy2/Configuration_adv.h +++ b/Marlin/example_configurations/TinyBoy2/Configuration_adv.h @@ -482,19 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/Velleman/K8200/Configuration_adv.h b/Marlin/example_configurations/Velleman/K8200/Configuration_adv.h index e7e0969c9..4a0625a0c 100644 --- a/Marlin/example_configurations/Velleman/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/Velleman/K8200/Configuration_adv.h @@ -495,19 +495,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/Velleman/K8400/Configuration_adv.h b/Marlin/example_configurations/Velleman/K8400/Configuration_adv.h index 0985886ae..f84742c5c 100644 --- a/Marlin/example_configurations/Velleman/K8400/Configuration_adv.h +++ b/Marlin/example_configurations/Velleman/K8400/Configuration_adv.h @@ -482,19 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h b/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h index 4fd8ff511..ac5b68091 100644 --- a/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h +++ b/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h @@ -484,19 +484,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h index bf4155454..c3c6636ef 100644 --- a/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h @@ -484,19 +484,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index bf4155454..c3c6636ef 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -484,19 +484,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index bf4155454..c3c6636ef 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -484,19 +484,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index 336feb6ad..e38f5278e 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -489,19 +489,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index 302d0b1d1..27d3eb95c 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -484,19 +484,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h b/Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h index 978310b6e..30081e0e6 100644 --- a/Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h +++ b/Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h @@ -482,19 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 238fbd6d9..7c870a895 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -482,19 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index 17e1c8be4..22733d8b1 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -482,19 +482,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) diff --git a/Marlin/example_configurations/wt150/Configuration_adv.h b/Marlin/example_configurations/wt150/Configuration_adv.h index 0438f6801..acca3e1ac 100644 --- a/Marlin/example_configurations/wt150/Configuration_adv.h +++ b/Marlin/example_configurations/wt150/Configuration_adv.h @@ -472,19 +472,21 @@ // The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 -//#define LED_CONTROL_MENU // Uncomment to enable the LED control menu option. +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU #if ENABLED(LED_CONTROL_MENU) - - #define LED_COLOR_PRESETS // Uncomment to enable the preset color menu option. - #if ENABLED(LED_COLOR_PRESETS) - #define LED_USER_PRESET_RED 255 // User defined RED value - #define LED_USER_PRESET_GREEN 128 // User defined GREEN value - #define LED_USER_PRESET_BLUE 0 // User defined BLUE value - #define LED_USER_PRESET_WHITE 255 // User defined WHITE value - #define LED_USER_PRESET_INTENSITY 255 // User defined intensity - - //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup - #endif + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif #endif // LED_CONTROL_MENU #if ENABLED(SDSUPPORT) From 68c1f05aeb618fcfc3c435f14bce6cdddc073eb3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 27 Nov 2017 23:02:44 -0600 Subject: [PATCH 4/4] Cleanups/changes to led control menu --- Marlin/Marlin_main.cpp | 218 ++++------------------------------------- Marlin/blinkm.cpp | 16 +-- Marlin/blinkm.h | 14 ++- Marlin/language_en.h | 74 +++++++------- Marlin/leds.cpp | 140 ++++++++++++++++++++++++++ Marlin/leds.h | 169 ++++++++++++++++++++++++++++++++ Marlin/neopixel.cpp | 60 ++++++++++++ Marlin/neopixel.h | 44 +++++++++ Marlin/pca9632.cpp | 15 +-- Marlin/pca9632.h | 8 +- Marlin/ultralcd.cpp | 142 ++++++--------------------- 11 files changed, 530 insertions(+), 370 deletions(-) create mode 100644 Marlin/leds.cpp create mode 100644 Marlin/leds.h create mode 100644 Marlin/neopixel.cpp create mode 100644 Marlin/neopixel.h diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 089917c14..839d51e93 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -284,17 +284,8 @@ #include "Max7219_Debug_LEDs.h" #endif -#if ENABLED(NEOPIXEL_LED) - #include -#endif - -#if ENABLED(BLINKM) - #include "blinkm.h" - #include "Wire.h" -#endif - -#if ENABLED(PCA9632) - #include "pca9632.h" +#if HAS_COLOR_LEDS + #include "leds.h" #endif #if HAS_SERVOS @@ -331,32 +322,6 @@ void gcode_G26(); #endif -#if ENABLED(LED_CONTROL_MENU) - #if ENABLED(LED_COLOR_PRESETS) - uint8_t led_intensity_red = LED_USER_PRESET_RED, - led_intensity_green = LED_USER_PRESET_GREEN, - led_intensity_blue = LED_USER_PRESET_BLUE - #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED) - , led_intensity_white = LED_USER_PRESET_WHITE - #endif - #if ENABLED(NEOPIXEL_LED) - , led_intensity = NEOPIXEL_BRIGHTNESS - #endif - ; - #else - uint8_t led_intensity_red = 255, - led_intensity_green = 255, - led_intensity_blue = 255 - #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED) - , led_intensity_white = 0 - #endif - #if ENABLED(NEOPIXEL_LED) - , led_intensity = NEOPIXEL_BRIGHTNESS - #endif - ; - #endif -#endif - #if ENABLED(SDSUPPORT) CardReader card; #endif @@ -381,20 +346,6 @@ || isnan(ubl.z_values[0][0])) #endif -#if ENABLED(NEOPIXEL_LED) - #if NEOPIXEL_TYPE == NEO_RGB || NEOPIXEL_TYPE == NEO_RBG || NEOPIXEL_TYPE == NEO_GRB || NEOPIXEL_TYPE == NEO_GBR || NEOPIXEL_TYPE == NEO_BRG || NEOPIXEL_TYPE == NEO_BGR - #define NEO_WHITE 255, 255, 255 - #else - #define NEO_WHITE 0, 0, 0, 255 - #endif -#endif - -#if ENABLED(RGB_LED) || ENABLED(BLINKM) || ENABLED(PCA9632) - #define LED_WHITE 255, 255, 255 -#elif ENABLED(RGBW_LED) - #define LED_WHITE 0, 0, 0, 255 -#endif - #if ENABLED(CNC_COORDINATE_SYSTEMS) int8_t active_coordinate_system = -1; // machine space float coordinate_system[MAX_COORDINATE_SYSTEMS][XYZ]; @@ -1039,124 +990,6 @@ void servo_init() { #endif -#if HAS_COLOR_LEDS - - #if ENABLED(NEOPIXEL_LED) - - Adafruit_NeoPixel pixels(NEOPIXEL_PIXELS, NEOPIXEL_PIN, NEOPIXEL_TYPE + NEO_KHZ800); - - void set_neopixel_color(const uint32_t color) { - for (uint16_t i = 0; i < pixels.numPixels(); ++i) - pixels.setPixelColor(i, color); - pixels.show(); - } - - void setup_neopixel() { - pixels.setBrightness(NEOPIXEL_BRIGHTNESS); // 0 - 255 range - pixels.begin(); - pixels.show(); // initialize to all off - - #if ENABLED(NEOPIXEL_STARTUP_TEST) - safe_delay(1000); - set_neopixel_color(pixels.Color(255, 0, 0, 0)); // red - safe_delay(1000); - set_neopixel_color(pixels.Color(0, 255, 0, 0)); // green - safe_delay(1000); - set_neopixel_color(pixels.Color(0, 0, 255, 0)); // blue - safe_delay(1000); - #endif - set_neopixel_color(pixels.Color(NEO_WHITE)); // white - } - - #endif // NEOPIXEL_LED - - void set_led_color( - const uint8_t r, const uint8_t g, const uint8_t b - #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED) - , const uint8_t w = 0 - #if ENABLED(NEOPIXEL_LED) - , const uint8_t p = NEOPIXEL_BRIGHTNESS - , bool isSequence = false - #endif - #endif - ) { - - #if ENABLED(NEOPIXEL_LED) - - const uint32_t color = pixels.Color(r, g, b, w); - static uint16_t nextLed = 0; - - pixels.setBrightness(p); - if (!isSequence) - set_neopixel_color(color); - else { - pixels.setPixelColor(nextLed, color); - pixels.show(); - if (++nextLed >= pixels.numPixels()) nextLed = 0; - return; - } - - #endif - - #if ENABLED(BLINKM) - - // This variant uses i2c to send the RGB components to the device. - SendColors(r, g, b); - - #endif - - #if ENABLED(RGB_LED) || ENABLED(RGBW_LED) - - // This variant uses 3 separate pins for the RGB components. - // If the pins can do PWM then their intensity will be set. - WRITE(RGB_LED_R_PIN, r ? HIGH : LOW); - WRITE(RGB_LED_G_PIN, g ? HIGH : LOW); - WRITE(RGB_LED_B_PIN, b ? HIGH : LOW); - analogWrite(RGB_LED_R_PIN, r); - analogWrite(RGB_LED_G_PIN, g); - analogWrite(RGB_LED_B_PIN, b); - - #if ENABLED(RGBW_LED) - WRITE(RGB_LED_W_PIN, w ? HIGH : LOW); - analogWrite(RGB_LED_W_PIN, w); - #endif - - #endif - - #if ENABLED(PCA9632) - // Update I2C LED driver - PCA9632_SetColor(r, g, b); - #endif - - #if ENABLED(LED_CONTROL_MENU) - if ((r + g + b - #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED) - + w - #endif - ) >= 3) { - led_intensity_red = r; - led_intensity_green = g; - led_intensity_blue = b; - #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED) - led_intensity_white = w; - #endif - #if ENABLED(NEOPIXEL_LED) - led_intensity = p; - #endif - } - #endif - } - - void set_led_white() { - #if ENABLED(NEOPIXEL_LED) - set_neopixel_color(pixels.Color(NEO_WHITE)); - #else - set_led_color(LED_WHITE); - #endif - } - -#endif // HAS_COLOR_LEDS - void gcode_line_error(const char* err, bool doFlush = true) { SERIAL_ERROR_START(); serialprintPGM(err); @@ -1342,13 +1175,13 @@ inline void get_serial_commands() { SERIAL_PROTOCOLLNPGM(MSG_FILE_PRINTED); #if ENABLED(PRINTER_EVENT_LEDS) LCD_MESSAGEPGM(MSG_INFO_COMPLETED_PRINTS); - set_led_color(0, 255, 0); // Green + leds.set_green(); #if HAS_RESUME_CONTINUE enqueue_and_echo_commands_P(PSTR("M0")); // end of the queue! #else safe_delay(1000); #endif - set_led_color(0, 0, 0); // OFF + leds.set_off(); #endif card.checkautostart(true); } @@ -8039,14 +7872,11 @@ inline void gcode_M109() { const uint8_t blue = map(constrain(temp, start_temp, target_temp), start_temp, target_temp, 255, 0); if (blue != old_blue) { old_blue = blue; - set_led_color(255, 0, blue - #if ENABLED(NEOPIXEL_LED) - , 0 - , pixels.getBrightness() + leds.set_color( + MakeLEDColor(255, 0, blue, 0, pixels.getBrightness()) #if ENABLED(NEOPIXEL_IS_SEQUENTIAL) , true #endif - #endif ); } } @@ -8083,12 +7913,7 @@ inline void gcode_M109() { if (wait_for_heatup) { LCD_MESSAGEPGM(MSG_HEATING_COMPLETE); #if ENABLED(PRINTER_EVENT_LEDS) - #if ENABLED(RGB_LED) || ENABLED(BLINKM) || ENABLED(PCA9632) || ENABLED(RGBW_LED) - set_led_color(LED_WHITE); - #endif - #if ENABLED(NEOPIXEL_LED) - set_neopixel_color(pixels.Color(NEO_WHITE)); - #endif + leds.set_white(); #endif } @@ -8184,12 +8009,10 @@ inline void gcode_M109() { const uint8_t red = map(constrain(temp, start_temp, target_temp), start_temp, target_temp, 0, 255); if (red != old_red) { old_red = red; - set_led_color(red, 0, 255 - #if ENABLED(NEOPIXEL_LED) - , 0, pixels.getBrightness() - #if ENABLED(NEOPIXEL_IS_SEQUENTIAL) - , true - #endif + leds.set_color( + MakeLEDColor(red, 0, 255, 0, pixels.getBrightness()) + #if ENABLED(NEOPIXEL_IS_SEQUENTIAL) + , true #endif ); } @@ -8866,17 +8689,13 @@ inline void gcode_M121() { endstops.enable_globally(false); } * M150 P ; Set LED full brightness */ inline void gcode_M150() { - set_led_color( + leds.set_color(MakeLEDColor( parser.seen('R') ? (parser.has_value() ? parser.value_byte() : 255) : 0, parser.seen('U') ? (parser.has_value() ? parser.value_byte() : 255) : 0, - parser.seen('B') ? (parser.has_value() ? parser.value_byte() : 255) : 0 - #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED) - , parser.seen('W') ? (parser.has_value() ? parser.value_byte() : 255) : 0 - #if ENABLED(NEOPIXEL_LED) - , parser.seen('P') ? (parser.has_value() ? parser.value_byte() : 255) : pixels.getBrightness() - #endif - #endif - ); + parser.seen('B') ? (parser.has_value() ? parser.value_byte() : 255) : 0, + parser.seen('W') ? (parser.has_value() ? parser.value_byte() : 255) : 0, + parser.seen('P') ? (parser.has_value() ? parser.value_byte() : 255) : pixels.getBrightness() + )); } #endif // HAS_COLOR_LEDS @@ -14034,9 +13853,8 @@ void setup() { OUT_WRITE(STAT_LED_BLUE_PIN, LOW); // turn it off #endif - #if ENABLED(NEOPIXEL_LED) - SET_OUTPUT(NEOPIXEL_PIN); - setup_neopixel(); + #if HAS_COLOR_LEDS + leds.setup(); #endif #if ENABLED(RGB_LED) || ENABLED(RGBW_LED) diff --git a/Marlin/blinkm.cpp b/Marlin/blinkm.cpp index 1caf0a071..7eba6c0d9 100644 --- a/Marlin/blinkm.cpp +++ b/Marlin/blinkm.cpp @@ -21,26 +21,26 @@ */ /** - * blinkm.cpp - Library for controlling a BlinkM over i2c - * Created by Tim Koster, August 21 2013. + * blinkm.cpp - Control a BlinkM over i2c */ -#include "Marlin.h" +#include "MarlinConfig.h" #if ENABLED(BLINKM) #include "blinkm.h" +#include "leds.h" +#include -void SendColors(byte red, byte grn, byte blu) { +void blinkm_set_led_color(const LEDColor &color) { Wire.begin(); Wire.beginTransmission(0x09); Wire.write('o'); //to disable ongoing script, only needs to be used once Wire.write('n'); - Wire.write(red); - Wire.write(grn); - Wire.write(blu); + Wire.write(color.r); + Wire.write(color.g); + Wire.write(color.b); Wire.endTransmission(); } #endif // BLINKM - diff --git a/Marlin/blinkm.h b/Marlin/blinkm.h index ed2ad79bb..20e84d9a9 100644 --- a/Marlin/blinkm.h +++ b/Marlin/blinkm.h @@ -21,11 +21,15 @@ */ /** - * blinkm.h - Library for controlling a BlinkM over i2c - * Created by Tim Koster, August 21 2013. + * blinkm.h - Control a BlinkM over i2c */ -#include "Arduino.h" -#include "Wire.h" +#ifndef _BLINKM_H_ +#define _BLINKM_H_ -void SendColors(byte red, byte grn, byte blu); +struct LEDColor; +typedef LEDColor LEDColor; + +void blinkm_set_led_color(const LEDColor &color); + +#endif // _BLINKM_H_ diff --git a/Marlin/language_en.h b/Marlin/language_en.h index d2d93dc59..a4cd4ef97 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -361,63 +361,65 @@ #ifndef MSG_UBL_STEP_BY_STEP_MENU #define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Step-By-Step UBL") #endif + #ifndef MSG_LED_CONTROL #define MSG_LED_CONTROL _UxGT("LED Control") #endif -#ifndef MSG_LEDS_OFF - #define MSG_LEDS_OFF _UxGT("Turn Off Lights") +#ifndef MSG_LEDS_ON + #define MSG_LEDS_ON _UxGT("Lights On") #endif -#ifndef MSG_LED_ON - #define MSG_LED_ON _UxGT("Turn on ") +#ifndef MSG_LEDS_OFF + #define MSG_LEDS_OFF _UxGT("Lights Off") #endif -#ifndef MSG_RED - #define MSG_RED _UxGT("Red ") +#ifndef MSG_LED_PRESETS + #define MSG_LED_PRESETS _UxGT("Light Presets") #endif -#ifndef MSG_ORANGE - #define MSG_ORANGE _UxGT("Orange ") +#ifndef MSG_SET_LEDS_RED + #define MSG_SET_LEDS_RED _UxGT("Lights Red") #endif -#ifndef MSG_YELLOW - #define MSG_YELLOW _UxGT("Yellow ") +#ifndef MSG_SET_LEDS_ORANGE + #define MSG_SET_LEDS_ORANGE _UxGT("Lights Orange") #endif -#ifndef MSG_GREEN - #define MSG_GREEN _UxGT("Green ") +#ifndef MSG_SET_LEDS_YELLOW + #define MSG_SET_LEDS_YELLOW _UxGT("Lights Yellow") #endif -#ifndef MSG_BLUE - #define MSG_BLUE _UxGT("Blue ") +#ifndef MSG_SET_LEDS_GREEN + #define MSG_SET_LEDS_GREEN _UxGT("Lights Green") #endif -#ifndef MSG_PURPLE - #define MSG_PURPLE _UxGT("Purple ") +#ifndef MSG_SET_LEDS_BLUE + #define MSG_SET_LEDS_BLUE _UxGT("Lights Blue") #endif -#ifndef MSG_WHITE - #define MSG_WHITE _UxGT("White ") +#ifndef MSG_SET_LEDS_INDIGO + #define MSG_SET_LEDS_INDIGO _UxGT("Lights Indigo") #endif -#ifndef MSG_CUSTOM - #define MSG_CUSTOM _UxGT("Custom ") +#ifndef MSG_SET_LEDS_VIOLET + #define MSG_SET_LEDS_VIOLET _UxGT("Lights Violet") #endif -#ifndef MSG_LED_PRESET - #define MSG_LED_PRESET _UxGT("Preset ") +#ifndef MSG_SET_LEDS_WHITE + #define MSG_SET_LEDS_WHITE _UxGT("Lights White") #endif -#ifndef MSG_LED_DEFAULT - #define MSG_LED_DEFAULT _UxGT("Default ") +#ifndef MSG_SET_LEDS_DEFAULT + #define MSG_SET_LEDS_DEFAULT _UxGT("Lights Default") #endif -#ifndef MSG_LIGHTS - #define MSG_LIGHTS _UxGT("Lights ") +#ifndef MSG_CUSTOM_LEDS + #define MSG_CUSTOM_LEDS _UxGT("Custom Lights") #endif -#ifndef MSG_COLOR - #define MSG_COLOR _UxGT("Color") +#ifndef MSG_INTENSITY_R + #define MSG_INTENSITY_R _UxGT("Red Intensity") #endif -#ifndef MSG_LED_INTENSITY - #define MSG_LED_INTENSITY _UxGT("Intensity ") +#ifndef MSG_INTENSITY_G + #define MSG_INTENSITY_G _UxGT("Green Intensity") #endif -#ifndef MSG_LED_CUSTOM - #define MSG_LED_CUSTOM _UxGT("Custom LED") +#ifndef MSG_INTENSITY_B + #define MSG_INTENSITY_B _UxGT("Blue Intensity") #endif -#ifndef MSG_LED_SAVE - #define MSG_LED_SAVE _UxGT("Save ") +#ifndef MSG_INTENSITY_W + #define MSG_INTENSITY_W _UxGT("White Intensity") #endif -#ifndef MSG_LED_LOAD - #define MSG_LED_LOAD _UxGT("Load ") +#ifndef MSG_LED_BRIGHTNESS + #define MSG_LED_BRIGHTNESS _UxGT("Brightness") #endif + #ifndef MSG_MOVING #define MSG_MOVING _UxGT("Moving...") #endif diff --git a/Marlin/leds.cpp b/Marlin/leds.cpp new file mode 100644 index 000000000..df798acf8 --- /dev/null +++ b/Marlin/leds.cpp @@ -0,0 +1,140 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * leds.cpp - Marlin RGB LED general support + */ + +#include "MarlinConfig.h" + +#if HAS_COLOR_LEDS + +#include "leds.h" + +#if ENABLED(BLINKM) + #include "blinkm.h" +#endif + +#if ENABLED(PCA9632) + #include "pca9632.h" +#endif + +#if ENABLED(LED_COLOR_PRESETS) + const LEDColor LEDLights::defaultLEDColor = MakeLEDColor( + LED_USER_PRESET_RED, + LED_USER_PRESET_GREEN, + LED_USER_PRESET_BLUE, + LED_USER_PRESET_WHITE, + LED_USER_PRESET_BRIGHTNESS + ); +#endif + +#if ENABLED(LED_CONTROL_MENU) + LEDColor LEDLights::color; + bool LEDLights::lights_on; +#endif + +LEDLights leds; + +void LEDLights::setup() { + #if ENABLED(NEOPIXEL_LED) + setup_neopixel(); + #endif + #if ENABLED(LED_USER_PRESET_STARTUP) + set_default(); + #endif +} + +void LEDLights::set_color(const LEDColor &incol + #if ENABLED(NEOPIXEL_LED) + , bool isSequence/*=false*/ + #endif +) { + + #if ENABLED(NEOPIXEL_LED) + + const uint32_t neocolor = pixels.Color(incol.r, incol.g, incol.b, incol.w); + static uint16_t nextLed = 0; + + pixels.setBrightness(incol.i); + if (!isSequence) + set_neopixel_color(neocolor); + else { + pixels.setPixelColor(nextLed, neocolor); + pixels.show(); + if (++nextLed >= pixels.numPixels()) nextLed = 0; + return; + } + + #endif + + #if ENABLED(BLINKM) + + // This variant uses i2c to send the RGB components to the device. + blinkm_set_led_color(incol); + + #endif + + #if ENABLED(RGB_LED) || ENABLED(RGBW_LED) + + // This variant uses 3-4 separate pins for the RGB(W) components. + // If the pins can do PWM then their intensity will be set. + WRITE(RGB_LED_R_PIN, incol.r ? HIGH : LOW); + WRITE(RGB_LED_G_PIN, incol.g ? HIGH : LOW); + WRITE(RGB_LED_B_PIN, incol.b ? HIGH : LOW); + analogWrite(RGB_LED_R_PIN, incol.r); + analogWrite(RGB_LED_G_PIN, incol.g); + analogWrite(RGB_LED_B_PIN, incol.b); + + #if ENABLED(RGBW_LED) + WRITE(RGB_LED_W_PIN, incol.w ? HIGH : LOW); + analogWrite(RGB_LED_W_PIN, incol.w); + #endif + + #endif + + #if ENABLED(PCA9632) + // Update I2C LED driver + pca9632_set_led_color(incol); + #endif + + #if ENABLED(LED_CONTROL_MENU) + // Don't update the color when OFF + lights_on = !incol.is_off(); + if (lights_on) color = incol; + #endif +} + +void LEDLights::set_white() { + #if ENABLED(RGB_LED) || ENABLED(RGBW_LED) || ENABLED(BLINKM) || ENABLED(PCA9632) + set_color(LEDColorWhite()); + #endif + #if ENABLED(NEOPIXEL_LED) + set_neopixel_color(pixels.Color(NEO_WHITE)); + #endif +} + +#if ENABLED(LED_CONTROL_MENU) + void LEDLights::toggle() { if (lights_on) set_off(); else update(); } +#endif + +#endif // HAS_COLOR_LEDS diff --git a/Marlin/leds.h b/Marlin/leds.h new file mode 100644 index 000000000..a0cf28b84 --- /dev/null +++ b/Marlin/leds.h @@ -0,0 +1,169 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * leds.h - Marlin general RGB LED support + */ + +#ifndef __LEDS_H__ +#define __LEDS_H__ + +#include "MarlinConfig.h" + +#if ENABLED(NEOPIXEL_LED) + #include "neopixel.h" +#endif + +#define HAS_WHITE_LED (ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED)) + +/** + * LEDcolor type for use with leds.set_color + */ +typedef struct LEDColor { + uint8_t r, g, b + #if HAS_WHITE_LED + , w + #if ENABLED(NEOPIXEL_LED) + , i + #endif + #endif + ; + LEDColor() : r(255), g(255), b(255) + #if HAS_WHITE_LED + , w(255) + #if ENABLED(NEOPIXEL_LED) + , i(NEOPIXEL_BRIGHTNESS) + #endif + #endif + {} + LEDColor(uint8_t r, uint8_t g, uint8_t b + #if HAS_WHITE_LED + , uint8_t w=0 + #if ENABLED(NEOPIXEL_LED) + , uint8_t i=NEOPIXEL_BRIGHTNESS + #endif + #endif + ) : r(r), g(g), b(b) + #if HAS_WHITE_LED + , w(w) + #if ENABLED(NEOPIXEL_LED) + , i(i) + #endif + #endif + {} + LEDColor& operator=(const LEDColor &right) { + if (this != &right) memcpy(this, &right, sizeof(LEDColor)); + return *this; + } + bool operator==(const LEDColor &right) { + if (this == &right) return true; + return 0 == memcmp(this, &right, sizeof(LEDColor)); + } + bool operator!=(const LEDColor &right) { return !operator==(right); } + bool is_off() const { + return 3 > r + g + b + #if HAS_WHITE_LED + + w + #endif + ; + } +} LEDColor; + +/** + * Color helpers and presets + */ +#if HAS_WHITE_LED + #define LEDColorWhite() LEDColor(0, 0, 0, 255) + #if ENABLED(NEOPIXEL_LED) + #define MakeLEDColor(R,G,B,W,I) LEDColor(R, G, B, W, I) + #else + #define MakeLEDColor(R,G,B,W,I) LEDColor(R, G, B, W) + #endif +#else + #define MakeLEDColor(R,G,B,W,I) LEDColor(R, G, B) + #define LEDColorWhite() LEDColor(255, 255, 255) +#endif +#define LEDColorOff() LEDColor( 0, 0, 0) +#define LEDColorRed() LEDColor(255, 0, 0) +#define LEDColorOrange() LEDColor(255, 80, 0) +#define LEDColorYellow() LEDColor(255, 255, 0) +#define LEDColorGreen() LEDColor( 0, 255, 0) +#define LEDColorBlue() LEDColor( 0, 0, 255) +#define LEDColorIndigo() LEDColor( 0, 255, 255) +#define LEDColorViolet() LEDColor(255, 0, 255) + +class LEDLights { +public: + LEDLights() {} // ctor + + static void setup(); // init() + + static void set_color(const LEDColor &color + #if ENABLED(NEOPIXEL_LED) + , bool isSequence=false + #endif + ); + + FORCE_INLINE void set_color(uint8_t r, uint8_t g, uint8_t b + #if HAS_WHITE_LED + , uint8_t w=0 + #if ENABLED(NEOPIXEL_LED) + , uint8_t i=NEOPIXEL_BRIGHTNESS + #endif + #endif + #if ENABLED(NEOPIXEL_LED) + , bool isSequence=false + #endif + ) { + set_color(MakeLEDColor(r, g, b, w, i) + #if ENABLED(NEOPIXEL_LED) + , isSequence + #endif + ); + } + + static void set_white(); + FORCE_INLINE static void set_off() { set_color(LEDColorOff()); } + FORCE_INLINE static void set_green() { set_color(LEDColorGreen()); } + + #if ENABLED(LED_COLOR_PRESETS) + static const LEDColor defaultLEDColor; + FORCE_INLINE static void set_default() { set_color(defaultLEDColor); } + FORCE_INLINE static void set_red() { set_color(LEDColorRed()); } + FORCE_INLINE static void set_orange() { set_color(LEDColorOrange()); } + FORCE_INLINE static void set_yellow() { set_color(LEDColorYellow()); } + FORCE_INLINE static void set_blue() { set_color(LEDColorBlue()); } + FORCE_INLINE static void set_indigo() { set_color(LEDColorIndigo()); } + FORCE_INLINE static void set_violet() { set_color(LEDColorViolet()); } + #endif + + #if ENABLED(LED_CONTROL_MENU) + static LEDColor color; // last non-off color + static bool lights_on; // the last set color was "on" + static void toggle(); // swap "off" with color + FORCE_INLINE static void update() { set_color(color); } + #endif +}; + +extern LEDLights leds; + +#endif // __LEDS_H__ diff --git a/Marlin/neopixel.cpp b/Marlin/neopixel.cpp new file mode 100644 index 000000000..8d8a5445e --- /dev/null +++ b/Marlin/neopixel.cpp @@ -0,0 +1,60 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * neopixel.cpp + */ + +#include "MarlinConfig.h" + +#if ENABLED(NEOPIXEL_LED) + +#include "neopixel.h" + +Adafruit_NeoPixel pixels(NEOPIXEL_PIXELS, NEOPIXEL_PIN, NEOPIXEL_TYPE + NEO_KHZ800); + +void set_neopixel_color(const uint32_t color) { + for (uint16_t i = 0; i < pixels.numPixels(); ++i) + pixels.setPixelColor(i, color); + pixels.show(); +} + +void setup_neopixel() { + SET_OUTPUT(NEOPIXEL_PIN); + pixels.setBrightness(NEOPIXEL_BRIGHTNESS); // 0 - 255 range + pixels.begin(); + pixels.show(); // initialize to all off + + #if ENABLED(NEOPIXEL_STARTUP_TEST) + safe_delay(1000); + set_neopixel_color(pixels.Color(255, 0, 0, 0)); // red + safe_delay(1000); + set_neopixel_color(pixels.Color(0, 255, 0, 0)); // green + safe_delay(1000); + set_neopixel_color(pixels.Color(0, 0, 255, 0)); // blue + safe_delay(1000); + #endif + set_neopixel_color(pixels.Color(NEO_WHITE)); // white +} + +#endif // NEOPIXEL_LED + diff --git a/Marlin/neopixel.h b/Marlin/neopixel.h new file mode 100644 index 000000000..b7ed45c82 --- /dev/null +++ b/Marlin/neopixel.h @@ -0,0 +1,44 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * neopixel.h + */ + +#include "MarlinConfig.h" + +#define NEOPIXEL_IS_RGB (NEOPIXEL_TYPE == NEO_RGB || NEOPIXEL_TYPE == NEO_RBG || NEOPIXEL_TYPE == NEO_GRB || NEOPIXEL_TYPE == NEO_GBR || NEOPIXEL_TYPE == NEO_BRG || NEOPIXEL_TYPE == NEO_BGR) +#define NEOPIXEL_IS_RGBW !NEOPIXEL_IS_RGB + +#if NEOPIXEL_IS_RGB + #define NEO_WHITE 255, 255, 255, 0 +#else + #define NEO_WHITE 0, 0, 0, 255 +#endif + +#include +#include + +void setup_neopixel(); +void set_neopixel_color(const uint32_t color); + +extern Adafruit_NeoPixel pixels; diff --git a/Marlin/pca9632.cpp b/Marlin/pca9632.cpp index 37f7bd7df..2b4ee7f40 100644 --- a/Marlin/pca9632.cpp +++ b/Marlin/pca9632.cpp @@ -20,7 +20,7 @@ * */ -/* +/** * Driver for the Philips PCA9632 LED driver. * Written by Robert Mendon Feb 2017. */ @@ -30,12 +30,13 @@ #if ENABLED(PCA9632) #include "pca9632.h" +#include "leds.h" +#include #define PCA9632_MODE1_VALUE 0b00000001 //(ALLCALL) #define PCA9632_MODE2_VALUE 0b00010101 //(DIMMING, INVERT, CHANGE ON STOP,TOTEM) #define PCA9632_LEDOUT_VALUE 0b00101010 - /* Register addresses */ #define PCA9632_MODE1 0x00 #define PCA9632_MODE2 0x01 @@ -98,7 +99,7 @@ static void PCA9632_WriteAllRegisters(const byte addr, const byte regadd, const } #endif -void PCA9632_SetColor(const byte r, const byte g, const byte b) { +void pca9632_set_led_color(const LEDColor &color) { if (!PCA_init) { PCA_init = 1; Wire.begin(); @@ -106,11 +107,11 @@ void PCA9632_SetColor(const byte r, const byte g, const byte b) { PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_MODE2, PCA9632_MODE2_VALUE); } - const byte LEDOUT = (r ? LED_PWM << PCA9632_RED : 0) - | (g ? LED_PWM << PCA9632_GRN : 0) - | (b ? LED_PWM << PCA9632_BLU : 0); + const byte LEDOUT = (color.r ? LED_PWM << PCA9632_RED : 0) + | (color.g ? LED_PWM << PCA9632_GRN : 0) + | (color.b ? LED_PWM << PCA9632_BLU : 0); - PCA9632_WriteAllRegisters(PCA9632_ADDRESS,PCA9632_PWM0, r, g, b); + PCA9632_WriteAllRegisters(PCA9632_ADDRESS,PCA9632_PWM0, color.r, color.g, color.b); PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_LEDOUT, LEDOUT); } diff --git a/Marlin/pca9632.h b/Marlin/pca9632.h index b8c78f065..4d98267be 100644 --- a/Marlin/pca9632.h +++ b/Marlin/pca9632.h @@ -20,7 +20,7 @@ * */ -/* +/** * Driver for the Philips PCA9632 LED driver. * Written by Robert Mendon Feb 2017. */ @@ -28,9 +28,9 @@ #ifndef __PCA9632_H__ #define __PCA9632_H__ -#include "Arduino.h" -#include "Wire.h" +struct LEDColor; +typedef LEDColor LEDColor; -void PCA9632_SetColor(const byte r, const byte g, const byte b); +void pca9632_set_led_color(const LEDColor &color); #endif // __PCA9632_H__ diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 5c41dcdcc..76348b41d 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -185,20 +185,8 @@ uint16_t max_display_update_time = 0; #endif // LCD_INFO_MENU #if ENABLED(LED_CONTROL_MENU) - extern void set_led_color( - const uint8_t r, const uint8_t g, const uint8_t b - #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED) - , const uint8_t w = 0 - #if ENABLED(NEOPIXEL_LED) - , const uint8_t p = NEOPIXEL_BRIGHTNESS - , bool isSequence = false - #endif - #endif - ); - - extern void set_led_white(); + #include "leds.h" void lcd_led_menu(); - void lcd_led_custom_menu(); #endif #if ENABLED(ADVANCED_PAUSE_FEATURE) @@ -1031,7 +1019,7 @@ void kill_screen(const char* lcd_msg) { #endif #if ENABLED(LED_CONTROL_MENU) - MENU_ITEM(submenu, "LED Control", lcd_led_menu); + MENU_ITEM(submenu, MSG_LED_CONTROL, lcd_led_menu); #endif END_MENU(); @@ -3971,105 +3959,37 @@ void kill_screen(const char* lcd_msg) { #if ENABLED(LED_CONTROL_MENU) - bool led_restore_color = - #if ENABLED(LED_USER_PRESET_STARTUP) - false; - #else - true; - #endif + #if ENABLED(LED_COLOR_PRESETS) - extern uint8_t led_intensity_red, - led_intensity_green, - led_intensity_blue - #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED) - , led_intensity_white - #endif - #if ENABLED(NEOPIXEL_LED) - , led_intensity - #endif - ; - - void update_leds() { - if (led_restore_color) { - #if ENABLED(LED_COLOR_PRESETS) - led_intensity_red = LED_USER_PRESET_RED; - led_intensity_green = LED_USER_PRESET_GREEN; - led_intensity_blue = LED_USER_PRESET_BLUE; - #if ENABLED(RGBW_LED) - led_intensity_white = LED_USER_PRESET_WHITE; - #endif - #if ENABLED(NEOPIXEL_LED) - led_intensity = LED_USER_PRESET_INTENSITY; - #endif - #else - led_intensity_red = 255; - led_intensity_green = 255; - led_intensity_blue = 255; - #if ENABLED(RGBW_LED) - led_intensity_white = 0; - #endif - #if ENABLED(NEOPIXEL_LED) - led_intensity = LED_USER_PRESET_INTENSITY; - #endif + void lcd_led_presets_menu() { + START_MENU(); + #if LCD_HEIGHT > 2 + STATIC_ITEM(MSG_LED_PRESETS, true, true); #endif - led_restore_color = false; + MENU_BACK(MSG_LED_CONTROL); + MENU_ITEM(function, MSG_SET_LEDS_WHITE, leds.set_white); + MENU_ITEM(function, MSG_SET_LEDS_RED, leds.set_red); + MENU_ITEM(function, MSG_SET_LEDS_ORANGE, leds.set_orange); + MENU_ITEM(function, MSG_SET_LEDS_YELLOW,leds.set_yellow); + MENU_ITEM(function, MSG_SET_LEDS_GREEN, leds.set_green); + MENU_ITEM(function, MSG_SET_LEDS_BLUE, leds.set_blue); + MENU_ITEM(function, MSG_SET_LEDS_INDIGO, leds.set_indigo); + MENU_ITEM(function, MSG_SET_LEDS_VIOLET, leds.set_violet); + END_MENU(); } - - set_led_color(led_intensity_red, led_intensity_green, led_intensity_blue - #if ENABLED(RGBW_LED) - , led_intensity_white - #endif - #if ENABLED(NEOPIXEL_LED) - , 0, led_intensity - #endif - ); - led_restore_color = false; - } - - void led_restore_default() { - led_restore_color = true; - update_leds(); - } - - void set_leds_off() { - set_led_color(0, 0, 0 - #if ENABLED(RGBW) || ENABLED(NEOPIXEL_LED) - , 0 - #endif - ); - } - - void lcd_led_red() { set_led_color(255, 0, 0); } - void lcd_led_orange() { set_led_color(150, 60, 0); } - void lcd_led_yellow() { set_led_color(255, 255, 0); } - void lcd_led_green() { set_led_color(0, 255, 0); } - void lcd_led_blue() { set_led_color(0, 0, 255); } - void lcd_led_purple() { set_led_color(255, 0, 255); } - - void lcd_led_presets_menu() { - START_MENU(); - MENU_BACK(MSG_LED_CONTROL); - MENU_ITEM(function, MSG_LED_ON MSG_RED MSG_LIGHTS, lcd_led_red); - MENU_ITEM(function, MSG_LED_ON MSG_ORANGE MSG_LIGHTS, lcd_led_orange); - MENU_ITEM(function, MSG_LED_ON MSG_YELLOW MSG_LIGHTS,lcd_led_yellow); - MENU_ITEM(function, MSG_LED_ON MSG_GREEN MSG_LIGHTS, lcd_led_green); - MENU_ITEM(function, MSG_LED_ON MSG_BLUE MSG_LIGHTS, lcd_led_blue); - MENU_ITEM(function, MSG_LED_ON MSG_PURPLE MSG_LIGHTS, lcd_led_purple); - MENU_ITEM(function, MSG_LED_ON MSG_WHITE MSG_LIGHTS, set_led_white); - END_MENU(); - } + #endif // LED_COLOR_PRESETS void lcd_led_custom_menu() { START_MENU(); MENU_BACK(MSG_LED_CONTROL); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_RED MSG_LED_INTENSITY, &led_intensity_red, 0, 255, update_leds, true); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_GREEN MSG_LED_INTENSITY, &led_intensity_green, 0, 255, update_leds, true); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_BLUE MSG_LED_INTENSITY, &led_intensity_blue, 0, 255, update_leds, true); + MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_R, &leds.color.r, 0, 255, leds.update, true); + MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_G, &leds.color.g, 0, 255, leds.update, true); + MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_B, &leds.color.b, 0, 255, leds.update, true); #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED) - MENU_ITEM_EDIT_CALLBACK(int8, MSG_WHITE MSG_LED_INTENSITY, &led_intensity_white, 0, 255, update_leds, true); - #endif - #if ENABLED(NEOPIXEL_LED) - MENU_ITEM_EDIT_CALLBACK(int8, MSG_LED_INTENSITY, &led_intensity, 0, 255, update_leds, true); + MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_W, &leds.color.w, 0, 255, leds.update, true); + #if ENABLED(NEOPIXEL_LED) + MENU_ITEM_EDIT_CALLBACK(int8, MSG_LED_BRIGHTNESS, &leds.color.i, 0, 255, leds.update, true); + #endif #endif END_MENU(); } @@ -4077,13 +3997,15 @@ void kill_screen(const char* lcd_msg) { void lcd_led_menu() { START_MENU(); MENU_BACK(MSG_MAIN); - MENU_ITEM(function, MSG_LIGHTS MSG_OFF, set_leds_off); // works - MENU_ITEM(function, MSG_LIGHTS MSG_ON, update_leds); // works - MENU_ITEM(function, MSG_LED_LOAD MSG_LED_DEFAULT MSG_COLOR, led_restore_default); // works + if (leds.lights_on) + MENU_ITEM(function, MSG_LEDS_OFF, leds.toggle); + else + MENU_ITEM(function, MSG_LEDS_ON, leds.toggle); + MENU_ITEM(function, MSG_SET_LEDS_DEFAULT, leds.set_default); #if ENABLED(LED_COLOR_PRESETS) - MENU_ITEM(submenu, MSG_LED_PRESET MSG_LIGHTS, lcd_led_presets_menu); + MENU_ITEM(submenu, MSG_LED_PRESETS, lcd_led_presets_menu); #endif - MENU_ITEM(submenu, MSG_CUSTOM MSG_LIGHTS, lcd_led_custom_menu); + MENU_ITEM(submenu, MSG_CUSTOM_LEDS, lcd_led_custom_menu); END_MENU(); }