✨ M150 S default index (#23066)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
parent
5a97ffc414
commit
c86f20010d
@ -3305,6 +3305,7 @@
|
|||||||
#define NEOPIXEL2_PIXELS 15 // Number of LEDs in the second strip
|
#define NEOPIXEL2_PIXELS 15 // Number of LEDs in the second strip
|
||||||
#define NEOPIXEL2_BRIGHTNESS 127 // Initial brightness (0-255)
|
#define NEOPIXEL2_BRIGHTNESS 127 // Initial brightness (0-255)
|
||||||
#define NEOPIXEL2_STARTUP_TEST // Cycle through colors at startup
|
#define NEOPIXEL2_STARTUP_TEST // Cycle through colors at startup
|
||||||
|
#define NEOPIXEL_M150_DEFAULT -1 // Default strip for M150 without 'S'. Use -1 to set all by default.
|
||||||
#else
|
#else
|
||||||
//#define NEOPIXEL2_INSERIES // Default behavior is NeoPixel 2 in parallel
|
//#define NEOPIXEL2_INSERIES // Default behavior is NeoPixel 2 in parallel
|
||||||
#endif
|
#endif
|
||||||
|
@ -61,7 +61,12 @@ void GcodeSuite::M150() {
|
|||||||
#if ENABLED(NEOPIXEL_LED)
|
#if ENABLED(NEOPIXEL_LED)
|
||||||
const pixel_index_t index = parser.intval('I', -1);
|
const pixel_index_t index = parser.intval('I', -1);
|
||||||
#if ENABLED(NEOPIXEL2_SEPARATE)
|
#if ENABLED(NEOPIXEL2_SEPARATE)
|
||||||
int8_t brightness = neo.brightness(), unit = parser.intval('S', -1);
|
#ifndef NEOPIXEL_M150_DEFAULT
|
||||||
|
#define NEOPIXEL_M150_DEFAULT -1
|
||||||
|
#elif NEOPIXEL_M150_DEFAULT > 1
|
||||||
|
#error "NEOPIXEL_M150_DEFAULT must be -1, 0, or 1."
|
||||||
|
#endif
|
||||||
|
int8_t brightness = neo.brightness(), unit = parser.intval('S', NEOPIXEL_M150_DEFAULT);
|
||||||
switch (unit) {
|
switch (unit) {
|
||||||
case -1: neo2.neoindex = index; // fall-thru
|
case -1: neo2.neoindex = index; // fall-thru
|
||||||
case 0: neo.neoindex = index; old_color = parser.seen('K') ? neo.pixel_color(index >= 0 ? index : 0) : 0; break;
|
case 0: neo.neoindex = index; old_color = parser.seen('K') ? neo.pixel_color(index >= 0 ? index : 0) : 0; break;
|
||||||
|
Loading…
Reference in New Issue
Block a user