浏览代码

Fix compile error in leds.h

Scott Lahteine 6 年前
父节点
当前提交
eeef4e630a
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10
    0
      Marlin/src/feature/leds/leds.h

+ 10
- 0
Marlin/src/feature/leds/leds.h 查看文件

27
 
27
 
28
 #include "../../inc/MarlinConfigPre.h"
28
 #include "../../inc/MarlinConfigPre.h"
29
 
29
 
30
+#include <string.h>
31
+
30
 #if ENABLED(NEOPIXEL_LED)
32
 #if ENABLED(NEOPIXEL_LED)
31
   #include "neopixel.h"
33
   #include "neopixel.h"
32
 #endif
34
 #endif
45
       #endif
47
       #endif
46
     #endif
48
     #endif
47
   ;
49
   ;
50
+
48
   LEDColor() : r(255), g(255), b(255)
51
   LEDColor() : r(255), g(255), b(255)
49
     #if HAS_WHITE_LED
52
     #if HAS_WHITE_LED
50
       , w(255)
53
       , w(255)
53
       #endif
56
       #endif
54
     #endif
57
     #endif
55
   {}
58
   {}
59
+
56
   LEDColor(uint8_t r, uint8_t g, uint8_t b
60
   LEDColor(uint8_t r, uint8_t g, uint8_t b
57
     #if HAS_WHITE_LED
61
     #if HAS_WHITE_LED
58
       , uint8_t w=0
62
       , uint8_t w=0
68
       #endif
72
       #endif
69
     #endif
73
     #endif
70
   {}
74
   {}
75
+
71
   LEDColor(const uint8_t (&rgbw)[4]) : r(rgbw[0]), g(rgbw[1]), b(rgbw[2])
76
   LEDColor(const uint8_t (&rgbw)[4]) : r(rgbw[0]), g(rgbw[1]), b(rgbw[2])
72
     #if HAS_WHITE_LED
77
     #if HAS_WHITE_LED
73
       , w(rgbw[3])
78
       , w(rgbw[3])
76
       #endif
81
       #endif
77
     #endif
82
     #endif
78
   {}
83
   {}
84
+
79
   LEDColor& operator=(const uint8_t (&rgbw)[4]) {
85
   LEDColor& operator=(const uint8_t (&rgbw)[4]) {
80
     r = rgbw[0]; g = rgbw[1]; b = rgbw[2];
86
     r = rgbw[0]; g = rgbw[1]; b = rgbw[2];
81
     #if HAS_WHITE_LED
87
     #if HAS_WHITE_LED
83
     #endif
89
     #endif
84
     return *this;
90
     return *this;
85
   }
91
   }
92
+
86
   LEDColor& operator=(const LEDColor &right) {
93
   LEDColor& operator=(const LEDColor &right) {
87
     if (this != &right) memcpy(this, &right, sizeof(LEDColor));
94
     if (this != &right) memcpy(this, &right, sizeof(LEDColor));
88
     return *this;
95
     return *this;
89
   }
96
   }
97
+
90
   bool operator==(const LEDColor &right) {
98
   bool operator==(const LEDColor &right) {
91
     if (this == &right) return true;
99
     if (this == &right) return true;
92
     return 0 == memcmp(this, &right, sizeof(LEDColor));
100
     return 0 == memcmp(this, &right, sizeof(LEDColor));
93
   }
101
   }
102
+
94
   bool operator!=(const LEDColor &right) { return !operator==(right); }
103
   bool operator!=(const LEDColor &right) { return !operator==(right); }
104
+
95
   bool is_off() const {
105
   bool is_off() const {
96
     return 3 > r + g + b
106
     return 3 > r + g + b
97
       #if HAS_WHITE_LED
107
       #if HAS_WHITE_LED

正在加载...
取消
保存