Different NEOPIXEL types
Same as #7728 but for 2.0.x, Lot of cleanup and remove references in whole code to other "LED files" than leds.h. Now will be much easier to add next drivers/libraries. e.g. FastLED. But bad news, currently FastLED is suporting only RGB devices (no RGBW)
This commit is contained in:
committed by
Scott Lahteine
parent
b30b55307c
commit
a11e6a1022
@ -31,7 +31,7 @@
|
||||
#include "../../module/printcounter.h"
|
||||
#endif
|
||||
|
||||
#if HAS_COLOR_LEDS
|
||||
#if ENABLED(PRINTER_EVENT_LEDS)
|
||||
#include "../../feature/leds/leds.h"
|
||||
#endif
|
||||
|
||||
@ -190,11 +190,7 @@ void GcodeSuite::M109() {
|
||||
const uint8_t blue = map(constrain(temp, start_temp, target_temp), start_temp, target_temp, 255, 0);
|
||||
if (blue != old_blue) {
|
||||
old_blue = blue;
|
||||
set_led_color(255, 0, blue
|
||||
#if ENABLED(NEOPIXEL_RGBW_LED)
|
||||
, 0, true
|
||||
#endif
|
||||
);
|
||||
set_led_color(255, 0, blue);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -230,10 +226,11 @@ void GcodeSuite::M109() {
|
||||
if (wait_for_heatup) {
|
||||
LCD_MESSAGEPGM(MSG_HEATING_COMPLETE);
|
||||
#if ENABLED(PRINTER_EVENT_LEDS)
|
||||
#if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_RGBW_LED)
|
||||
set_led_color(0, 0, 0, 255); // Turn on the WHITE LED
|
||||
#else
|
||||
set_led_color(255, 255, 255); // Set LEDs All On
|
||||
#if ENABLED(RGB_LED) || ENABLED(BLINKM) || ENABLED(PCA9632) || ENABLED(RGBW_LED)
|
||||
set_led_color(LED_WHITE);
|
||||
#endif
|
||||
#if ENABLED(NEOPIXEL_LED)
|
||||
set_neopixel_color(pixels.Color(NEO_WHITE));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
@ -132,11 +132,7 @@ void GcodeSuite::M190() {
|
||||
const uint8_t red = map(constrain(temp, start_temp, target_temp), start_temp, target_temp, 0, 255);
|
||||
if (red != old_red) {
|
||||
old_red = red;
|
||||
set_led_color(red, 0, 255
|
||||
#if ENABLED(NEOPIXEL_RGBW_LED)
|
||||
, 0, true
|
||||
#endif
|
||||
);
|
||||
set_led_color(red, 0, 255);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user