Sfoglia il codice sorgente

Merge pull request #8488 from Tannoo/1.1.x-led_control_menu

[1.1.x] led control menu
Scott Lahteine 7 anni fa
parent
commit
ace3e50898
Nessun account collegato all'indirizzo email del committer
45 ha cambiato i file con 1130 aggiunte e 178 eliminazioni
  1. 1
    1
      .travis.yml
  2. 23
    0
      Marlin/Conditionals_post.h
  3. 17
    0
      Marlin/Configuration_adv.h
  4. 18
    148
      Marlin/Marlin_main.cpp
  5. 4
    0
      Marlin/SanityCheck.h
  6. 8
    8
      Marlin/blinkm.cpp
  7. 9
    5
      Marlin/blinkm.h
  8. 17
    0
      Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h
  9. 17
    0
      Marlin/example_configurations/Anet/A6/Configuration_adv.h
  10. 17
    0
      Marlin/example_configurations/Anet/A8/Configuration_adv.h
  11. 17
    0
      Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h
  12. 17
    0
      Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h
  13. 17
    0
      Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h
  14. 17
    0
      Marlin/example_configurations/Cartesio/Configuration_adv.h
  15. 17
    0
      Marlin/example_configurations/Creality/CR-10/Configuration_adv.h
  16. 17
    0
      Marlin/example_configurations/Felix/Configuration_adv.h
  17. 17
    0
      Marlin/example_configurations/FolgerTech/i3-2020/Configuration_adv.h
  18. 17
    0
      Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h
  19. 17
    0
      Marlin/example_configurations/Malyan/M150/Configuration_adv.h
  20. 17
    0
      Marlin/example_configurations/Micromake/C1/enhanced/Configuration_adv.h
  21. 17
    0
      Marlin/example_configurations/RigidBot/Configuration_adv.h
  22. 17
    0
      Marlin/example_configurations/SCARA/Configuration_adv.h
  23. 17
    0
      Marlin/example_configurations/Sanguinololu/Configuration_adv.h
  24. 17
    0
      Marlin/example_configurations/TinyBoy2/Configuration_adv.h
  25. 17
    0
      Marlin/example_configurations/Velleman/K8200/Configuration_adv.h
  26. 17
    0
      Marlin/example_configurations/Velleman/K8400/Configuration_adv.h
  27. 17
    0
      Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h
  28. 17
    0
      Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h
  29. 17
    0
      Marlin/example_configurations/delta/generic/Configuration_adv.h
  30. 17
    0
      Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
  31. 17
    0
      Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
  32. 17
    0
      Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
  33. 17
    0
      Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h
  34. 17
    0
      Marlin/example_configurations/makibox/Configuration_adv.h
  35. 17
    0
      Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
  36. 17
    0
      Marlin/example_configurations/wt150/Configuration_adv.h
  37. 58
    0
      Marlin/language_en.h
  38. 140
    0
      Marlin/leds.cpp
  39. 169
    0
      Marlin/leds.h
  40. 60
    0
      Marlin/neopixel.cpp
  41. 44
    0
      Marlin/neopixel.h
  42. 8
    7
      Marlin/pca9632.cpp
  43. 4
    4
      Marlin/pca9632.h
  44. 5
    5
      Marlin/planner.cpp
  45. 69
    0
      Marlin/ultralcd.cpp

+ 1
- 1
.travis.yml Vedi File

90
   - opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS
90
   - opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT EEPROM_SETTINGS
91
   - opt_enable BLINKM PCA9632 RGB_LED NEOPIXEL_LED
91
   - opt_enable BLINKM PCA9632 RGB_LED NEOPIXEL_LED
92
   - opt_enable AUTO_BED_LEVELING_LINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE
92
   - opt_enable AUTO_BED_LEVELING_LINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE
93
-  - opt_enable_adv FWRETRACT MAX7219_DEBUG
93
+  - opt_enable_adv FWRETRACT MAX7219_DEBUG LED_CONTROL_MENU
94
   - opt_set ABL_GRID_POINTS_X 16
94
   - opt_set ABL_GRID_POINTS_X 16
95
   - opt_set ABL_GRID_POINTS_Y 16
95
   - opt_set ABL_GRID_POINTS_Y 16
96
   - opt_set_adv FANMUX0_PIN 53
96
   - opt_set_adv FANMUX0_PIN 53

+ 23
- 0
Marlin/Conditionals_post.h Vedi File

1096
     #define MAX_VFAT_ENTRIES (2)
1096
     #define MAX_VFAT_ENTRIES (2)
1097
   #endif
1097
   #endif
1098
 
1098
 
1099
+  // Set defaults for unspecified LED user colors
1100
+  #if ENABLED(LED_CONTROL_MENU)
1101
+    #ifndef LED_USER_PRESET_RED
1102
+      #define LED_USER_PRESET_RED       255
1103
+    #endif
1104
+    #ifndef LED_USER_PRESET_GREEN
1105
+      #define LED_USER_PRESET_GREEN     255
1106
+    #endif
1107
+    #ifndef LED_USER_PRESET_BLUE
1108
+      #define LED_USER_PRESET_BLUE      255
1109
+    #endif
1110
+    #ifndef LED_USER_PRESET_WHITE
1111
+      #define LED_USER_PRESET_WHITE     0
1112
+    #endif
1113
+    #ifndef LED_USER_PRESET_BRIGHTNESS
1114
+      #ifdef NEOPIXEL_BRIGHTNESS
1115
+        #define LED_USER_PRESET_BRIGHTNESS NEOPIXEL_BRIGHTNESS
1116
+      #else
1117
+        #define LED_USER_PRESET_BRIGHTNESS 255
1118
+      #endif
1119
+    #endif
1120
+  #endif
1121
+
1099
 #endif // CONDITIONALS_POST_H
1122
 #endif // CONDITIONALS_POST_H

+ 17
- 0
Marlin/Configuration_adv.h Vedi File

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

+ 18
- 148
Marlin/Marlin_main.cpp Vedi File

284
   #include "Max7219_Debug_LEDs.h"
284
   #include "Max7219_Debug_LEDs.h"
285
 #endif
285
 #endif
286
 
286
 
287
-#if ENABLED(NEOPIXEL_LED)
288
-  #include <Adafruit_NeoPixel.h>
289
-#endif
290
-
291
-#if ENABLED(BLINKM)
292
-  #include "blinkm.h"
293
-  #include "Wire.h"
294
-#endif
295
-
296
-#if ENABLED(PCA9632)
297
-  #include "pca9632.h"
287
+#if HAS_COLOR_LEDS
288
+  #include "leds.h"
298
 #endif
289
 #endif
299
 
290
 
300
 #if HAS_SERVOS
291
 #if HAS_SERVOS
355
                            || isnan(ubl.z_values[0][0]))
346
                            || isnan(ubl.z_values[0][0]))
356
 #endif
347
 #endif
357
 
348
 
358
-#if ENABLED(NEOPIXEL_LED)
359
-  #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
360
-    #define NEO_WHITE 255, 255, 255
361
-  #else
362
-    #define NEO_WHITE 0, 0, 0, 255
363
-  #endif
364
-#endif
365
-
366
-#if ENABLED(RGB_LED) || ENABLED(BLINKM) || ENABLED(PCA9632)
367
-  #define LED_WHITE 255, 255, 255
368
-#elif ENABLED(RGBW_LED)
369
-  #define LED_WHITE 0, 0, 0, 255
370
-#endif
371
-
372
 #if ENABLED(CNC_COORDINATE_SYSTEMS)
349
 #if ENABLED(CNC_COORDINATE_SYSTEMS)
373
   int8_t active_coordinate_system = -1; // machine space
350
   int8_t active_coordinate_system = -1; // machine space
374
   float coordinate_system[MAX_COORDINATE_SYSTEMS][XYZ];
351
   float coordinate_system[MAX_COORDINATE_SYSTEMS][XYZ];
1013
 
990
 
1014
 #endif
991
 #endif
1015
 
992
 
1016
-#if HAS_COLOR_LEDS
1017
-
1018
-  #if ENABLED(NEOPIXEL_LED)
1019
-
1020
-    Adafruit_NeoPixel pixels(NEOPIXEL_PIXELS, NEOPIXEL_PIN, NEOPIXEL_TYPE + NEO_KHZ800);
1021
-
1022
-    void set_neopixel_color(const uint32_t color) {
1023
-      for (uint16_t i = 0; i < pixels.numPixels(); ++i)
1024
-        pixels.setPixelColor(i, color);
1025
-      pixels.show();
1026
-    }
1027
-
1028
-    void setup_neopixel() {
1029
-      pixels.setBrightness(NEOPIXEL_BRIGHTNESS); // 0 - 255 range
1030
-      pixels.begin();
1031
-      pixels.show(); // initialize to all off
1032
-
1033
-      #if ENABLED(NEOPIXEL_STARTUP_TEST)
1034
-        safe_delay(1000);
1035
-        set_neopixel_color(pixels.Color(255, 0, 0, 0));  // red
1036
-        safe_delay(1000);
1037
-        set_neopixel_color(pixels.Color(0, 255, 0, 0));  // green
1038
-        safe_delay(1000);
1039
-        set_neopixel_color(pixels.Color(0, 0, 255, 0));  // blue
1040
-        safe_delay(1000);
1041
-      #endif
1042
-      set_neopixel_color(pixels.Color(NEO_WHITE));       // white
1043
-    }
1044
-
1045
-  #endif // NEOPIXEL_LED
1046
-
1047
-  void set_led_color(
1048
-    const uint8_t r, const uint8_t g, const uint8_t b
1049
-      #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED)
1050
-        , const uint8_t w = 0
1051
-        #if ENABLED(NEOPIXEL_LED)
1052
-          , const uint8_t p = NEOPIXEL_BRIGHTNESS
1053
-          , bool isSequence = false
1054
-        #endif
1055
-      #endif
1056
-  ) {
1057
-
1058
-    #if ENABLED(NEOPIXEL_LED)
1059
-
1060
-      const uint32_t color = pixels.Color(r, g, b, w);
1061
-      static uint16_t nextLed = 0;
1062
-
1063
-      pixels.setBrightness(p);
1064
-      if (!isSequence)
1065
-        set_neopixel_color(color);
1066
-      else {
1067
-        pixels.setPixelColor(nextLed, color);
1068
-        pixels.show();
1069
-        if (++nextLed >= pixels.numPixels()) nextLed = 0;
1070
-        return;
1071
-      }
1072
-
1073
-    #endif
1074
-
1075
-    #if ENABLED(BLINKM)
1076
-
1077
-      // This variant uses i2c to send the RGB components to the device.
1078
-      SendColors(r, g, b);
1079
-
1080
-    #endif
1081
-
1082
-    #if ENABLED(RGB_LED) || ENABLED(RGBW_LED)
1083
-
1084
-      // This variant uses 3 separate pins for the RGB components.
1085
-      // If the pins can do PWM then their intensity will be set.
1086
-      WRITE(RGB_LED_R_PIN, r ? HIGH : LOW);
1087
-      WRITE(RGB_LED_G_PIN, g ? HIGH : LOW);
1088
-      WRITE(RGB_LED_B_PIN, b ? HIGH : LOW);
1089
-      analogWrite(RGB_LED_R_PIN, r);
1090
-      analogWrite(RGB_LED_G_PIN, g);
1091
-      analogWrite(RGB_LED_B_PIN, b);
1092
-
1093
-      #if ENABLED(RGBW_LED)
1094
-        WRITE(RGB_LED_W_PIN, w ? HIGH : LOW);
1095
-        analogWrite(RGB_LED_W_PIN, w);
1096
-      #endif
1097
-
1098
-    #endif
1099
-
1100
-    #if ENABLED(PCA9632)
1101
-      // Update I2C LED driver
1102
-      PCA9632_SetColor(r, g, b);
1103
-    #endif
1104
-  }
1105
-
1106
-#endif // HAS_COLOR_LEDS
1107
-
1108
 void gcode_line_error(const char* err, bool doFlush = true) {
993
 void gcode_line_error(const char* err, bool doFlush = true) {
1109
   SERIAL_ERROR_START();
994
   SERIAL_ERROR_START();
1110
   serialprintPGM(err);
995
   serialprintPGM(err);
1290
             SERIAL_PROTOCOLLNPGM(MSG_FILE_PRINTED);
1175
             SERIAL_PROTOCOLLNPGM(MSG_FILE_PRINTED);
1291
             #if ENABLED(PRINTER_EVENT_LEDS)
1176
             #if ENABLED(PRINTER_EVENT_LEDS)
1292
               LCD_MESSAGEPGM(MSG_INFO_COMPLETED_PRINTS);
1177
               LCD_MESSAGEPGM(MSG_INFO_COMPLETED_PRINTS);
1293
-              set_led_color(0, 255, 0); // Green
1178
+              leds.set_green();
1294
               #if HAS_RESUME_CONTINUE
1179
               #if HAS_RESUME_CONTINUE
1295
                 enqueue_and_echo_commands_P(PSTR("M0")); // end of the queue!
1180
                 enqueue_and_echo_commands_P(PSTR("M0")); // end of the queue!
1296
               #else
1181
               #else
1297
                 safe_delay(1000);
1182
                 safe_delay(1000);
1298
               #endif
1183
               #endif
1299
-              set_led_color(0, 0, 0);   // OFF
1184
+              leds.set_off();
1300
             #endif
1185
             #endif
1301
             card.checkautostart(true);
1186
             card.checkautostart(true);
1302
           }
1187
           }
7987
         const uint8_t blue = map(constrain(temp, start_temp, target_temp), start_temp, target_temp, 255, 0);
7872
         const uint8_t blue = map(constrain(temp, start_temp, target_temp), start_temp, target_temp, 255, 0);
7988
         if (blue != old_blue) {
7873
         if (blue != old_blue) {
7989
           old_blue = blue;
7874
           old_blue = blue;
7990
-          set_led_color(255, 0, blue
7991
-          #if ENABLED(NEOPIXEL_LED)
7992
-            , 0
7993
-            , pixels.getBrightness()
7875
+          leds.set_color(
7876
+            MakeLEDColor(255, 0, blue, 0, pixels.getBrightness())
7994
             #if ENABLED(NEOPIXEL_IS_SEQUENTIAL)
7877
             #if ENABLED(NEOPIXEL_IS_SEQUENTIAL)
7995
               , true
7878
               , true
7996
             #endif
7879
             #endif
7997
-          #endif
7998
           );
7880
           );
7999
         }
7881
         }
8000
       }
7882
       }
8031
   if (wait_for_heatup) {
7913
   if (wait_for_heatup) {
8032
     LCD_MESSAGEPGM(MSG_HEATING_COMPLETE);
7914
     LCD_MESSAGEPGM(MSG_HEATING_COMPLETE);
8033
     #if ENABLED(PRINTER_EVENT_LEDS)
7915
     #if ENABLED(PRINTER_EVENT_LEDS)
8034
-      #if ENABLED(RGB_LED) || ENABLED(BLINKM) || ENABLED(PCA9632) || ENABLED(RGBW_LED)
8035
-        set_led_color(LED_WHITE);
8036
-      #endif
8037
-      #if ENABLED(NEOPIXEL_LED)
8038
-        set_neopixel_color(pixels.Color(NEO_WHITE));
8039
-      #endif
7916
+      leds.set_white();
8040
     #endif
7917
     #endif
8041
   }
7918
   }
8042
 
7919
 
8132
           const uint8_t red = map(constrain(temp, start_temp, target_temp), start_temp, target_temp, 0, 255);
8009
           const uint8_t red = map(constrain(temp, start_temp, target_temp), start_temp, target_temp, 0, 255);
8133
           if (red != old_red) {
8010
           if (red != old_red) {
8134
             old_red = red;
8011
             old_red = red;
8135
-            set_led_color(red, 0, 255
8136
-              #if ENABLED(NEOPIXEL_LED)
8137
-                , 0, pixels.getBrightness()
8138
-                #if ENABLED(NEOPIXEL_IS_SEQUENTIAL)
8139
-                  , true
8140
-                #endif
8012
+            leds.set_color(
8013
+              MakeLEDColor(red, 0, 255, 0, pixels.getBrightness())
8014
+              #if ENABLED(NEOPIXEL_IS_SEQUENTIAL)
8015
+                , true
8141
               #endif
8016
               #endif
8142
             );
8017
             );
8143
           }
8018
           }
8814
    *   M150 P          ; Set LED full brightness
8689
    *   M150 P          ; Set LED full brightness
8815
    */
8690
    */
8816
   inline void gcode_M150() {
8691
   inline void gcode_M150() {
8817
-    set_led_color(
8692
+    leds.set_color(MakeLEDColor(
8818
       parser.seen('R') ? (parser.has_value() ? parser.value_byte() : 255) : 0,
8693
       parser.seen('R') ? (parser.has_value() ? parser.value_byte() : 255) : 0,
8819
       parser.seen('U') ? (parser.has_value() ? parser.value_byte() : 255) : 0,
8694
       parser.seen('U') ? (parser.has_value() ? parser.value_byte() : 255) : 0,
8820
-      parser.seen('B') ? (parser.has_value() ? parser.value_byte() : 255) : 0
8821
-      #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED)
8822
-        , parser.seen('W') ? (parser.has_value() ? parser.value_byte() : 255) : 0
8823
-        #if ENABLED(NEOPIXEL_LED)
8824
-          , parser.seen('P') ? (parser.has_value() ? parser.value_byte() : 255) : pixels.getBrightness()
8825
-        #endif
8826
-      #endif
8827
-    );
8695
+      parser.seen('B') ? (parser.has_value() ? parser.value_byte() : 255) : 0,
8696
+      parser.seen('W') ? (parser.has_value() ? parser.value_byte() : 255) : 0,
8697
+      parser.seen('P') ? (parser.has_value() ? parser.value_byte() : 255) : pixels.getBrightness()
8698
+    ));
8828
   }
8699
   }
8829
 
8700
 
8830
 #endif // HAS_COLOR_LEDS
8701
 #endif // HAS_COLOR_LEDS
13982
     OUT_WRITE(STAT_LED_BLUE_PIN, LOW); // turn it off
13853
     OUT_WRITE(STAT_LED_BLUE_PIN, LOW); // turn it off
13983
   #endif
13854
   #endif
13984
 
13855
 
13985
-  #if ENABLED(NEOPIXEL_LED)
13986
-    SET_OUTPUT(NEOPIXEL_PIN);
13987
-    setup_neopixel();
13856
+  #if HAS_COLOR_LEDS
13857
+    leds.setup();
13988
   #endif
13858
   #endif
13989
 
13859
 
13990
   #if ENABLED(RGB_LED) || ENABLED(RGBW_LED)
13860
   #if ENABLED(RGB_LED) || ENABLED(RGBW_LED)

+ 4
- 0
Marlin/SanityCheck.h Vedi File

1514
 #if !BLOCK_BUFFER_SIZE || !IS_POWER_OF_2(BLOCK_BUFFER_SIZE)
1514
 #if !BLOCK_BUFFER_SIZE || !IS_POWER_OF_2(BLOCK_BUFFER_SIZE)
1515
   #error "BLOCK_BUFFER_SIZE must be a power of 2."
1515
   #error "BLOCK_BUFFER_SIZE must be a power of 2."
1516
 #endif
1516
 #endif
1517
+
1518
+#if ENABLED(LED_CONTROL_MENU) && DISABLED(ULTIPANEL)
1519
+  #error "LED_CONTROL_MENU requires an LCD controller."
1520
+#endif

+ 8
- 8
Marlin/blinkm.cpp Vedi File

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 "Marlin.h"
27
+#include "MarlinConfig.h"
29
 
28
 
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 SendColors(byte red, byte grn, byte blu) {
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(red);
40
-  Wire.write(grn);
41
-  Wire.write(blu);
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
-

+ 9
- 5
Marlin/blinkm.h Vedi File

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
-#include "Arduino.h"
29
-#include "Wire.h"
27
+#ifndef _BLINKM_H_
28
+#define _BLINKM_H_
30
 
29
 
31
-void SendColors(byte red, byte grn, byte blu);
30
+struct LEDColor;
31
+typedef LEDColor LEDColor;
32
+
33
+void blinkm_set_led_color(const LEDColor &color);
34
+
35
+#endif // _BLINKM_H_

+ 17
- 0
Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h Vedi File

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/example_configurations/Anet/A6/Configuration_adv.h Vedi File

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/example_configurations/Anet/A8/Configuration_adv.h Vedi File

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/example_configurations/BQ/Hephestos/Configuration_adv.h Vedi File

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/example_configurations/BQ/Hephestos_2/Configuration_adv.h Vedi File

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/example_configurations/BQ/WITBOX/Configuration_adv.h Vedi File

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/example_configurations/Cartesio/Configuration_adv.h Vedi File

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/example_configurations/Creality/CR-10/Configuration_adv.h Vedi File

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/example_configurations/Felix/Configuration_adv.h Vedi File

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/example_configurations/FolgerTech/i3-2020/Configuration_adv.h Vedi File

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/example_configurations/Infitary/i3-M508/Configuration_adv.h Vedi File

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/example_configurations/Malyan/M150/Configuration_adv.h Vedi File

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/example_configurations/Micromake/C1/enhanced/Configuration_adv.h Vedi File

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/example_configurations/RigidBot/Configuration_adv.h Vedi File

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/example_configurations/SCARA/Configuration_adv.h Vedi File

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/example_configurations/Sanguinololu/Configuration_adv.h Vedi File

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/example_configurations/TinyBoy2/Configuration_adv.h Vedi File

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/example_configurations/Velleman/K8200/Configuration_adv.h Vedi File

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/example_configurations/Velleman/K8400/Configuration_adv.h Vedi File

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/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h Vedi File

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/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h Vedi File

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/example_configurations/delta/generic/Configuration_adv.h Vedi File

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/example_configurations/delta/kossel_mini/Configuration_adv.h Vedi File

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/example_configurations/delta/kossel_pro/Configuration_adv.h Vedi File

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/example_configurations/delta/kossel_xl/Configuration_adv.h Vedi File

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/example_configurations/gCreate/gMax1.5+/Configuration_adv.h Vedi File

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/example_configurations/makibox/Configuration_adv.h Vedi File

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/example_configurations/tvrrug/Round2/Configuration_adv.h Vedi File

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/example_configurations/wt150/Configuration_adv.h Vedi File

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

+ 58
- 0
Marlin/language_en.h Vedi File

362
   #define MSG_UBL_STEP_BY_STEP_MENU           _UxGT("Step-By-Step UBL")
362
   #define MSG_UBL_STEP_BY_STEP_MENU           _UxGT("Step-By-Step UBL")
363
 #endif
363
 #endif
364
 
364
 
365
+#ifndef MSG_LED_CONTROL
366
+  #define MSG_LED_CONTROL                     _UxGT("LED Control")
367
+#endif
368
+#ifndef MSG_LEDS_ON
369
+  #define MSG_LEDS_ON                         _UxGT("Lights On")
370
+#endif
371
+#ifndef MSG_LEDS_OFF
372
+  #define MSG_LEDS_OFF                        _UxGT("Lights Off")
373
+#endif
374
+#ifndef MSG_LED_PRESETS
375
+  #define MSG_LED_PRESETS                     _UxGT("Light Presets")
376
+#endif
377
+#ifndef MSG_SET_LEDS_RED
378
+  #define MSG_SET_LEDS_RED                    _UxGT("Lights Red")
379
+#endif
380
+#ifndef MSG_SET_LEDS_ORANGE
381
+  #define MSG_SET_LEDS_ORANGE                 _UxGT("Lights Orange")
382
+#endif
383
+#ifndef MSG_SET_LEDS_YELLOW
384
+  #define MSG_SET_LEDS_YELLOW                 _UxGT("Lights Yellow")
385
+#endif
386
+#ifndef MSG_SET_LEDS_GREEN
387
+  #define MSG_SET_LEDS_GREEN                  _UxGT("Lights Green")
388
+#endif
389
+#ifndef MSG_SET_LEDS_BLUE
390
+  #define MSG_SET_LEDS_BLUE                   _UxGT("Lights Blue")
391
+#endif
392
+#ifndef MSG_SET_LEDS_INDIGO
393
+  #define MSG_SET_LEDS_INDIGO                 _UxGT("Lights Indigo")
394
+#endif
395
+#ifndef MSG_SET_LEDS_VIOLET
396
+  #define MSG_SET_LEDS_VIOLET                 _UxGT("Lights Violet")
397
+#endif
398
+#ifndef MSG_SET_LEDS_WHITE
399
+  #define MSG_SET_LEDS_WHITE                  _UxGT("Lights White")
400
+#endif
401
+#ifndef MSG_SET_LEDS_DEFAULT
402
+  #define MSG_SET_LEDS_DEFAULT                _UxGT("Lights Default")
403
+#endif
404
+#ifndef MSG_CUSTOM_LEDS
405
+  #define MSG_CUSTOM_LEDS                     _UxGT("Custom Lights")
406
+#endif
407
+#ifndef MSG_INTENSITY_R
408
+  #define MSG_INTENSITY_R                     _UxGT("Red Intensity")
409
+#endif
410
+#ifndef MSG_INTENSITY_G
411
+  #define MSG_INTENSITY_G                     _UxGT("Green Intensity")
412
+#endif
413
+#ifndef MSG_INTENSITY_B
414
+  #define MSG_INTENSITY_B                     _UxGT("Blue Intensity")
415
+#endif
416
+#ifndef MSG_INTENSITY_W
417
+  #define MSG_INTENSITY_W                     _UxGT("White Intensity")
418
+#endif
419
+#ifndef MSG_LED_BRIGHTNESS
420
+  #define MSG_LED_BRIGHTNESS                  _UxGT("Brightness")
421
+#endif
422
+
365
 #ifndef MSG_MOVING
423
 #ifndef MSG_MOVING
366
   #define MSG_MOVING                          _UxGT("Moving...")
424
   #define MSG_MOVING                          _UxGT("Moving...")
367
 #endif
425
 #endif

+ 140
- 0
Marlin/leds.cpp Vedi File

1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+/**
24
+ * leds.cpp - Marlin RGB LED general support
25
+ */
26
+
27
+#include "MarlinConfig.h"
28
+
29
+#if HAS_COLOR_LEDS
30
+
31
+#include "leds.h"
32
+
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
71
+) {
72
+
73
+  #if ENABLED(NEOPIXEL_LED)
74
+
75
+    const uint32_t neocolor = pixels.Color(incol.r, incol.g, incol.b, incol.w);
76
+    static uint16_t nextLed = 0;
77
+
78
+    pixels.setBrightness(incol.i);
79
+    if (!isSequence)
80
+      set_neopixel_color(neocolor);
81
+    else {
82
+      pixels.setPixelColor(nextLed, neocolor);
83
+      pixels.show();
84
+      if (++nextLed >= pixels.numPixels()) nextLed = 0;
85
+      return;
86
+    }
87
+
88
+  #endif
89
+
90
+  #if ENABLED(BLINKM)
91
+
92
+    // This variant uses i2c to send the RGB components to the device.
93
+    blinkm_set_led_color(incol);
94
+
95
+  #endif
96
+
97
+  #if ENABLED(RGB_LED) || ENABLED(RGBW_LED)
98
+
99
+    // This variant uses 3-4 separate pins for the RGB(W) components.
100
+    // If the pins can do PWM then their intensity will be set.
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);
107
+
108
+    #if ENABLED(RGBW_LED)
109
+      WRITE(RGB_LED_W_PIN, incol.w ? HIGH : LOW);
110
+      analogWrite(RGB_LED_W_PIN, incol.w);
111
+    #endif
112
+
113
+  #endif
114
+
115
+  #if ENABLED(PCA9632)
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;
124
+  #endif
125
+}
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
+
140
+#endif // HAS_COLOR_LEDS

+ 169
- 0
Marlin/leds.h Vedi File

1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+/**
24
+ * leds.h - Marlin general RGB LED support
25
+ */
26
+
27
+#ifndef __LEDS_H__
28
+#define __LEDS_H__
29
+
30
+#include "MarlinConfig.h"
31
+
32
+#if ENABLED(NEOPIXEL_LED)
33
+  #include "neopixel.h"
34
+#endif
35
+
36
+#define HAS_WHITE_LED (ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED))
37
+
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;
90
+
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
101
+#else
102
+  #define MakeLEDColor(R,G,B,W,I) LEDColor(R, G, B)
103
+  #define LEDColorWhite() LEDColor(255, 255, 255)
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
+  );
125
+
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
129
+      #if ENABLED(NEOPIXEL_LED)
130
+        , uint8_t i=NEOPIXEL_BRIGHTNESS
131
+      #endif
132
+    #endif
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;
168
+
169
+#endif // __LEDS_H__

+ 60
- 0
Marlin/neopixel.cpp Vedi File

1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+/**
24
+ * neopixel.cpp
25
+ */
26
+
27
+#include "MarlinConfig.h"
28
+
29
+#if ENABLED(NEOPIXEL_LED)
30
+
31
+#include "neopixel.h"
32
+
33
+Adafruit_NeoPixel pixels(NEOPIXEL_PIXELS, NEOPIXEL_PIN, NEOPIXEL_TYPE + NEO_KHZ800);
34
+
35
+void set_neopixel_color(const uint32_t color) {
36
+  for (uint16_t i = 0; i < pixels.numPixels(); ++i)
37
+    pixels.setPixelColor(i, color);
38
+  pixels.show();
39
+}
40
+
41
+void setup_neopixel() {
42
+  SET_OUTPUT(NEOPIXEL_PIN);
43
+  pixels.setBrightness(NEOPIXEL_BRIGHTNESS); // 0 - 255 range
44
+  pixels.begin();
45
+  pixels.show(); // initialize to all off
46
+
47
+  #if ENABLED(NEOPIXEL_STARTUP_TEST)
48
+    safe_delay(1000);
49
+    set_neopixel_color(pixels.Color(255, 0, 0, 0));  // red
50
+    safe_delay(1000);
51
+    set_neopixel_color(pixels.Color(0, 255, 0, 0));  // green
52
+    safe_delay(1000);
53
+    set_neopixel_color(pixels.Color(0, 0, 255, 0));  // blue
54
+    safe_delay(1000);
55
+  #endif
56
+  set_neopixel_color(pixels.Color(NEO_WHITE));       // white
57
+}
58
+
59
+#endif // NEOPIXEL_LED
60
+

+ 44
- 0
Marlin/neopixel.h Vedi File

1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+/**
24
+ * neopixel.h
25
+ */
26
+
27
+#include "MarlinConfig.h"
28
+
29
+#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)
30
+#define NEOPIXEL_IS_RGBW !NEOPIXEL_IS_RGB
31
+
32
+#if NEOPIXEL_IS_RGB
33
+  #define NEO_WHITE 255, 255, 255, 0
34
+#else
35
+  #define NEO_WHITE 0, 0, 0, 255
36
+#endif
37
+
38
+#include <Adafruit_NeoPixel.h>
39
+#include <stdint.h>
40
+
41
+void setup_neopixel();
42
+void set_neopixel_color(const uint32_t color);
43
+
44
+extern Adafruit_NeoPixel pixels;

+ 8
- 7
Marlin/pca9632.cpp Vedi File

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
  */
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)
36
 #define PCA9632_LEDOUT_VALUE  0b00101010
38
 #define PCA9632_LEDOUT_VALUE  0b00101010
37
 
39
 
38
-
39
 /* Register addresses */
40
 /* Register addresses */
40
 #define PCA9632_MODE1       0x00
41
 #define PCA9632_MODE1       0x00
41
 #define PCA9632_MODE2       0x01
42
 #define PCA9632_MODE2       0x01
98
   }
99
   }
99
 #endif
100
 #endif
100
 
101
 
101
-void PCA9632_SetColor(const byte r, const byte g, const byte b) {
102
+void pca9632_set_led_color(const LEDColor &color) {
102
   if (!PCA_init) {
103
   if (!PCA_init) {
103
     PCA_init = 1;
104
     PCA_init = 1;
104
     Wire.begin();
105
     Wire.begin();
106
     PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_MODE2, PCA9632_MODE2_VALUE);
107
     PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_MODE2, PCA9632_MODE2_VALUE);
107
   }
108
   }
108
 
109
 
109
-  const byte LEDOUT = (r ? LED_PWM << PCA9632_RED : 0)
110
-                    | (g ? LED_PWM << PCA9632_GRN : 0)
111
-                    | (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);
112
 
113
 
113
-  PCA9632_WriteAllRegisters(PCA9632_ADDRESS,PCA9632_PWM0, r, g, b);
114
+  PCA9632_WriteAllRegisters(PCA9632_ADDRESS,PCA9632_PWM0, color.r, color.g, color.b);
114
   PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_LEDOUT, LEDOUT);
115
   PCA9632_WriteRegister(PCA9632_ADDRESS,PCA9632_LEDOUT, LEDOUT);
115
 }
116
 }
116
 
117
 

+ 4
- 4
Marlin/pca9632.h Vedi File

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_SetColor(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
- 5
Marlin/planner.cpp Vedi File

1312
 
1312
 
1313
     // The junction velocity will be shared between successive segments. Limit the junction velocity to their minimum.
1313
     // The junction velocity will be shared between successive segments. Limit the junction velocity to their minimum.
1314
     const bool prev_speed_larger = previous_nominal_speed > block->nominal_speed;
1314
     const bool prev_speed_larger = previous_nominal_speed > block->nominal_speed;
1315
-    float smaller_speed_factor = prev_speed_larger ? (block->nominal_speed / previous_nominal_speed) : (previous_nominal_speed / block->nominal_speed);
1315
+    const float smaller_speed_factor = prev_speed_larger ? (block->nominal_speed / previous_nominal_speed) : (previous_nominal_speed / block->nominal_speed);
1316
     // Pick the smaller of the nominal speeds. Higher speed shall not be achieved at the junction during coasting.
1316
     // Pick the smaller of the nominal speeds. Higher speed shall not be achieved at the junction during coasting.
1317
     vmax_junction = prev_speed_larger ? block->nominal_speed : previous_nominal_speed;
1317
     vmax_junction = prev_speed_larger ? block->nominal_speed : previous_nominal_speed;
1318
     // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities.
1318
     // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities.
1444
   #else
1444
   #else
1445
     #define _EINDEX E_AXIS
1445
     #define _EINDEX E_AXIS
1446
   #endif
1446
   #endif
1447
-  long na = position[X_AXIS] = LROUND(a * axis_steps_per_mm[X_AXIS]),
1448
-       nb = position[Y_AXIS] = LROUND(b * axis_steps_per_mm[Y_AXIS]),
1449
-       nc = position[Z_AXIS] = LROUND(c * axis_steps_per_mm[Z_AXIS]),
1450
-       ne = position[E_AXIS] = LROUND(e * axis_steps_per_mm[_EINDEX]);
1447
+  const long na = position[X_AXIS] = LROUND(a * axis_steps_per_mm[X_AXIS]),
1448
+             nb = position[Y_AXIS] = LROUND(b * axis_steps_per_mm[Y_AXIS]),
1449
+             nc = position[Z_AXIS] = LROUND(c * axis_steps_per_mm[Z_AXIS]),
1450
+             ne = position[E_AXIS] = LROUND(e * axis_steps_per_mm[_EINDEX]);
1451
   #if ENABLED(LIN_ADVANCE)
1451
   #if ENABLED(LIN_ADVANCE)
1452
     position_float[X_AXIS] = a;
1452
     position_float[X_AXIS] = a;
1453
     position_float[Y_AXIS] = b;
1453
     position_float[Y_AXIS] = b;

+ 69
- 0
Marlin/ultralcd.cpp Vedi File

184
     void lcd_info_menu();
184
     void lcd_info_menu();
185
   #endif // LCD_INFO_MENU
185
   #endif // LCD_INFO_MENU
186
 
186
 
187
+  #if ENABLED(LED_CONTROL_MENU)
188
+    #include "leds.h"
189
+    void lcd_led_menu();
190
+  #endif
191
+
187
   #if ENABLED(ADVANCED_PAUSE_FEATURE)
192
   #if ENABLED(ADVANCED_PAUSE_FEATURE)
188
     void lcd_advanced_pause_toocold_menu();
193
     void lcd_advanced_pause_toocold_menu();
189
     void lcd_advanced_pause_option_menu();
194
     void lcd_advanced_pause_option_menu();
1013
       MENU_ITEM(submenu, MSG_INFO_MENU, lcd_info_menu);
1018
       MENU_ITEM(submenu, MSG_INFO_MENU, lcd_info_menu);
1014
     #endif
1019
     #endif
1015
 
1020
 
1021
+    #if ENABLED(LED_CONTROL_MENU)
1022
+      MENU_ITEM(submenu, MSG_LED_CONTROL, lcd_led_menu);
1023
+    #endif
1024
+
1016
     END_MENU();
1025
     END_MENU();
1017
   }
1026
   }
1018
 
1027
 
3944
 
3953
 
3945
   /**
3954
   /**
3946
    *
3955
    *
3956
+   * LED Menu
3957
+   *
3958
+   */
3959
+
3960
+  #if ENABLED(LED_CONTROL_MENU)
3961
+
3962
+    #if ENABLED(LED_COLOR_PRESETS)
3963
+
3964
+      void lcd_led_presets_menu() {
3965
+        START_MENU();
3966
+        #if LCD_HEIGHT > 2
3967
+          STATIC_ITEM(MSG_LED_PRESETS, true, true);
3968
+        #endif
3969
+        MENU_BACK(MSG_LED_CONTROL);
3970
+        MENU_ITEM(function, MSG_SET_LEDS_WHITE, leds.set_white);
3971
+        MENU_ITEM(function, MSG_SET_LEDS_RED, leds.set_red);
3972
+        MENU_ITEM(function, MSG_SET_LEDS_ORANGE, leds.set_orange);
3973
+        MENU_ITEM(function, MSG_SET_LEDS_YELLOW,leds.set_yellow);
3974
+        MENU_ITEM(function, MSG_SET_LEDS_GREEN, leds.set_green);
3975
+        MENU_ITEM(function, MSG_SET_LEDS_BLUE, leds.set_blue);
3976
+        MENU_ITEM(function, MSG_SET_LEDS_INDIGO, leds.set_indigo);
3977
+        MENU_ITEM(function, MSG_SET_LEDS_VIOLET, leds.set_violet);
3978
+        END_MENU();
3979
+      }
3980
+    #endif // LED_COLOR_PRESETS
3981
+
3982
+    void lcd_led_custom_menu() {
3983
+      START_MENU();
3984
+      MENU_BACK(MSG_LED_CONTROL);
3985
+      MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_R, &leds.color.r, 0, 255, leds.update, true);
3986
+      MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_G, &leds.color.g, 0, 255, leds.update, true);
3987
+      MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_B, &leds.color.b, 0, 255, leds.update, true);
3988
+      #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED)
3989
+        MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_W, &leds.color.w, 0, 255, leds.update, true);
3990
+        #if ENABLED(NEOPIXEL_LED)
3991
+          MENU_ITEM_EDIT_CALLBACK(int8, MSG_LED_BRIGHTNESS, &leds.color.i, 0, 255, leds.update, true);
3992
+        #endif
3993
+      #endif
3994
+      END_MENU();
3995
+    }
3996
+
3997
+    void lcd_led_menu() {
3998
+      START_MENU();
3999
+      MENU_BACK(MSG_MAIN);
4000
+      if (leds.lights_on)
4001
+        MENU_ITEM(function, MSG_LEDS_OFF, leds.toggle);
4002
+      else
4003
+        MENU_ITEM(function, MSG_LEDS_ON, leds.toggle);
4004
+      MENU_ITEM(function, MSG_SET_LEDS_DEFAULT, leds.set_default);
4005
+      #if ENABLED(LED_COLOR_PRESETS)
4006
+        MENU_ITEM(submenu, MSG_LED_PRESETS, lcd_led_presets_menu);
4007
+      #endif
4008
+      MENU_ITEM(submenu, MSG_CUSTOM_LEDS, lcd_led_custom_menu);
4009
+      END_MENU();
4010
+    }
4011
+
4012
+  #endif // LED_CONTROL_MENU
4013
+
4014
+  /**
4015
+   *
3947
    * Filament Change Feature Screens
4016
    * Filament Change Feature Screens
3948
    *
4017
    *
3949
    */
4018
    */

Loading…
Annulla
Salva