Skip to content

Commit e42b3d7

Browse files
authored
Update builtinLED.h
1 parent c47a9e2 commit e42b3d7

File tree

1 file changed

+38
-38
lines changed

1 file changed

+38
-38
lines changed

examples/espidf-arduino-matter-light/main/builtinLED.h

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -14,61 +14,61 @@
1414

1515
#include <Arduino.h>
1616

17-
#define MAX_HUE 360
17+
#define MAX_HUE 360
1818
#define MAX_SATURATION 255
1919
#define MAX_BRIGHTNESS 255
20-
#define MAX_PROGRESS 256
20+
#define MAX_PROGRESS 256
2121

2222
typedef struct {
23-
union {
24-
struct {
25-
uint32_t v: 8; /*!< Brightness/Value of the LED. 0-255 */
26-
uint32_t s: 8; /*!< Saturation of the LED. 0-255 */
27-
uint32_t h: 9; /*!< Hue of the LED. 0-360 */
28-
};
29-
uint32_t value; /*!< IHSV value of the LED. */
23+
union {
24+
struct {
25+
uint32_t v : 8; /*!< Brightness/Value of the LED. 0-255 */
26+
uint32_t s : 8; /*!< Saturation of the LED. 0-255 */
27+
uint32_t h : 9; /*!< Hue of the LED. 0-360 */
3028
};
29+
uint32_t value; /*!< IHSV value of the LED. */
30+
};
3131
} led_indicator_color_hsv_t;
3232

3333
typedef struct {
34-
union {
35-
struct {
36-
uint32_t r: 8; /*!< Red component of the LED color. Range: 0-255. */
37-
uint32_t g: 8; /*!< Green component of the LED color. Range: 0-255. */
38-
uint32_t b: 8; /*!< Blue component of the LED color. Range: 0-255. */
39-
};
40-
uint32_t value; /*!< Combined RGB value of the LED color. */
34+
union {
35+
struct {
36+
uint32_t r : 8; /*!< Red component of the LED color. Range: 0-255. */
37+
uint32_t g : 8; /*!< Green component of the LED color. Range: 0-255. */
38+
uint32_t b : 8; /*!< Blue component of the LED color. Range: 0-255. */
4139
};
40+
uint32_t value; /*!< Combined RGB value of the LED color. */
41+
};
4242
} led_indicator_color_rgb_t;
4343

4444
class BuiltInLED {
4545
private:
46-
uint8_t pin_number;
47-
bool state;
48-
led_indicator_color_hsv_t hsv_color;
46+
uint8_t pin_number;
47+
bool state;
48+
led_indicator_color_hsv_t hsv_color;
4949

5050
public:
51-
BuiltInLED();
52-
~BuiltInLED();
51+
BuiltInLED();
52+
~BuiltInLED();
5353

54-
static led_indicator_color_hsv_t rgb2hsv(led_indicator_color_rgb_t rgb_value);
55-
static led_indicator_color_rgb_t hsv2rgb(led_indicator_color_hsv_t hsv);
54+
static led_indicator_color_hsv_t rgb2hsv(led_indicator_color_rgb_t rgb_value);
55+
static led_indicator_color_rgb_t hsv2rgb(led_indicator_color_hsv_t hsv);
5656

57-
void begin(uint8_t pin);
58-
void end();
57+
void begin(uint8_t pin);
58+
void end();
5959

60-
void on();
61-
void off();
62-
void toggle();
63-
bool getState();
60+
void on();
61+
void off();
62+
void toggle();
63+
bool getState();
6464

65-
bool write();
65+
bool write();
6666

67-
void setBrightness(uint8_t brightness);
68-
uint8_t getBrightness();
69-
void setHSV(led_indicator_color_hsv_t hsv);
70-
led_indicator_color_hsv_t getHSV();
71-
void setRGB(led_indicator_color_rgb_t color);
72-
led_indicator_color_rgb_t getRGB();
73-
void setTemperature(uint32_t temperature);
74-
};
67+
void setBrightness(uint8_t brightness);
68+
uint8_t getBrightness();
69+
void setHSV(led_indicator_color_hsv_t hsv);
70+
led_indicator_color_hsv_t getHSV();
71+
void setRGB(led_indicator_color_rgb_t color);
72+
led_indicator_color_rgb_t getRGB();
73+
void setTemperature(uint32_t temperature);
74+
};

0 commit comments

Comments
 (0)