Apply LEDColor, language fixes
This commit is contained in:
@ -45,17 +45,13 @@
|
||||
* M150 P ; Set LED full brightness
|
||||
*/
|
||||
void GcodeSuite::M150() {
|
||||
set_led_color(
|
||||
leds.set_color(MakeLEDColor(
|
||||
parser.seen('R') ? (parser.has_value() ? parser.value_byte() : 255) : 0,
|
||||
parser.seen('U') ? (parser.has_value() ? parser.value_byte() : 255) : 0,
|
||||
parser.seen('B') ? (parser.has_value() ? parser.value_byte() : 255) : 0
|
||||
#if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED)
|
||||
, parser.seen('W') ? (parser.has_value() ? parser.value_byte() : 255) : 0
|
||||
#if ENABLED(NEOPIXEL_LED)
|
||||
, parser.seen('P') ? (parser.has_value() ? parser.value_byte() : 255) : pixels.getBrightness()
|
||||
#endif
|
||||
#endif
|
||||
);
|
||||
parser.seen('B') ? (parser.has_value() ? parser.value_byte() : 255) : 0,
|
||||
parser.seen('W') ? (parser.has_value() ? parser.value_byte() : 255) : 0,
|
||||
parser.seen('P') ? (parser.has_value() ? parser.value_byte() : 255) : pixels.getBrightness()
|
||||
));
|
||||
}
|
||||
|
||||
#endif // HAS_COLOR_LEDS
|
||||
|
@ -370,13 +370,13 @@ inline void get_serial_commands() {
|
||||
SERIAL_PROTOCOLLNPGM(MSG_FILE_PRINTED);
|
||||
#if ENABLED(PRINTER_EVENT_LEDS)
|
||||
LCD_MESSAGEPGM(MSG_INFO_COMPLETED_PRINTS);
|
||||
set_led_color(0, 255, 0); // Green
|
||||
leds.set_green();
|
||||
#if HAS_RESUME_CONTINUE
|
||||
enqueue_and_echo_commands_P(PSTR("M0")); // end of the queue!
|
||||
#else
|
||||
safe_delay(1000);
|
||||
#endif
|
||||
set_led_color(0, 0, 0); // OFF
|
||||
leds.set_off();
|
||||
#endif
|
||||
card.checkautostart(true);
|
||||
}
|
||||
|
@ -190,12 +190,10 @@ 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_LED)
|
||||
, 0, pixels.getBrightness()
|
||||
#if ENABLED(NEOPIXEL_IS_SEQUENTIAL)
|
||||
, true
|
||||
#endif
|
||||
leds.set_color(
|
||||
MakeLEDColor(255, 0, blue, 0, pixels.getBrightness())
|
||||
#if ENABLED(NEOPIXEL_IS_SEQUENTIAL)
|
||||
, true
|
||||
#endif
|
||||
);
|
||||
}
|
||||
@ -233,12 +231,7 @@ void GcodeSuite::M109() {
|
||||
if (wait_for_heatup) {
|
||||
LCD_MESSAGEPGM(MSG_HEATING_COMPLETE);
|
||||
#if ENABLED(PRINTER_EVENT_LEDS)
|
||||
#if ENABLED(RGB_LED) || ENABLED(BLINKM) || ENABLED(PCA9632) || ENABLED(RGBW_LED)
|
||||
set_led_color(LED_WHITE);
|
||||
#endif
|
||||
#if ENABLED(NEOPIXEL_LED)
|
||||
set_neopixel_color(pixels.Color(NEO_WHITE));
|
||||
#endif
|
||||
leds.set_white();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -132,12 +132,10 @@ 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_LED)
|
||||
, 0, pixels.getBrightness()
|
||||
#if ENABLED(NEOPIXEL_IS_SEQUENTIAL)
|
||||
, true
|
||||
#endif
|
||||
leds.set_color(
|
||||
MakeLEDColor(red, 0, 255, 0, pixels.getBrightness())
|
||||
#if ENABLED(NEOPIXEL_IS_SEQUENTIAL)
|
||||
, true
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user