瀏覽代碼

Merge pull request #8388 from Tannoo/2.0.x-led_control_menu

[2.0] led_control_menu
Scott Lahteine 7 年之前
父節點
當前提交
bee2b5eea4
No account linked to committer's email address
共有 54 個文件被更改,包括 1014 次插入116 次删除
  1. 1
    1
      .travis.yml
  2. 17
    0
      Marlin/Configuration_adv.h
  3. 2
    2
      Marlin/src/Marlin.cpp
  4. 17
    0
      Marlin/src/config/default/Configuration_adv.h
  5. 17
    0
      Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h
  6. 17
    0
      Marlin/src/config/examples/Anet/A6/Configuration_adv.h
  7. 17
    0
      Marlin/src/config/examples/Anet/A8/Configuration_adv.h
  8. 17
    0
      Marlin/src/config/examples/Azteeg/X5GT/Configuration_adv.h
  9. 17
    0
      Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h
  10. 17
    0
      Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h
  11. 17
    0
      Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h
  12. 17
    0
      Marlin/src/config/examples/Cartesio/Configuration_adv.h
  13. 17
    0
      Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h
  14. 17
    0
      Marlin/src/config/examples/Felix/Configuration_adv.h
  15. 17
    0
      Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h
  16. 17
    0
      Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h
  17. 17
    0
      Marlin/src/config/examples/Malyan/M150/Configuration_adv.h
  18. 17
    0
      Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h
  19. 17
    0
      Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h
  20. 17
    0
      Marlin/src/config/examples/RigidBot/Configuration_adv.h
  21. 17
    0
      Marlin/src/config/examples/SCARA/Configuration_adv.h
  22. 17
    0
      Marlin/src/config/examples/Sanguinololu/Configuration_adv.h
  23. 17
    0
      Marlin/src/config/examples/TinyBoy2/Configuration_adv.h
  24. 17
    0
      Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h
  25. 17
    0
      Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h
  26. 17
    0
      Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h
  27. 17
    0
      Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h
  28. 17
    0
      Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h
  29. 17
    0
      Marlin/src/config/examples/delta/generic/Configuration_adv.h
  30. 17
    0
      Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h
  31. 17
    0
      Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h
  32. 17
    0
      Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h
  33. 17
    0
      Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h
  34. 17
    0
      Marlin/src/config/examples/makibox/Configuration_adv.h
  35. 17
    0
      Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h
  36. 17
    0
      Marlin/src/config/examples/wt150/Configuration_adv.h
  37. 7
    7
      Marlin/src/feature/leds/blinkm.cpp
  38. 7
    8
      Marlin/src/feature/leds/blinkm.h
  39. 79
    25
      Marlin/src/feature/leds/leds.cpp
  40. 125
    24
      Marlin/src/feature/leds/leds.h
  41. 23
    1
      Marlin/src/feature/leds/neopixel.cpp
  42. 2
    1
      Marlin/src/feature/leds/neopixel.h
  43. 7
    5
      Marlin/src/feature/leds/pca9632.cpp
  44. 4
    4
      Marlin/src/feature/leds/pca9632.h
  45. 5
    9
      Marlin/src/gcode/feature/leds/M150.cpp
  46. 2
    2
      Marlin/src/gcode/queue.cpp
  47. 5
    12
      Marlin/src/gcode/temperature/M104_M109.cpp
  48. 4
    6
      Marlin/src/gcode/temperature/M140_M190.cpp
  49. 23
    0
      Marlin/src/inc/Conditionals_post.h
  50. 1
    0
      Marlin/src/inc/MarlinConfig.h
  51. 3
    1
      Marlin/src/inc/SanityCheck.h
  52. 58
    2
      Marlin/src/lcd/language/language_en.h
  53. 72
    0
      Marlin/src/lcd/ultralcd.cpp
  54. 6
    6
      Marlin/src/module/planner.cpp

+ 1
- 1
.travis.yml 查看文件

63
   - opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS
63
   - opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS
64
   - opt_enable BLINKM PCA9632 RGB_LED NEOPIXEL_LED
64
   - opt_enable BLINKM PCA9632 RGB_LED NEOPIXEL_LED
65
   - opt_enable AUTO_BED_LEVELING_LINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE
65
   - opt_enable AUTO_BED_LEVELING_LINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE
66
-  - opt_enable_adv FWRETRACT MAX7219_DEBUG
66
+  - opt_enable_adv FWRETRACT MAX7219_DEBUG LED_CONTROL_MENU
67
   - opt_set ABL_GRID_POINTS_X 16
67
   - opt_set ABL_GRID_POINTS_X 16
68
   - opt_set ABL_GRID_POINTS_Y 16
68
   - opt_set ABL_GRID_POINTS_Y 16
69
   - opt_set_adv FANMUX0_PIN 53
69
   - opt_set_adv FANMUX0_PIN 53

+ 17
- 0
Marlin/Configuration_adv.h 查看文件

482
 // The timeout (in ms) to return to the status screen from sub-menus
482
 // The timeout (in ms) to return to the status screen from sub-menus
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484
 
484
 
485
+/**
486
+ * LED Control Menu
487
+ * Enable this feature to add LED Control to the LCD menu
488
+ */
489
+//#define LED_CONTROL_MENU
490
+#if ENABLED(LED_CONTROL_MENU)
491
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
492
+  #if ENABLED(LED_COLOR_PRESETS)
493
+    #define LED_USER_PRESET_RED        255  // User defined RED value
494
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
495
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
496
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
497
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
498
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
499
+  #endif
500
+#endif // LED_CONTROL_MENU
501
+
485
 #if ENABLED(SDSUPPORT)
502
 #if ENABLED(SDSUPPORT)
486
 
503
 
487
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
504
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 2
- 2
Marlin/src/Marlin.cpp 查看文件

775
     OUT_WRITE(STAT_LED_BLUE_PIN, LOW); // turn it off
775
     OUT_WRITE(STAT_LED_BLUE_PIN, LOW); // turn it off
776
   #endif
776
   #endif
777
 
777
 
778
-  #if ENABLED(NEOPIXEL_LED)
779
-    setup_neopixel();
778
+  #if HAS_COLOR_LEDS
779
+    leds.setup();
780
   #endif
780
   #endif
781
 
781
 
782
   #if ENABLED(RGB_LED) || ENABLED(RGBW_LED)
782
   #if ENABLED(RGB_LED) || ENABLED(RGBW_LED)

+ 17
- 0
Marlin/src/config/default/Configuration_adv.h 查看文件

482
 // The timeout (in ms) to return to the status screen from sub-menus
482
 // The timeout (in ms) to return to the status screen from sub-menus
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484
 
484
 
485
+/**
486
+ * LED Control Menu
487
+ * Enable this feature to add LED Control to the LCD menu
488
+ */
489
+//#define LED_CONTROL_MENU
490
+#if ENABLED(LED_CONTROL_MENU)
491
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
492
+  #if ENABLED(LED_COLOR_PRESETS)
493
+    #define LED_USER_PRESET_RED        255  // User defined RED value
494
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
495
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
496
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
497
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
498
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
499
+  #endif
500
+#endif // LED_CONTROL_MENU
501
+
485
 #if ENABLED(SDSUPPORT)
502
 #if ENABLED(SDSUPPORT)
486
 
503
 
487
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
504
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h 查看文件

482
 // The timeout (in ms) to return to the status screen from sub-menus
482
 // The timeout (in ms) to return to the status screen from sub-menus
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484
 
484
 
485
+/**
486
+ * LED Control Menu
487
+ * Enable this feature to add LED Control to the LCD menu
488
+ */
489
+//#define LED_CONTROL_MENU
490
+#if ENABLED(LED_CONTROL_MENU)
491
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
492
+  #if ENABLED(LED_COLOR_PRESETS)
493
+    #define LED_USER_PRESET_RED        255  // User defined RED value
494
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
495
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
496
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
497
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
498
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
499
+  #endif
500
+#endif // LED_CONTROL_MENU
501
+
485
 #if ENABLED(SDSUPPORT)
502
 #if ENABLED(SDSUPPORT)
486
 
503
 
487
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
504
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/Anet/A6/Configuration_adv.h 查看文件

482
 // The timeout (in ms) to return to the status screen from sub-menus
482
 // The timeout (in ms) to return to the status screen from sub-menus
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484
 
484
 
485
+/**
486
+ * LED Control Menu
487
+ * Enable this feature to add LED Control to the LCD menu
488
+ */
489
+//#define LED_CONTROL_MENU
490
+#if ENABLED(LED_CONTROL_MENU)
491
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
492
+  #if ENABLED(LED_COLOR_PRESETS)
493
+    #define LED_USER_PRESET_RED        255  // User defined RED value
494
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
495
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
496
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
497
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
498
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
499
+  #endif
500
+#endif // LED_CONTROL_MENU
501
+
485
 #if ENABLED(SDSUPPORT)
502
 #if ENABLED(SDSUPPORT)
486
 
503
 
487
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
504
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/Anet/A8/Configuration_adv.h 查看文件

482
 // The timeout (in ms) to return to the status screen from sub-menus
482
 // The timeout (in ms) to return to the status screen from sub-menus
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484
 
484
 
485
+/**
486
+ * LED Control Menu
487
+ * Enable this feature to add LED Control to the LCD menu
488
+ */
489
+//#define LED_CONTROL_MENU
490
+#if ENABLED(LED_CONTROL_MENU)
491
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
492
+  #if ENABLED(LED_COLOR_PRESETS)
493
+    #define LED_USER_PRESET_RED        255  // User defined RED value
494
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
495
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
496
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
497
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
498
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
499
+  #endif
500
+#endif // LED_CONTROL_MENU
501
+
485
 #if ENABLED(SDSUPPORT)
502
 #if ENABLED(SDSUPPORT)
486
 
503
 
487
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
504
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/Azteeg/X5GT/Configuration_adv.h 查看文件

483
 // The timeout (in ms) to return to the status screen from sub-menus
483
 // The timeout (in ms) to return to the status screen from sub-menus
484
 //#define LCD_TIMEOUT_TO_STATUS 15000
484
 //#define LCD_TIMEOUT_TO_STATUS 15000
485
 
485
 
486
+/**
487
+ * LED Control Menu
488
+ * Enable this feature to add LED Control to the LCD menu
489
+ */
490
+//#define LED_CONTROL_MENU
491
+#if ENABLED(LED_CONTROL_MENU)
492
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
493
+  #if ENABLED(LED_COLOR_PRESETS)
494
+    #define LED_USER_PRESET_RED        255  // User defined RED value
495
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
496
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
497
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
498
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
499
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
500
+  #endif
501
+#endif // LED_CONTROL_MENU
502
+
486
 #if ENABLED(SDSUPPORT)
503
 #if ENABLED(SDSUPPORT)
487
 
504
 
488
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
505
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h 查看文件

482
 // The timeout (in ms) to return to the status screen from sub-menus
482
 // The timeout (in ms) to return to the status screen from sub-menus
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484
 
484
 
485
+/**
486
+ * LED Control Menu
487
+ * Enable this feature to add LED Control to the LCD menu
488
+ */
489
+//#define LED_CONTROL_MENU
490
+#if ENABLED(LED_CONTROL_MENU)
491
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
492
+  #if ENABLED(LED_COLOR_PRESETS)
493
+    #define LED_USER_PRESET_RED        255  // User defined RED value
494
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
495
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
496
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
497
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
498
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
499
+  #endif
500
+#endif // LED_CONTROL_MENU
501
+
485
 #if ENABLED(SDSUPPORT)
502
 #if ENABLED(SDSUPPORT)
486
 
503
 
487
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
504
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h 查看文件

482
 // The timeout (in ms) to return to the status screen from sub-menus
482
 // The timeout (in ms) to return to the status screen from sub-menus
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484
 
484
 
485
+/**
486
+ * LED Control Menu
487
+ * Enable this feature to add LED Control to the LCD menu
488
+ */
489
+//#define LED_CONTROL_MENU
490
+#if ENABLED(LED_CONTROL_MENU)
491
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
492
+  #if ENABLED(LED_COLOR_PRESETS)
493
+    #define LED_USER_PRESET_RED        255  // User defined RED value
494
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
495
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
496
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
497
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
498
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
499
+  #endif
500
+#endif // LED_CONTROL_MENU
501
+
485
 #if ENABLED(SDSUPPORT)
502
 #if ENABLED(SDSUPPORT)
486
 
503
 
487
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
504
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h 查看文件

482
 // The timeout (in ms) to return to the status screen from sub-menus
482
 // The timeout (in ms) to return to the status screen from sub-menus
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484
 
484
 
485
+/**
486
+ * LED Control Menu
487
+ * Enable this feature to add LED Control to the LCD menu
488
+ */
489
+//#define LED_CONTROL_MENU
490
+#if ENABLED(LED_CONTROL_MENU)
491
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
492
+  #if ENABLED(LED_COLOR_PRESETS)
493
+    #define LED_USER_PRESET_RED        255  // User defined RED value
494
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
495
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
496
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
497
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
498
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
499
+  #endif
500
+#endif // LED_CONTROL_MENU
501
+
485
 #if ENABLED(SDSUPPORT)
502
 #if ENABLED(SDSUPPORT)
486
 
503
 
487
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
504
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/Cartesio/Configuration_adv.h 查看文件

482
 // The timeout (in ms) to return to the status screen from sub-menus
482
 // The timeout (in ms) to return to the status screen from sub-menus
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484
 
484
 
485
+/**
486
+ * LED Control Menu
487
+ * Enable this feature to add LED Control to the LCD menu
488
+ */
489
+//#define LED_CONTROL_MENU
490
+#if ENABLED(LED_CONTROL_MENU)
491
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
492
+  #if ENABLED(LED_COLOR_PRESETS)
493
+    #define LED_USER_PRESET_RED        255  // User defined RED value
494
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
495
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
496
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
497
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
498
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
499
+  #endif
500
+#endif // LED_CONTROL_MENU
501
+
485
 #if ENABLED(SDSUPPORT)
502
 #if ENABLED(SDSUPPORT)
486
 
503
 
487
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
504
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h 查看文件

482
 // The timeout (in ms) to return to the status screen from sub-menus
482
 // The timeout (in ms) to return to the status screen from sub-menus
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484
 
484
 
485
+/**
486
+ * LED Control Menu
487
+ * Enable this feature to add LED Control to the LCD menu
488
+ */
489
+//#define LED_CONTROL_MENU
490
+#if ENABLED(LED_CONTROL_MENU)
491
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
492
+  #if ENABLED(LED_COLOR_PRESETS)
493
+    #define LED_USER_PRESET_RED        255  // User defined RED value
494
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
495
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
496
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
497
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
498
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
499
+  #endif
500
+#endif // LED_CONTROL_MENU
501
+
485
 #if ENABLED(SDSUPPORT)
502
 #if ENABLED(SDSUPPORT)
486
 
503
 
487
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
504
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/Felix/Configuration_adv.h 查看文件

482
 // The timeout (in ms) to return to the status screen from sub-menus
482
 // The timeout (in ms) to return to the status screen from sub-menus
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484
 
484
 
485
+/**
486
+ * LED Control Menu
487
+ * Enable this feature to add LED Control to the LCD menu
488
+ */
489
+//#define LED_CONTROL_MENU
490
+#if ENABLED(LED_CONTROL_MENU)
491
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
492
+  #if ENABLED(LED_COLOR_PRESETS)
493
+    #define LED_USER_PRESET_RED        255  // User defined RED value
494
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
495
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
496
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
497
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
498
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
499
+  #endif
500
+#endif // LED_CONTROL_MENU
501
+
485
 #if ENABLED(SDSUPPORT)
502
 #if ENABLED(SDSUPPORT)
486
 
503
 
487
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
504
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h 查看文件

482
 // The timeout (in ms) to return to the status screen from sub-menus
482
 // The timeout (in ms) to return to the status screen from sub-menus
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484
 
484
 
485
+/**
486
+ * LED Control Menu
487
+ * Enable this feature to add LED Control to the LCD menu
488
+ */
489
+//#define LED_CONTROL_MENU
490
+#if ENABLED(LED_CONTROL_MENU)
491
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
492
+  #if ENABLED(LED_COLOR_PRESETS)
493
+    #define LED_USER_PRESET_RED        255  // User defined RED value
494
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
495
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
496
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
497
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
498
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
499
+  #endif
500
+#endif // LED_CONTROL_MENU
501
+
485
 #if ENABLED(SDSUPPORT)
502
 #if ENABLED(SDSUPPORT)
486
 
503
 
487
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
504
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h 查看文件

482
 // The timeout (in ms) to return to the status screen from sub-menus
482
 // The timeout (in ms) to return to the status screen from sub-menus
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484
 
484
 
485
+/**
486
+ * LED Control Menu
487
+ * Enable this feature to add LED Control to the LCD menu
488
+ */
489
+//#define LED_CONTROL_MENU
490
+#if ENABLED(LED_CONTROL_MENU)
491
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
492
+  #if ENABLED(LED_COLOR_PRESETS)
493
+    #define LED_USER_PRESET_RED        255  // User defined RED value
494
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
495
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
496
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
497
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
498
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
499
+  #endif
500
+#endif // LED_CONTROL_MENU
501
+
485
 #if ENABLED(SDSUPPORT)
502
 #if ENABLED(SDSUPPORT)
486
 
503
 
487
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
504
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/Malyan/M150/Configuration_adv.h 查看文件

482
 // The timeout (in ms) to return to the status screen from sub-menus
482
 // The timeout (in ms) to return to the status screen from sub-menus
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484
 
484
 
485
+/**
486
+ * LED Control Menu
487
+ * Enable this feature to add LED Control to the LCD menu
488
+ */
489
+//#define LED_CONTROL_MENU
490
+#if ENABLED(LED_CONTROL_MENU)
491
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
492
+  #if ENABLED(LED_COLOR_PRESETS)
493
+    #define LED_USER_PRESET_RED        255  // User defined RED value
494
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
495
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
496
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
497
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
498
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
499
+  #endif
500
+#endif // LED_CONTROL_MENU
501
+
485
 #if ENABLED(SDSUPPORT)
502
 #if ENABLED(SDSUPPORT)
486
 
503
 
487
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
504
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h 查看文件

482
 // The timeout (in ms) to return to the status screen from sub-menus
482
 // The timeout (in ms) to return to the status screen from sub-menus
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484
 
484
 
485
+/**
486
+ * LED Control Menu
487
+ * Enable this feature to add LED Control to the LCD menu
488
+ */
489
+//#define LED_CONTROL_MENU
490
+#if ENABLED(LED_CONTROL_MENU)
491
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
492
+  #if ENABLED(LED_COLOR_PRESETS)
493
+    #define LED_USER_PRESET_RED        255  // User defined RED value
494
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
495
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
496
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
497
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
498
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
499
+  #endif
500
+#endif // LED_CONTROL_MENU
501
+
485
 #if ENABLED(SDSUPPORT)
502
 #if ENABLED(SDSUPPORT)
486
 
503
 
487
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
504
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h 查看文件

483
 // The timeout (in ms) to return to the status screen from sub-menus
483
 // The timeout (in ms) to return to the status screen from sub-menus
484
 //#define LCD_TIMEOUT_TO_STATUS 15000
484
 //#define LCD_TIMEOUT_TO_STATUS 15000
485
 
485
 
486
+/**
487
+ * LED Control Menu
488
+ * Enable this feature to add LED Control to the LCD menu
489
+ */
490
+//#define LED_CONTROL_MENU
491
+#if ENABLED(LED_CONTROL_MENU)
492
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
493
+  #if ENABLED(LED_COLOR_PRESETS)
494
+    #define LED_USER_PRESET_RED        255  // User defined RED value
495
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
496
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
497
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
498
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
499
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
500
+  #endif
501
+#endif // LED_CONTROL_MENU
502
+
486
 #if ENABLED(SDSUPPORT)
503
 #if ENABLED(SDSUPPORT)
487
 
504
 
488
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
505
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/RigidBot/Configuration_adv.h 查看文件

482
 // The timeout (in ms) to return to the status screen from sub-menus
482
 // The timeout (in ms) to return to the status screen from sub-menus
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484
 
484
 
485
+/**
486
+ * LED Control Menu
487
+ * Enable this feature to add LED Control to the LCD menu
488
+ */
489
+//#define LED_CONTROL_MENU
490
+#if ENABLED(LED_CONTROL_MENU)
491
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
492
+  #if ENABLED(LED_COLOR_PRESETS)
493
+    #define LED_USER_PRESET_RED        255  // User defined RED value
494
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
495
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
496
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
497
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
498
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
499
+  #endif
500
+#endif // LED_CONTROL_MENU
501
+
485
 #if ENABLED(SDSUPPORT)
502
 #if ENABLED(SDSUPPORT)
486
 
503
 
487
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
504
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/SCARA/Configuration_adv.h 查看文件

482
 // The timeout (in ms) to return to the status screen from sub-menus
482
 // The timeout (in ms) to return to the status screen from sub-menus
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484
 
484
 
485
+/**
486
+ * LED Control Menu
487
+ * Enable this feature to add LED Control to the LCD menu
488
+ */
489
+//#define LED_CONTROL_MENU
490
+#if ENABLED(LED_CONTROL_MENU)
491
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
492
+  #if ENABLED(LED_COLOR_PRESETS)
493
+    #define LED_USER_PRESET_RED        255  // User defined RED value
494
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
495
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
496
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
497
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
498
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
499
+  #endif
500
+#endif // LED_CONTROL_MENU
501
+
485
 #if ENABLED(SDSUPPORT)
502
 #if ENABLED(SDSUPPORT)
486
 
503
 
487
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
504
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/Sanguinololu/Configuration_adv.h 查看文件

471
 // The timeout (in ms) to return to the status screen from sub-menus
471
 // The timeout (in ms) to return to the status screen from sub-menus
472
 //#define LCD_TIMEOUT_TO_STATUS 15000
472
 //#define LCD_TIMEOUT_TO_STATUS 15000
473
 
473
 
474
+/**
475
+ * LED Control Menu
476
+ * Enable this feature to add LED Control to the LCD menu
477
+ */
478
+//#define LED_CONTROL_MENU
479
+#if ENABLED(LED_CONTROL_MENU)
480
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
481
+  #if ENABLED(LED_COLOR_PRESETS)
482
+    #define LED_USER_PRESET_RED        255  // User defined RED value
483
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
484
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
485
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
486
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
487
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
488
+  #endif
489
+#endif // LED_CONTROL_MENU
490
+
474
 #if ENABLED(SDSUPPORT)
491
 #if ENABLED(SDSUPPORT)
475
 
492
 
476
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
493
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/TinyBoy2/Configuration_adv.h 查看文件

482
 // The timeout (in ms) to return to the status screen from sub-menus
482
 // The timeout (in ms) to return to the status screen from sub-menus
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484
 
484
 
485
+/**
486
+ * LED Control Menu
487
+ * Enable this feature to add LED Control to the LCD menu
488
+ */
489
+//#define LED_CONTROL_MENU
490
+#if ENABLED(LED_CONTROL_MENU)
491
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
492
+  #if ENABLED(LED_COLOR_PRESETS)
493
+    #define LED_USER_PRESET_RED        255  // User defined RED value
494
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
495
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
496
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
497
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
498
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
499
+  #endif
500
+#endif // LED_CONTROL_MENU
501
+
485
 #if ENABLED(SDSUPPORT)
502
 #if ENABLED(SDSUPPORT)
486
 
503
 
487
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
504
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h 查看文件

482
 // The timeout (in ms) to return to the status screen from sub-menus
482
 // The timeout (in ms) to return to the status screen from sub-menus
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484
 
484
 
485
+/**
486
+ * LED Control Menu
487
+ * Enable this feature to add LED Control to the LCD menu
488
+ */
489
+//#define LED_CONTROL_MENU
490
+#if ENABLED(LED_CONTROL_MENU)
491
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
492
+  #if ENABLED(LED_COLOR_PRESETS)
493
+    #define LED_USER_PRESET_RED        255  // User defined RED value
494
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
495
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
496
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
497
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
498
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
499
+  #endif
500
+#endif // LED_CONTROL_MENU
501
+
485
 #if ENABLED(SDSUPPORT)
502
 #if ENABLED(SDSUPPORT)
486
 
503
 
487
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
504
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h 查看文件

495
 // The timeout (in ms) to return to the status screen from sub-menus
495
 // The timeout (in ms) to return to the status screen from sub-menus
496
 //#define LCD_TIMEOUT_TO_STATUS 15000
496
 //#define LCD_TIMEOUT_TO_STATUS 15000
497
 
497
 
498
+/**
499
+ * LED Control Menu
500
+ * Enable this feature to add LED Control to the LCD menu
501
+ */
502
+//#define LED_CONTROL_MENU
503
+#if ENABLED(LED_CONTROL_MENU)
504
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
505
+  #if ENABLED(LED_COLOR_PRESETS)
506
+    #define LED_USER_PRESET_RED        255  // User defined RED value
507
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
508
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
509
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
510
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
511
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
512
+  #endif
513
+#endif // LED_CONTROL_MENU
514
+
498
 #if ENABLED(SDSUPPORT)
515
 #if ENABLED(SDSUPPORT)
499
 
516
 
500
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
517
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h 查看文件

483
 // The timeout (in ms) to return to the status screen from sub-menus
483
 // The timeout (in ms) to return to the status screen from sub-menus
484
 //#define LCD_TIMEOUT_TO_STATUS 15000
484
 //#define LCD_TIMEOUT_TO_STATUS 15000
485
 
485
 
486
+/**
487
+ * LED Control Menu
488
+ * Enable this feature to add LED Control to the LCD menu
489
+ */
490
+//#define LED_CONTROL_MENU
491
+#if ENABLED(LED_CONTROL_MENU)
492
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
493
+  #if ENABLED(LED_COLOR_PRESETS)
494
+    #define LED_USER_PRESET_RED        255  // User defined RED value
495
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
496
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
497
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
498
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
499
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
500
+  #endif
501
+#endif // LED_CONTROL_MENU
502
+
486
 #if ENABLED(SDSUPPORT)
503
 #if ENABLED(SDSUPPORT)
487
 
504
 
488
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
505
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h 查看文件

484
 // The timeout (in ms) to return to the status screen from sub-menus
484
 // The timeout (in ms) to return to the status screen from sub-menus
485
 //#define LCD_TIMEOUT_TO_STATUS 15000
485
 //#define LCD_TIMEOUT_TO_STATUS 15000
486
 
486
 
487
+/**
488
+ * LED Control Menu
489
+ * Enable this feature to add LED Control to the LCD menu
490
+ */
491
+//#define LED_CONTROL_MENU
492
+#if ENABLED(LED_CONTROL_MENU)
493
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
494
+  #if ENABLED(LED_COLOR_PRESETS)
495
+    #define LED_USER_PRESET_RED        255  // User defined RED value
496
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
497
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
498
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
499
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
500
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
501
+  #endif
502
+#endif // LED_CONTROL_MENU
503
+
487
 #if ENABLED(SDSUPPORT)
504
 #if ENABLED(SDSUPPORT)
488
 
505
 
489
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
506
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h 查看文件

484
 // The timeout (in ms) to return to the status screen from sub-menus
484
 // The timeout (in ms) to return to the status screen from sub-menus
485
 //#define LCD_TIMEOUT_TO_STATUS 15000
485
 //#define LCD_TIMEOUT_TO_STATUS 15000
486
 
486
 
487
+/**
488
+ * LED Control Menu
489
+ * Enable this feature to add LED Control to the LCD menu
490
+ */
491
+//#define LED_CONTROL_MENU
492
+#if ENABLED(LED_CONTROL_MENU)
493
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
494
+  #if ENABLED(LED_COLOR_PRESETS)
495
+    #define LED_USER_PRESET_RED        255  // User defined RED value
496
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
497
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
498
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
499
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
500
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
501
+  #endif
502
+#endif // LED_CONTROL_MENU
503
+
487
 #if ENABLED(SDSUPPORT)
504
 #if ENABLED(SDSUPPORT)
488
 
505
 
489
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
506
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/delta/generic/Configuration_adv.h 查看文件

484
 // The timeout (in ms) to return to the status screen from sub-menus
484
 // The timeout (in ms) to return to the status screen from sub-menus
485
 //#define LCD_TIMEOUT_TO_STATUS 15000
485
 //#define LCD_TIMEOUT_TO_STATUS 15000
486
 
486
 
487
+/**
488
+ * LED Control Menu
489
+ * Enable this feature to add LED Control to the LCD menu
490
+ */
491
+//#define LED_CONTROL_MENU
492
+#if ENABLED(LED_CONTROL_MENU)
493
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
494
+  #if ENABLED(LED_COLOR_PRESETS)
495
+    #define LED_USER_PRESET_RED        255  // User defined RED value
496
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
497
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
498
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
499
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
500
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
501
+  #endif
502
+#endif // LED_CONTROL_MENU
503
+
487
 #if ENABLED(SDSUPPORT)
504
 #if ENABLED(SDSUPPORT)
488
 
505
 
489
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
506
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h 查看文件

484
 // The timeout (in ms) to return to the status screen from sub-menus
484
 // The timeout (in ms) to return to the status screen from sub-menus
485
 //#define LCD_TIMEOUT_TO_STATUS 15000
485
 //#define LCD_TIMEOUT_TO_STATUS 15000
486
 
486
 
487
+/**
488
+ * LED Control Menu
489
+ * Enable this feature to add LED Control to the LCD menu
490
+ */
491
+//#define LED_CONTROL_MENU
492
+#if ENABLED(LED_CONTROL_MENU)
493
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
494
+  #if ENABLED(LED_COLOR_PRESETS)
495
+    #define LED_USER_PRESET_RED        255  // User defined RED value
496
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
497
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
498
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
499
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
500
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
501
+  #endif
502
+#endif // LED_CONTROL_MENU
503
+
487
 #if ENABLED(SDSUPPORT)
504
 #if ENABLED(SDSUPPORT)
488
 
505
 
489
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
506
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h 查看文件

489
 // The timeout (in ms) to return to the status screen from sub-menus
489
 // The timeout (in ms) to return to the status screen from sub-menus
490
 //#define LCD_TIMEOUT_TO_STATUS 15000
490
 //#define LCD_TIMEOUT_TO_STATUS 15000
491
 
491
 
492
+/**
493
+ * LED Control Menu
494
+ * Enable this feature to add LED Control to the LCD menu
495
+ */
496
+//#define LED_CONTROL_MENU
497
+#if ENABLED(LED_CONTROL_MENU)
498
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
499
+  #if ENABLED(LED_COLOR_PRESETS)
500
+    #define LED_USER_PRESET_RED        255  // User defined RED value
501
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
502
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
503
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
504
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
505
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
506
+  #endif
507
+#endif // LED_CONTROL_MENU
508
+
492
 #if ENABLED(SDSUPPORT)
509
 #if ENABLED(SDSUPPORT)
493
 
510
 
494
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
511
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h 查看文件

484
 // The timeout (in ms) to return to the status screen from sub-menus
484
 // The timeout (in ms) to return to the status screen from sub-menus
485
 //#define LCD_TIMEOUT_TO_STATUS 15000
485
 //#define LCD_TIMEOUT_TO_STATUS 15000
486
 
486
 
487
+/**
488
+ * LED Control Menu
489
+ * Enable this feature to add LED Control to the LCD menu
490
+ */
491
+//#define LED_CONTROL_MENU
492
+#if ENABLED(LED_CONTROL_MENU)
493
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
494
+  #if ENABLED(LED_COLOR_PRESETS)
495
+    #define LED_USER_PRESET_RED        255  // User defined RED value
496
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
497
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
498
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
499
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
500
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
501
+  #endif
502
+#endif // LED_CONTROL_MENU
503
+
487
 #if ENABLED(SDSUPPORT)
504
 #if ENABLED(SDSUPPORT)
488
 
505
 
489
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
506
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h 查看文件

482
 // The timeout (in ms) to return to the status screen from sub-menus
482
 // The timeout (in ms) to return to the status screen from sub-menus
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484
 
484
 
485
+/**
486
+ * LED Control Menu
487
+ * Enable this feature to add LED Control to the LCD menu
488
+ */
489
+//#define LED_CONTROL_MENU
490
+#if ENABLED(LED_CONTROL_MENU)
491
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
492
+  #if ENABLED(LED_COLOR_PRESETS)
493
+    #define LED_USER_PRESET_RED        255  // User defined RED value
494
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
495
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
496
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
497
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
498
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
499
+  #endif
500
+#endif // LED_CONTROL_MENU
501
+
485
 #if ENABLED(SDSUPPORT)
502
 #if ENABLED(SDSUPPORT)
486
 
503
 
487
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
504
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/makibox/Configuration_adv.h 查看文件

482
 // The timeout (in ms) to return to the status screen from sub-menus
482
 // The timeout (in ms) to return to the status screen from sub-menus
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484
 
484
 
485
+/**
486
+ * LED Control Menu
487
+ * Enable this feature to add LED Control to the LCD menu
488
+ */
489
+//#define LED_CONTROL_MENU
490
+#if ENABLED(LED_CONTROL_MENU)
491
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
492
+  #if ENABLED(LED_COLOR_PRESETS)
493
+    #define LED_USER_PRESET_RED        255  // User defined RED value
494
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
495
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
496
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
497
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
498
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
499
+  #endif
500
+#endif // LED_CONTROL_MENU
501
+
485
 #if ENABLED(SDSUPPORT)
502
 #if ENABLED(SDSUPPORT)
486
 
503
 
487
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
504
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h 查看文件

482
 // The timeout (in ms) to return to the status screen from sub-menus
482
 // The timeout (in ms) to return to the status screen from sub-menus
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484
 
484
 
485
+/**
486
+ * LED Control Menu
487
+ * Enable this feature to add LED Control to the LCD menu
488
+ */
489
+//#define LED_CONTROL_MENU
490
+#if ENABLED(LED_CONTROL_MENU)
491
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
492
+  #if ENABLED(LED_COLOR_PRESETS)
493
+    #define LED_USER_PRESET_RED        255  // User defined RED value
494
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
495
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
496
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
497
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
498
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
499
+  #endif
500
+#endif // LED_CONTROL_MENU
501
+
485
 #if ENABLED(SDSUPPORT)
502
 #if ENABLED(SDSUPPORT)
486
 
503
 
487
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
504
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 17
- 0
Marlin/src/config/examples/wt150/Configuration_adv.h 查看文件

483
 // The timeout (in ms) to return to the status screen from sub-menus
483
 // The timeout (in ms) to return to the status screen from sub-menus
484
 //#define LCD_TIMEOUT_TO_STATUS 15000
484
 //#define LCD_TIMEOUT_TO_STATUS 15000
485
 
485
 
486
+/**
487
+ * LED Control Menu
488
+ * Enable this feature to add LED Control to the LCD menu
489
+ */
490
+//#define LED_CONTROL_MENU
491
+#if ENABLED(LED_CONTROL_MENU)
492
+  #define LED_COLOR_PRESETS                 // Enable the Preset Color menu option
493
+  #if ENABLED(LED_COLOR_PRESETS)
494
+    #define LED_USER_PRESET_RED        255  // User defined RED value
495
+    #define LED_USER_PRESET_GREEN      128  // User defined GREEN value
496
+    #define LED_USER_PRESET_BLUE         0  // User defined BLUE value
497
+    #define LED_USER_PRESET_WHITE      255  // User defined WHITE value
498
+    #define LED_USER_PRESET_BRIGHTNESS 255  // User defined intensity
499
+    //#define LED_USER_PRESET_STARTUP       // Have the printer display the user preset color on startup
500
+  #endif
501
+#endif // LED_CONTROL_MENU
502
+
486
 #if ENABLED(SDSUPPORT)
503
 #if ENABLED(SDSUPPORT)
487
 
504
 
488
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work
505
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 7
- 7
Marlin/src/feature/leds/blinkm.cpp 查看文件

21
  */
21
  */
22
 
22
 
23
 /**
23
 /**
24
- * blinkm.cpp - Library for controlling a BlinkM over i2c
25
- * Created by Tim Koster, August 21 2013.
24
+ * blinkm.cpp - Control a BlinkM over i2c
26
  */
25
  */
27
 
26
 
28
 #include "../../inc/MarlinConfig.h"
27
 #include "../../inc/MarlinConfig.h"
30
 #if ENABLED(BLINKM)
29
 #if ENABLED(BLINKM)
31
 
30
 
32
 #include "blinkm.h"
31
 #include "blinkm.h"
32
+#include "leds.h"
33
+#include <Wire.h>
33
 
34
 
34
-void blinkm_set_led_color(const byte r, const byte g, const byte b) {
35
+void blinkm_set_led_color(const LEDColor &color) {
35
   Wire.begin();
36
   Wire.begin();
36
   Wire.beginTransmission(0x09);
37
   Wire.beginTransmission(0x09);
37
   Wire.write('o');                    //to disable ongoing script, only needs to be used once
38
   Wire.write('o');                    //to disable ongoing script, only needs to be used once
38
   Wire.write('n');
39
   Wire.write('n');
39
-  Wire.write(r);
40
-  Wire.write(g);
41
-  Wire.write(b);
40
+  Wire.write(color.r);
41
+  Wire.write(color.g);
42
+  Wire.write(color.b);
42
   Wire.endTransmission();
43
   Wire.endTransmission();
43
 }
44
 }
44
 
45
 
45
 #endif // BLINKM
46
 #endif // BLINKM
46
-

+ 7
- 8
Marlin/src/feature/leds/blinkm.h 查看文件

21
  */
21
  */
22
 
22
 
23
 /**
23
 /**
24
- * blinkm.h - Library for controlling a BlinkM over i2c
25
- * Created by Tim Koster, August 21 2013.
24
+ * blinkm.h - Control a BlinkM over i2c
26
  */
25
  */
27
 
26
 
28
-#ifndef __BLINKM_H__
29
-#define __BLINKM_H__
27
+#ifndef _BLINKM_H_
28
+#define _BLINKM_H_
30
 
29
 
31
-#include <Arduino.h>
32
-#include <Wire.h>
30
+struct LEDColor;
31
+typedef LEDColor LEDColor;
33
 
32
 
34
-void blinkm_set_led_color(const uint8_t r, const uint8_t g, const uint8_t b);
33
+void blinkm_set_led_color(const LEDColor &color);
35
 
34
 
36
-#endif // __BLINKM_H__
35
+#endif // _BLINKM_H_

+ 79
- 25
Marlin/src/feature/leds/leds.cpp 查看文件

21
  */
21
  */
22
 
22
 
23
 /**
23
 /**
24
- * Marlin RGB LED general support
24
+ * leds.cpp - Marlin RGB LED general support
25
  */
25
  */
26
 
26
 
27
 #include "../../inc/MarlinConfig.h"
27
 #include "../../inc/MarlinConfig.h"
30
 
30
 
31
 #include "leds.h"
31
 #include "leds.h"
32
 
32
 
33
-void set_led_color(
34
-  const uint8_t r, const uint8_t g, const uint8_t b
35
-    #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED)
36
-      , const uint8_t w // = 0
37
-      #if ENABLED(NEOPIXEL_LED)
38
-        , const uint8_t p // = NEOPIXEL_BRIGHTNESS
39
-        , const bool isSequence // = false
40
-      #endif
41
-    #endif
33
+#if ENABLED(BLINKM)
34
+  #include "blinkm.h"
35
+#endif
36
+
37
+#if ENABLED(PCA9632)
38
+  #include "pca9632.h"
39
+#endif
40
+
41
+#if ENABLED(LED_COLOR_PRESETS)
42
+  const LEDColor LEDLights::defaultLEDColor = MakeLEDColor(
43
+    LED_USER_PRESET_RED,
44
+    LED_USER_PRESET_GREEN,
45
+    LED_USER_PRESET_BLUE,
46
+    LED_USER_PRESET_WHITE,
47
+    LED_USER_PRESET_BRIGHTNESS
48
+  );
49
+#endif
50
+
51
+#if ENABLED(LED_CONTROL_MENU)
52
+  LEDColor LEDLights::color;
53
+  bool LEDLights::lights_on;
54
+#endif
55
+
56
+LEDLights leds;
57
+
58
+void LEDLights::setup() {
59
+  #if ENABLED(NEOPIXEL_LED)
60
+    setup_neopixel();
61
+  #endif
62
+  #if ENABLED(LED_USER_PRESET_STARTUP)
63
+    set_default();
64
+  #endif
65
+}
66
+
67
+void LEDLights::set_color(const LEDColor &incol
68
+  #if ENABLED(NEOPIXEL_LED)
69
+    , bool isSequence/*=false*/
70
+  #endif
42
 ) {
71
 ) {
43
 
72
 
44
   #if ENABLED(NEOPIXEL_LED)
73
   #if ENABLED(NEOPIXEL_LED)
45
 
74
 
46
-    const uint32_t color = pixels.Color(r, g, b, w);
75
+    const uint32_t neocolor = pixels.Color(incol.r, incol.g, incol.b, incol.w);
47
     static uint16_t nextLed = 0;
76
     static uint16_t nextLed = 0;
48
 
77
 
49
-    pixels.setBrightness(p);
78
+    pixels.setBrightness(incol.i);
50
     if (!isSequence)
79
     if (!isSequence)
51
-      set_neopixel_color(color);
80
+      set_neopixel_color(neocolor);
52
     else {
81
     else {
53
-      pixels.setPixelColor(nextLed, color);
82
+      pixels.setPixelColor(nextLed, neocolor);
54
       pixels.show();
83
       pixels.show();
55
       if (++nextLed >= pixels.numPixels()) nextLed = 0;
84
       if (++nextLed >= pixels.numPixels()) nextLed = 0;
56
       return;
85
       return;
59
   #endif
88
   #endif
60
 
89
 
61
   #if ENABLED(BLINKM)
90
   #if ENABLED(BLINKM)
62
-    blinkm_set_led_color(r, g, b); // Use i2c to send the RGB components to the device.
91
+
92
+    // This variant uses i2c to send the RGB components to the device.
93
+    blinkm_set_led_color(incol);
94
+
63
   #endif
95
   #endif
64
 
96
 
65
   #if ENABLED(RGB_LED) || ENABLED(RGBW_LED)
97
   #if ENABLED(RGB_LED) || ENABLED(RGBW_LED)
66
-    // This variant uses 3 separate pins for the RGB components.
98
+
99
+    // This variant uses 3-4 separate pins for the RGB(W) components.
67
     // If the pins can do PWM then their intensity will be set.
100
     // If the pins can do PWM then their intensity will be set.
68
-    WRITE(RGB_LED_R_PIN, r ? HIGH : LOW);
69
-    WRITE(RGB_LED_G_PIN, g ? HIGH : LOW);
70
-    WRITE(RGB_LED_B_PIN, b ? HIGH : LOW);
71
-    analogWrite(RGB_LED_R_PIN, r);
72
-    analogWrite(RGB_LED_G_PIN, g);
73
-    analogWrite(RGB_LED_B_PIN, b);
101
+    WRITE(RGB_LED_R_PIN, incol.r ? HIGH : LOW);
102
+    WRITE(RGB_LED_G_PIN, incol.g ? HIGH : LOW);
103
+    WRITE(RGB_LED_B_PIN, incol.b ? HIGH : LOW);
104
+    analogWrite(RGB_LED_R_PIN, incol.r);
105
+    analogWrite(RGB_LED_G_PIN, incol.g);
106
+    analogWrite(RGB_LED_B_PIN, incol.b);
74
 
107
 
75
     #if ENABLED(RGBW_LED)
108
     #if ENABLED(RGBW_LED)
76
-      WRITE(RGB_LED_W_PIN, w ? HIGH : LOW);
77
-      analogWrite(RGB_LED_W_PIN, w);
109
+      WRITE(RGB_LED_W_PIN, incol.w ? HIGH : LOW);
110
+      analogWrite(RGB_LED_W_PIN, incol.w);
78
     #endif
111
     #endif
112
+
79
   #endif
113
   #endif
80
 
114
 
81
   #if ENABLED(PCA9632)
115
   #if ENABLED(PCA9632)
82
-    pca9632_set_led_color(r, g, b); // Update I2C LED driver
116
+    // Update I2C LED driver
117
+    pca9632_set_led_color(incol);
118
+  #endif
119
+
120
+  #if ENABLED(LED_CONTROL_MENU)
121
+    // Don't update the color when OFF
122
+    lights_on = !incol.is_off();
123
+    if (lights_on) color = incol;
83
   #endif
124
   #endif
84
 }
125
 }
85
 
126
 
127
+void LEDLights::set_white() {
128
+  #if ENABLED(RGB_LED) || ENABLED(RGBW_LED) || ENABLED(BLINKM) || ENABLED(PCA9632)
129
+    set_color(LEDColorWhite());
130
+  #endif
131
+  #if ENABLED(NEOPIXEL_LED)
132
+    set_neopixel_color(pixels.Color(NEO_WHITE));
133
+  #endif
134
+}
135
+
136
+#if ENABLED(LED_CONTROL_MENU)
137
+  void LEDLights::toggle() { if (lights_on) set_off(); else update(); }
138
+#endif
139
+
86
 #endif // HAS_COLOR_LEDS
140
 #endif // HAS_COLOR_LEDS

+ 125
- 24
Marlin/src/feature/leds/leds.h 查看文件

21
  */
21
  */
22
 
22
 
23
 /**
23
 /**
24
- * Marlin general RGB LED support
24
+ * leds.h - Marlin general RGB LED support
25
  */
25
  */
26
 
26
 
27
 #ifndef __LEDS_H__
27
 #ifndef __LEDS_H__
30
 #include "../../inc/MarlinConfig.h"
30
 #include "../../inc/MarlinConfig.h"
31
 
31
 
32
 #if ENABLED(NEOPIXEL_LED)
32
 #if ENABLED(NEOPIXEL_LED)
33
-  #include <Adafruit_NeoPixel.h>
34
   #include "neopixel.h"
33
   #include "neopixel.h"
35
 #endif
34
 #endif
36
 
35
 
37
-#if ENABLED(BLINKM)
38
-  #include "blinkm.h"
39
-#endif
40
-
41
-#if ENABLED(PCA9632)
42
-  #include "pca9632.h"
43
-#endif
36
+#define HAS_WHITE_LED (ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED))
44
 
37
 
45
-#if ENABLED(RGB_LED) || ENABLED(BLINKM) || ENABLED(PCA9632)
46
-  #define LED_WHITE 255, 255, 255
47
-#elif ENABLED(RGBW_LED)
48
-  #define LED_WHITE 0, 0, 0, 255
49
-#endif
38
+/**
39
+ * LEDcolor type for use with leds.set_color
40
+ */
41
+typedef struct LEDColor {
42
+  uint8_t r, g, b
43
+    #if HAS_WHITE_LED
44
+      , w
45
+      #if ENABLED(NEOPIXEL_LED)
46
+        , i
47
+      #endif
48
+    #endif
49
+  ;
50
+  LEDColor() : r(255), g(255), b(255)
51
+    #if HAS_WHITE_LED
52
+      , w(255)
53
+      #if ENABLED(NEOPIXEL_LED)
54
+        , i(NEOPIXEL_BRIGHTNESS)
55
+      #endif
56
+    #endif
57
+  {}
58
+  LEDColor(uint8_t r, uint8_t g, uint8_t b
59
+    #if HAS_WHITE_LED
60
+      , uint8_t w=0
61
+      #if ENABLED(NEOPIXEL_LED)
62
+        , uint8_t i=NEOPIXEL_BRIGHTNESS
63
+      #endif
64
+    #endif
65
+    ) : r(r), g(g), b(b)
66
+    #if HAS_WHITE_LED
67
+      , w(w)
68
+      #if ENABLED(NEOPIXEL_LED)
69
+        , i(i)
70
+      #endif
71
+    #endif
72
+  {}
73
+  LEDColor& operator=(const LEDColor &right) {
74
+    if (this != &right) memcpy(this, &right, sizeof(LEDColor));
75
+    return *this;
76
+  }
77
+  bool operator==(const LEDColor &right) {
78
+    if (this == &right) return true;
79
+    return 0 == memcmp(this, &right, sizeof(LEDColor));
80
+  }
81
+  bool operator!=(const LEDColor &right) { return !operator==(right); }
82
+  bool is_off() const {
83
+    return 3 > r + g + b
84
+      #if HAS_WHITE_LED
85
+        + w
86
+      #endif
87
+    ;
88
+  }
89
+} LEDColor;
50
 
90
 
51
-#if ENABLED(NEOPIXEL_LED)
52
-  #define LED_BRIGHTNESS pixels.getBrightness()
91
+/**
92
+ * Color helpers and presets
93
+ */
94
+#if HAS_WHITE_LED
95
+  #define LEDColorWhite() LEDColor(0, 0, 0, 255)
96
+  #if ENABLED(NEOPIXEL_LED)
97
+    #define MakeLEDColor(R,G,B,W,I) LEDColor(R, G, B, W, I)
98
+  #else
99
+    #define MakeLEDColor(R,G,B,W,I) LEDColor(R, G, B, W)
100
+  #endif
53
 #else
101
 #else
54
-  #define LED_BRIGHTNESS 255
102
+  #define MakeLEDColor(R,G,B,W,I) LEDColor(R, G, B)
103
+  #define LEDColorWhite() LEDColor(255, 255, 255)
55
 #endif
104
 #endif
105
+#define LEDColorOff()     LEDColor(  0,   0,   0)
106
+#define LEDColorRed()     LEDColor(255,   0,   0)
107
+#define LEDColorOrange()  LEDColor(255,  80,   0)
108
+#define LEDColorYellow()  LEDColor(255, 255,   0)
109
+#define LEDColorGreen()   LEDColor(  0, 255,   0)
110
+#define LEDColorBlue()    LEDColor(  0,   0, 255)
111
+#define LEDColorIndigo()  LEDColor(  0, 255, 255)
112
+#define LEDColorViolet()  LEDColor(255,   0, 255)
113
+
114
+class LEDLights {
115
+public:
116
+  LEDLights() {} // ctor
117
+
118
+  static void setup(); // init()
119
+
120
+  static void set_color(const LEDColor &color
121
+    #if ENABLED(NEOPIXEL_LED)
122
+      , bool isSequence=false
123
+    #endif
124
+  );
56
 
125
 
57
-void set_led_color(
58
-  const uint8_t r, const uint8_t g, const uint8_t b
59
-    #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED)
60
-      , const uint8_t w = 0
126
+  FORCE_INLINE void set_color(uint8_t r, uint8_t g, uint8_t b
127
+    #if HAS_WHITE_LED
128
+      , uint8_t w=0
61
       #if ENABLED(NEOPIXEL_LED)
129
       #if ENABLED(NEOPIXEL_LED)
62
-        , const uint8_t p = NEOPIXEL_BRIGHTNESS
63
-        , const bool isSequence = false
130
+        , uint8_t i=NEOPIXEL_BRIGHTNESS
64
       #endif
131
       #endif
65
     #endif
132
     #endif
66
-);
133
+    #if ENABLED(NEOPIXEL_LED)
134
+      , bool isSequence=false
135
+    #endif
136
+  ) {
137
+    set_color(MakeLEDColor(r, g, b, w, i)
138
+      #if ENABLED(NEOPIXEL_LED)
139
+        , isSequence
140
+      #endif
141
+    );
142
+  }
143
+
144
+  static void set_white();
145
+  FORCE_INLINE static void set_off()   { set_color(LEDColorOff()); }
146
+  FORCE_INLINE static void set_green() { set_color(LEDColorGreen()); }
147
+
148
+  #if ENABLED(LED_COLOR_PRESETS)
149
+    static const LEDColor defaultLEDColor;
150
+    FORCE_INLINE static void set_default()  { set_color(defaultLEDColor); }
151
+    FORCE_INLINE static void set_red()      { set_color(LEDColorRed()); }
152
+    FORCE_INLINE static void set_orange()   { set_color(LEDColorOrange()); }
153
+    FORCE_INLINE static void set_yellow()   { set_color(LEDColorYellow()); }
154
+    FORCE_INLINE static void set_blue()     { set_color(LEDColorBlue()); }
155
+    FORCE_INLINE static void set_indigo()   { set_color(LEDColorIndigo()); }
156
+    FORCE_INLINE static void set_violet()   { set_color(LEDColorViolet()); }
157
+  #endif
158
+
159
+  #if ENABLED(LED_CONTROL_MENU)
160
+    static LEDColor color; // last non-off color
161
+    static bool lights_on; // the last set color was "on"
162
+    static void toggle();  // swap "off" with color
163
+    FORCE_INLINE static void update() { set_color(color); }
164
+  #endif
165
+};
166
+
167
+extern LEDLights leds;
67
 
168
 
68
 #endif // __LEDS_H__
169
 #endif // __LEDS_H__

+ 23
- 1
Marlin/src/feature/leds/neopixel.cpp 查看文件

53
     set_neopixel_color(pixels.Color(0, 0, 255, 0));  // blue
53
     set_neopixel_color(pixels.Color(0, 0, 255, 0));  // blue
54
     safe_delay(1000);
54
     safe_delay(1000);
55
   #endif
55
   #endif
56
-  set_neopixel_color(pixels.Color(NEO_WHITE));       // white
56
+
57
+  #if ENABLED(LED_USER_PRESET_STARTUP)
58
+    set_neopixel_color(pixels.Color(LED_USER_PRESET_RED, LED_USER_PRESET_GREEN, LED_USER_PRESET_BLUE, LED_USER_PRESET_WHITE));
59
+  #else
60
+    set_neopixel_color(pixels.Color(0, 0, 0, 0));
61
+  #endif
62
+}
63
+
64
+#if 0
65
+bool neopixel_set_led_color(const uint8_t r, const uint8_t g, const uint8_t b, const uint8_t w, const uint8_t p) {
66
+  const uint32_t color = pixels.Color(r, g, b, w);
67
+  pixels.setBrightness(p);
68
+  #if !ENABLED(NEOPIXEL_IS_SEQUENTIAL)
69
+    set_neopixel_color(color);
70
+    return false;
71
+  #else
72
+    static uint16_t nextLed = 0;
73
+    pixels.setPixelColor(nextLed, color);
74
+    pixels.show();
75
+    if (++nextLed >= pixels.numPixels()) nextLed = 0;
76
+    return true;
77
+  #endif
57
 }
78
 }
79
+#endif
58
 
80
 
59
 #endif // NEOPIXEL_LED
81
 #endif // NEOPIXEL_LED

+ 2
- 1
Marlin/src/feature/leds/neopixel.h 查看文件

36
 #define NEOPIXEL_IS_RGBW !NEOPIXEL_IS_RGB
36
 #define NEOPIXEL_IS_RGBW !NEOPIXEL_IS_RGB
37
 
37
 
38
 #if NEOPIXEL_IS_RGB
38
 #if NEOPIXEL_IS_RGB
39
-  #define NEO_WHITE 255, 255, 255
39
+  #define NEO_WHITE 255, 255, 255, 0
40
 #else
40
 #else
41
   #define NEO_WHITE 0, 0, 0, 255
41
   #define NEO_WHITE 0, 0, 0, 255
42
 #endif
42
 #endif
43
 
43
 
44
 void setup_neopixel();
44
 void setup_neopixel();
45
 void set_neopixel_color(const uint32_t color);
45
 void set_neopixel_color(const uint32_t color);
46
+//bool neopixel_set_led_color(const uint8_t r, const uint8_t g, const uint8_t b, const uint8_t w, const uint8_t p);
46
 
47
 
47
 extern Adafruit_NeoPixel pixels;
48
 extern Adafruit_NeoPixel pixels;
48
 
49
 

+ 7
- 5
Marlin/src/feature/leds/pca9632.cpp 查看文件

30
 #if ENABLED(PCA9632)
30
 #if ENABLED(PCA9632)
31
 
31
 
32
 #include "pca9632.h"
32
 #include "pca9632.h"
33
+#include "leds.h"
34
+#include <Wire.h>
33
 
35
 
34
 #define PCA9632_MODE1_VALUE   0b00000001 //(ALLCALL)
36
 #define PCA9632_MODE1_VALUE   0b00000001 //(ALLCALL)
35
 #define PCA9632_MODE2_VALUE   0b00010101 //(DIMMING, INVERT, CHANGE ON STOP,TOTEM)
37
 #define PCA9632_MODE2_VALUE   0b00010101 //(DIMMING, INVERT, CHANGE ON STOP,TOTEM)
97
   }
99
   }
98
 #endif
100
 #endif
99
 
101
 
100
-void pca9632_set_led_color(const byte r, const byte g, const byte b) {
102
+void pca9632_set_led_color(const LEDColor &color) {
101
   if (!PCA_init) {
103
   if (!PCA_init) {
102
     PCA_init = 1;
104
     PCA_init = 1;
103
     Wire.begin();
105
     Wire.begin();
105
     PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_MODE2, PCA9632_MODE2_VALUE);
107
     PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_MODE2, PCA9632_MODE2_VALUE);
106
   }
108
   }
107
 
109
 
108
-  const byte LEDOUT = (r ? LED_PWM << PCA9632_RED : 0)
109
-                    | (g ? LED_PWM << PCA9632_GRN : 0)
110
-                    | (b ? LED_PWM << PCA9632_BLU : 0);
110
+  const byte LEDOUT = (color.r ? LED_PWM << PCA9632_RED : 0)
111
+                    | (color.g ? LED_PWM << PCA9632_GRN : 0)
112
+                    | (color.b ? LED_PWM << PCA9632_BLU : 0);
111
 
113
 
112
-  PCA9632_WriteAllRegisters(PCA9632_ADDRESS,PCA9632_PWM0, r, g, b);
114
+  PCA9632_WriteAllRegisters(PCA9632_ADDRESS,PCA9632_PWM0, color.r, color.g, color.b);
113
   PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_LEDOUT, LEDOUT);
115
   PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_LEDOUT, LEDOUT);
114
 }
116
 }
115
 
117
 

+ 4
- 4
Marlin/src/feature/leds/pca9632.h 查看文件

20
  *
20
  *
21
  */
21
  */
22
 
22
 
23
-/*
23
+/**
24
  * Driver for the Philips PCA9632 LED driver.
24
  * Driver for the Philips PCA9632 LED driver.
25
  * Written by Robert Mendon Feb 2017.
25
  * Written by Robert Mendon Feb 2017.
26
  */
26
  */
28
 #ifndef __PCA9632_H__
28
 #ifndef __PCA9632_H__
29
 #define __PCA9632_H__
29
 #define __PCA9632_H__
30
 
30
 
31
-#include <Arduino.h>
32
-#include <Wire.h>
31
+struct LEDColor;
32
+typedef LEDColor LEDColor;
33
 
33
 
34
-void pca9632_set_led_color(const byte r, const byte g, const byte b);
34
+void pca9632_set_led_color(const LEDColor &color);
35
 
35
 
36
 #endif // __PCA9632_H__
36
 #endif // __PCA9632_H__

+ 5
- 9
Marlin/src/gcode/feature/leds/M150.cpp 查看文件

45
  *   M150 P          ; Set LED full brightness
45
  *   M150 P          ; Set LED full brightness
46
  */
46
  */
47
 void GcodeSuite::M150() {
47
 void GcodeSuite::M150() {
48
-  set_led_color(
48
+  leds.set_color(MakeLEDColor(
49
     parser.seen('R') ? (parser.has_value() ? parser.value_byte() : 255) : 0,
49
     parser.seen('R') ? (parser.has_value() ? parser.value_byte() : 255) : 0,
50
     parser.seen('U') ? (parser.has_value() ? parser.value_byte() : 255) : 0,
50
     parser.seen('U') ? (parser.has_value() ? parser.value_byte() : 255) : 0,
51
-    parser.seen('B') ? (parser.has_value() ? parser.value_byte() : 255) : 0
52
-    #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED)
53
-      , parser.seen('W') ? (parser.has_value() ? parser.value_byte() : 255) : 0
54
-      #if ENABLED(NEOPIXEL_LED)
55
-        , parser.seen('P') ? (parser.has_value() ? parser.value_byte() : 255) : pixels.getBrightness()
56
-      #endif
57
-    #endif
58
-  );
51
+    parser.seen('B') ? (parser.has_value() ? parser.value_byte() : 255) : 0,
52
+    parser.seen('W') ? (parser.has_value() ? parser.value_byte() : 255) : 0,
53
+    parser.seen('P') ? (parser.has_value() ? parser.value_byte() : 255) : pixels.getBrightness()
54
+  ));
59
 }
55
 }
60
 
56
 
61
 #endif // HAS_COLOR_LEDS
57
 #endif // HAS_COLOR_LEDS

+ 2
- 2
Marlin/src/gcode/queue.cpp 查看文件

370
             SERIAL_PROTOCOLLNPGM(MSG_FILE_PRINTED);
370
             SERIAL_PROTOCOLLNPGM(MSG_FILE_PRINTED);
371
             #if ENABLED(PRINTER_EVENT_LEDS)
371
             #if ENABLED(PRINTER_EVENT_LEDS)
372
               LCD_MESSAGEPGM(MSG_INFO_COMPLETED_PRINTS);
372
               LCD_MESSAGEPGM(MSG_INFO_COMPLETED_PRINTS);
373
-              set_led_color(0, 255, 0); // Green
373
+              leds.set_green();
374
               #if HAS_RESUME_CONTINUE
374
               #if HAS_RESUME_CONTINUE
375
                 enqueue_and_echo_commands_P(PSTR("M0")); // end of the queue!
375
                 enqueue_and_echo_commands_P(PSTR("M0")); // end of the queue!
376
               #else
376
               #else
377
                 safe_delay(1000);
377
                 safe_delay(1000);
378
               #endif
378
               #endif
379
-              set_led_color(0, 0, 0);   // OFF
379
+              leds.set_off();
380
             #endif
380
             #endif
381
             card.checkautostart(true);
381
             card.checkautostart(true);
382
           }
382
           }

+ 5
- 12
Marlin/src/gcode/temperature/M104_M109.cpp 查看文件

190
         const uint8_t blue = map(constrain(temp, start_temp, target_temp), start_temp, target_temp, 255, 0);
190
         const uint8_t blue = map(constrain(temp, start_temp, target_temp), start_temp, target_temp, 255, 0);
191
         if (blue != old_blue) {
191
         if (blue != old_blue) {
192
           old_blue = blue;
192
           old_blue = blue;
193
-          set_led_color(255, 0, blue
194
-            #if ENABLED(NEOPIXEL_LED)
195
-              , 0, pixels.getBrightness()
196
-              #if ENABLED(NEOPIXEL_IS_SEQUENTIAL)
197
-                , true
198
-              #endif
193
+          leds.set_color(
194
+            MakeLEDColor(255, 0, blue, 0, pixels.getBrightness())
195
+            #if ENABLED(NEOPIXEL_IS_SEQUENTIAL)
196
+              , true
199
             #endif
197
             #endif
200
           );
198
           );
201
         }
199
         }
233
   if (wait_for_heatup) {
231
   if (wait_for_heatup) {
234
     LCD_MESSAGEPGM(MSG_HEATING_COMPLETE);
232
     LCD_MESSAGEPGM(MSG_HEATING_COMPLETE);
235
     #if ENABLED(PRINTER_EVENT_LEDS)
233
     #if ENABLED(PRINTER_EVENT_LEDS)
236
-      #if ENABLED(RGB_LED) || ENABLED(BLINKM) || ENABLED(PCA9632) || ENABLED(RGBW_LED)
237
-        set_led_color(LED_WHITE);
238
-      #endif
239
-      #if ENABLED(NEOPIXEL_LED)
240
-        set_neopixel_color(pixels.Color(NEO_WHITE));
241
-      #endif
234
+      leds.set_white();
242
     #endif
235
     #endif
243
   }
236
   }
244
 
237
 

+ 4
- 6
Marlin/src/gcode/temperature/M140_M190.cpp 查看文件

132
         const uint8_t red = map(constrain(temp, start_temp, target_temp), start_temp, target_temp, 0, 255);
132
         const uint8_t red = map(constrain(temp, start_temp, target_temp), start_temp, target_temp, 0, 255);
133
         if (red != old_red) {
133
         if (red != old_red) {
134
           old_red = red;
134
           old_red = red;
135
-          set_led_color(red, 0, 255
136
-            #if ENABLED(NEOPIXEL_LED)
137
-              , 0, pixels.getBrightness()
138
-              #if ENABLED(NEOPIXEL_IS_SEQUENTIAL)
139
-                , true
140
-              #endif
135
+          leds.set_color(
136
+            MakeLEDColor(red, 0, 255, 0, pixels.getBrightness())
137
+            #if ENABLED(NEOPIXEL_IS_SEQUENTIAL)
138
+              , true
141
             #endif
139
             #endif
142
           );
140
           );
143
         }
141
         }

+ 23
- 0
Marlin/src/inc/Conditionals_post.h 查看文件

1178
   #define MAX_VFAT_ENTRIES (2)
1178
   #define MAX_VFAT_ENTRIES (2)
1179
 #endif
1179
 #endif
1180
 
1180
 
1181
+// Set defaults for unspecified LED user colors
1182
+#if ENABLED(LED_CONTROL_MENU)
1183
+  #ifndef LED_USER_PRESET_RED
1184
+    #define LED_USER_PRESET_RED       255
1185
+  #endif
1186
+  #ifndef LED_USER_PRESET_GREEN
1187
+    #define LED_USER_PRESET_GREEN     255
1188
+  #endif
1189
+  #ifndef LED_USER_PRESET_BLUE
1190
+    #define LED_USER_PRESET_BLUE      255
1191
+  #endif
1192
+  #ifndef LED_USER_PRESET_WHITE
1193
+    #define LED_USER_PRESET_WHITE     0
1194
+  #endif
1195
+  #ifndef LED_USER_PRESET_BRIGHTNESS
1196
+    #ifdef NEOPIXEL_BRIGHTNESS
1197
+      #define LED_USER_PRESET_BRIGHTNESS NEOPIXEL_BRIGHTNESS
1198
+    #else
1199
+      #define LED_USER_PRESET_BRIGHTNESS 255
1200
+    #endif
1201
+  #endif
1202
+#endif
1203
+
1181
 // Force SDCARD_SORT_ALPHA to be enabled for Graphical LCD on LPC1768
1204
 // Force SDCARD_SORT_ALPHA to be enabled for Graphical LCD on LPC1768
1182
 // because of a bug in the shared SPI implementation. (See #8122)
1205
 // because of a bug in the shared SPI implementation. (See #8122)
1183
 #if defined(TARGET_LPC1768) && ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
1206
 #if defined(TARGET_LPC1768) && ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)

+ 1
- 0
Marlin/src/inc/MarlinConfig.h 查看文件

32
 #endif
32
 #endif
33
 #include "Conditionals_post.h"
33
 #include "Conditionals_post.h"
34
 #include "SanityCheck.h"
34
 #include "SanityCheck.h"
35
+#include "../HAL/HAL_SanityCheck.h"
35
 
36
 
36
 // Include all core headers
37
 // Include all core headers
37
 #include "../core/enum.h"
38
 #include "../core/enum.h"

+ 3
- 1
Marlin/src/inc/SanityCheck.h 查看文件

1479
   #error "BLOCK_BUFFER_SIZE must be a power of 2."
1479
   #error "BLOCK_BUFFER_SIZE must be a power of 2."
1480
 #endif
1480
 #endif
1481
 
1481
 
1482
-#include "../HAL/HAL_SanityCheck.h"  // get CPU specific checks
1482
+#if ENABLED(LED_CONTROL_MENU) && DISABLED(ULTIPANEL)
1483
+  #error "LED_CONTROL_MENU requires an LCD controller."
1484
+#endif
1483
 
1485
 
1484
 #endif // _SANITYCHECK_H_
1486
 #endif // _SANITYCHECK_H_

+ 58
- 2
Marlin/src/lcd/language/language_en.h 查看文件

174
 #ifndef MSG_USER_MENU
174
 #ifndef MSG_USER_MENU
175
   #define MSG_USER_MENU                       _UxGT("Custom Commands")
175
   #define MSG_USER_MENU                       _UxGT("Custom Commands")
176
 #endif
176
 #endif
177
-
178
 #ifndef MSG_UBL_DOING_G29
177
 #ifndef MSG_UBL_DOING_G29
179
   #define MSG_UBL_DOING_G29                   _UxGT("Doing G29")
178
   #define MSG_UBL_DOING_G29                   _UxGT("Doing G29")
180
 #endif
179
 #endif
362
   #define MSG_UBL_STEP_BY_STEP_MENU           _UxGT("Step-By-Step UBL")
361
   #define MSG_UBL_STEP_BY_STEP_MENU           _UxGT("Step-By-Step UBL")
363
 #endif
362
 #endif
364
 
363
 
364
+#ifndef MSG_LED_CONTROL
365
+  #define MSG_LED_CONTROL                     _UxGT("LED Control")
366
+#endif
367
+#ifndef MSG_LEDS_ON
368
+  #define MSG_LEDS_ON                         _UxGT("Lights On")
369
+#endif
370
+#ifndef MSG_LEDS_OFF
371
+  #define MSG_LEDS_OFF                        _UxGT("Lights Off")
372
+#endif
373
+#ifndef MSG_LED_PRESETS
374
+  #define MSG_LED_PRESETS                     _UxGT("Light Presets")
375
+#endif
376
+#ifndef MSG_SET_LEDS_RED
377
+  #define MSG_SET_LEDS_RED                    _UxGT("Red")
378
+#endif
379
+#ifndef MSG_SET_LEDS_ORANGE
380
+  #define MSG_SET_LEDS_ORANGE                 _UxGT("Orange")
381
+#endif
382
+#ifndef MSG_SET_LEDS_YELLOW
383
+  #define MSG_SET_LEDS_YELLOW                 _UxGT("Yellow")
384
+#endif
385
+#ifndef MSG_SET_LEDS_GREEN
386
+  #define MSG_SET_LEDS_GREEN                  _UxGT("Green")
387
+#endif
388
+#ifndef MSG_SET_LEDS_BLUE
389
+  #define MSG_SET_LEDS_BLUE                   _UxGT("Blue")
390
+#endif
391
+#ifndef MSG_SET_LEDS_INDIGO
392
+  #define MSG_SET_LEDS_INDIGO                 _UxGT("Indigo")
393
+#endif
394
+#ifndef MSG_SET_LEDS_VIOLET
395
+  #define MSG_SET_LEDS_VIOLET                 _UxGT("Violet")
396
+#endif
397
+#ifndef MSG_SET_LEDS_WHITE
398
+  #define MSG_SET_LEDS_WHITE                  _UxGT("White")
399
+#endif
400
+#ifndef MSG_SET_LEDS_DEFAULT
401
+  #define MSG_SET_LEDS_DEFAULT                _UxGT("Default")
402
+#endif
403
+#ifndef MSG_CUSTOM_LEDS
404
+  #define MSG_CUSTOM_LEDS                     _UxGT("Custom Lights")
405
+#endif
406
+#ifndef MSG_INTENSITY_R
407
+  #define MSG_INTENSITY_R                     _UxGT("Red Intensity")
408
+#endif
409
+#ifndef MSG_INTENSITY_G
410
+  #define MSG_INTENSITY_G                     _UxGT("Green Intensity")
411
+#endif
412
+#ifndef MSG_INTENSITY_B
413
+  #define MSG_INTENSITY_B                     _UxGT("Blue Intensity")
414
+#endif
415
+#ifndef MSG_INTENSITY_W
416
+  #define MSG_INTENSITY_W                     _UxGT("White Intensity")
417
+#endif
418
+#ifndef MSG_LED_BRIGHTNESS
419
+  #define MSG_LED_BRIGHTNESS                  _UxGT("Brightness")
420
+#endif
421
+
365
 #ifndef MSG_MOVING
422
 #ifndef MSG_MOVING
366
   #define MSG_MOVING                          _UxGT("Moving...")
423
   #define MSG_MOVING                          _UxGT("Moving...")
367
 #endif
424
 #endif
839
     #define MSG_INFO_PRINT_FILAMENT           _UxGT("Extruded")
896
     #define MSG_INFO_PRINT_FILAMENT           _UxGT("Extruded")
840
   #endif
897
   #endif
841
 #endif
898
 #endif
842
-
843
 #ifndef MSG_INFO_MIN_TEMP
899
 #ifndef MSG_INFO_MIN_TEMP
844
   #define MSG_INFO_MIN_TEMP                   _UxGT("Min Temp")
900
   #define MSG_INFO_MIN_TEMP                   _UxGT("Min Temp")
845
 #endif
901
 #endif

+ 72
- 0
Marlin/src/lcd/ultralcd.cpp 查看文件

55
   #include "../feature/bedlevel/bedlevel.h"
55
   #include "../feature/bedlevel/bedlevel.h"
56
 #endif
56
 #endif
57
 
57
 
58
+#if ENABLED(LED_CONTROL_MENU)
59
+  #include "../feature/leds/leds.h"
60
+#endif
61
+
58
 // For i2c define BUZZ to use lcd_buzz
62
 // For i2c define BUZZ to use lcd_buzz
59
 #if DISABLED(LCD_USE_I2C_BUZZER)
63
 #if DISABLED(LCD_USE_I2C_BUZZER)
60
   #include "../libs/buzzer.h"
64
   #include "../libs/buzzer.h"
185
     void lcd_info_menu();
189
     void lcd_info_menu();
186
   #endif // LCD_INFO_MENU
190
   #endif // LCD_INFO_MENU
187
 
191
 
192
+  #if ENABLED(LED_CONTROL_MENU)
193
+    void lcd_led_menu();
194
+  #endif
195
+
188
   #if ENABLED(ADVANCED_PAUSE_FEATURE)
196
   #if ENABLED(ADVANCED_PAUSE_FEATURE)
189
     void lcd_advanced_pause_toocold_menu();
197
     void lcd_advanced_pause_toocold_menu();
190
     void lcd_advanced_pause_option_menu();
198
     void lcd_advanced_pause_option_menu();
1014
       MENU_ITEM(submenu, MSG_INFO_MENU, lcd_info_menu);
1022
       MENU_ITEM(submenu, MSG_INFO_MENU, lcd_info_menu);
1015
     #endif
1023
     #endif
1016
 
1024
 
1025
+    #if ENABLED(LED_CONTROL_MENU)
1026
+      MENU_ITEM(submenu, MSG_LED_CONTROL, lcd_led_menu);
1027
+    #endif
1028
+
1017
     END_MENU();
1029
     END_MENU();
1018
   }
1030
   }
1019
 
1031
 
3933
 
3945
 
3934
   /**
3946
   /**
3935
    *
3947
    *
3948
+   * LED Menu
3949
+   *
3950
+   */
3951
+
3952
+  #if ENABLED(LED_CONTROL_MENU)
3953
+
3954
+    #if ENABLED(LED_COLOR_PRESETS)
3955
+
3956
+      void lcd_led_presets_menu() {
3957
+        START_MENU();
3958
+        #if LCD_HEIGHT > 2
3959
+          STATIC_ITEM(MSG_LED_PRESETS, true, true);
3960
+        #endif
3961
+        MENU_BACK(MSG_LED_CONTROL);
3962
+        MENU_ITEM(function, MSG_SET_LEDS_WHITE, leds.set_white);
3963
+        MENU_ITEM(function, MSG_SET_LEDS_RED, leds.set_red);
3964
+        MENU_ITEM(function, MSG_SET_LEDS_ORANGE, leds.set_orange);
3965
+        MENU_ITEM(function, MSG_SET_LEDS_YELLOW,leds.set_yellow);
3966
+        MENU_ITEM(function, MSG_SET_LEDS_GREEN, leds.set_green);
3967
+        MENU_ITEM(function, MSG_SET_LEDS_BLUE, leds.set_blue);
3968
+        MENU_ITEM(function, MSG_SET_LEDS_INDIGO, leds.set_indigo);
3969
+        MENU_ITEM(function, MSG_SET_LEDS_VIOLET, leds.set_violet);
3970
+        END_MENU();
3971
+      }
3972
+    #endif // LED_COLOR_PRESETS
3973
+
3974
+    void lcd_led_custom_menu() {
3975
+      START_MENU();
3976
+      MENU_BACK(MSG_LED_CONTROL);
3977
+      MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_R, &leds.color.r, 0, 255, leds.update, true);
3978
+      MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_G, &leds.color.g, 0, 255, leds.update, true);
3979
+      MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_B, &leds.color.b, 0, 255, leds.update, true);
3980
+      #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED)
3981
+        MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_W, &leds.color.w, 0, 255, leds.update, true);
3982
+        #if ENABLED(NEOPIXEL_LED)
3983
+          MENU_ITEM_EDIT_CALLBACK(int8, MSG_LED_BRIGHTNESS, &leds.color.i, 0, 255, leds.update, true);
3984
+        #endif
3985
+      #endif
3986
+      END_MENU();
3987
+    }
3988
+
3989
+    void lcd_led_menu() {
3990
+      START_MENU();
3991
+      MENU_BACK(MSG_MAIN);
3992
+      if (leds.lights_on)
3993
+        MENU_ITEM(function, MSG_LEDS_OFF, leds.toggle);
3994
+      else
3995
+        MENU_ITEM(function, MSG_LEDS_ON, leds.toggle);
3996
+      MENU_ITEM(function, MSG_SET_LEDS_DEFAULT, leds.set_default);
3997
+      #if ENABLED(LED_COLOR_PRESETS)
3998
+        MENU_ITEM(submenu, MSG_LED_PRESETS, lcd_led_presets_menu);
3999
+      #endif
4000
+      MENU_ITEM(submenu, MSG_CUSTOM_LEDS, lcd_led_custom_menu);
4001
+      END_MENU();
4002
+    }
4003
+
4004
+  #endif // LED_CONTROL_MENU
4005
+
4006
+  /**
4007
+   *
3936
    * Filament Change Feature Screens
4008
    * Filament Change Feature Screens
3937
    *
4009
    *
3938
    */
4010
    */

+ 6
- 6
Marlin/src/module/planner.cpp 查看文件

1316
     // then the machine is not coasting anymore and the safe entry / exit velocities shall be used.
1316
     // then the machine is not coasting anymore and the safe entry / exit velocities shall be used.
1317
 
1317
 
1318
     // The junction velocity will be shared between successive segments. Limit the junction velocity to their minimum.
1318
     // The junction velocity will be shared between successive segments. Limit the junction velocity to their minimum.
1319
-    bool prev_speed_larger = previous_nominal_speed > block->nominal_speed;
1320
-    float smaller_speed_factor = prev_speed_larger ? (block->nominal_speed / previous_nominal_speed) : (previous_nominal_speed / block->nominal_speed);
1319
+    const bool prev_speed_larger = previous_nominal_speed > block->nominal_speed;
1320
+    const float smaller_speed_factor = prev_speed_larger ? (block->nominal_speed / previous_nominal_speed) : (previous_nominal_speed / block->nominal_speed);
1321
     // Pick the smaller of the nominal speeds. Higher speed shall not be achieved at the junction during coasting.
1321
     // Pick the smaller of the nominal speeds. Higher speed shall not be achieved at the junction during coasting.
1322
     vmax_junction = prev_speed_larger ? block->nominal_speed : previous_nominal_speed;
1322
     vmax_junction = prev_speed_larger ? block->nominal_speed : previous_nominal_speed;
1323
     // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities.
1323
     // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities.
1449
   #else
1449
   #else
1450
     #define _EINDEX E_AXIS
1450
     #define _EINDEX E_AXIS
1451
   #endif
1451
   #endif
1452
-  long na = position[X_AXIS] = LROUND(a * axis_steps_per_mm[X_AXIS]),
1453
-       nb = position[Y_AXIS] = LROUND(b * axis_steps_per_mm[Y_AXIS]),
1454
-       nc = position[Z_AXIS] = LROUND(c * axis_steps_per_mm[Z_AXIS]),
1455
-       ne = position[E_AXIS] = LROUND(e * axis_steps_per_mm[_EINDEX]);
1452
+  const long na = position[X_AXIS] = LROUND(a * axis_steps_per_mm[X_AXIS]),
1453
+             nb = position[Y_AXIS] = LROUND(b * axis_steps_per_mm[Y_AXIS]),
1454
+             nc = position[Z_AXIS] = LROUND(c * axis_steps_per_mm[Z_AXIS]),
1455
+             ne = position[E_AXIS] = LROUND(e * axis_steps_per_mm[_EINDEX]);
1456
   #if ENABLED(LIN_ADVANCE)
1456
   #if ENABLED(LIN_ADVANCE)
1457
     position_float[X_AXIS] = a;
1457
     position_float[X_AXIS] = a;
1458
     position_float[Y_AXIS] = b;
1458
     position_float[Y_AXIS] = b;

Loading…
取消
儲存