Skip to content
Snippets Groups Projects
Commit eeef4e63 authored by Scott Lahteine's avatar Scott Lahteine
Browse files

Fix compile error in leds.h

parent 9969c06c
Branches
Tags
No related merge requests found
......@@ -27,6 +27,8 @@
#include "../../inc/MarlinConfigPre.h"
#include <string.h>
#if ENABLED(NEOPIXEL_LED)
#include "neopixel.h"
#endif
......@@ -45,6 +47,7 @@ typedef struct LEDColor {
#endif
#endif
;
LEDColor() : r(255), g(255), b(255)
#if HAS_WHITE_LED
, w(255)
......@@ -53,6 +56,7 @@ typedef struct LEDColor {
#endif
#endif
{}
LEDColor(uint8_t r, uint8_t g, uint8_t b
#if HAS_WHITE_LED
, uint8_t w=0
......@@ -68,6 +72,7 @@ typedef struct LEDColor {
#endif
#endif
{}
LEDColor(const uint8_t (&rgbw)[4]) : r(rgbw[0]), g(rgbw[1]), b(rgbw[2])
#if HAS_WHITE_LED
, w(rgbw[3])
......@@ -76,6 +81,7 @@ typedef struct LEDColor {
#endif
#endif
{}
LEDColor& operator=(const uint8_t (&rgbw)[4]) {
r = rgbw[0]; g = rgbw[1]; b = rgbw[2];
#if HAS_WHITE_LED
......@@ -83,15 +89,19 @@ typedef struct LEDColor {
#endif
return *this;
}
LEDColor& operator=(const LEDColor &right) {
if (this != &right) memcpy(this, &right, sizeof(LEDColor));
return *this;
}
bool operator==(const LEDColor &right) {
if (this == &right) return true;
return 0 == memcmp(this, &right, sizeof(LEDColor));
}
bool operator!=(const LEDColor &right) { return !operator==(right); }
bool is_off() const {
return 3 > r + g + b
#if HAS_WHITE_LED
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment