File tree 1 file changed +4
-2
lines changed
Marlin/src/gcode/feature/leds
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ void GcodeSuite::M150() {
60
60
61
61
#if ENABLED(NEOPIXEL_LED)
62
62
const pixel_index_t index = parser.intval (' I' , -1 );
63
+ const bool seenK = parser.seen_test (' K' );
63
64
#if ENABLED(NEOPIXEL2_SEPARATE)
64
65
#ifndef NEOPIXEL_M150_DEFAULT
65
66
#define NEOPIXEL_M150_DEFAULT -1
@@ -69,12 +70,13 @@ void GcodeSuite::M150() {
69
70
int8_t brightness = neo.brightness (), unit = parser.intval (' S' , NEOPIXEL_M150_DEFAULT);
70
71
switch (unit) {
71
72
case -1 : neo2.neoindex = index ; // fall-thru
72
- case 0 : neo.neoindex = index ; old_color = parser. seen ( ' K ' ) ? neo.pixel_color (index >= 0 ? index : 0 ) : 0 ; break ;
73
- case 1 : neo2.neoindex = index ; brightness = neo2.brightness (); old_color = parser. seen ( ' K ' ) ? neo2.pixel_color (index >= 0 ? index : 0 ) : 0 ; break ;
73
+ case 0 : neo.neoindex = index ; old_color = seenK ? neo.pixel_color (_MAX ( index , 0 ) ) : 0 ; break ;
74
+ case 1 : neo2.neoindex = index ; brightness = neo2.brightness (); old_color = seenK ? neo2.pixel_color (_MAX ( index , 0 ) ) : 0 ; break ;
74
75
}
75
76
#else
76
77
const uint8_t brightness = neo.brightness ();
77
78
neo.neoindex = index ;
79
+ old_color = seenK ? neo.pixel_color (_MAX (index , 0 )) : 0 ;
78
80
#endif
79
81
#endif
80
82
You can’t perform that action at this time.
0 commit comments