Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
François Revol
firmware
Commits
ddebc93c
Commit
ddebc93c
authored
Aug 20, 2019
by
trilader
Browse files
feat(epicardium): Add API function to clear all LEDs to a single color
parent
3e886c50
Changes
2
Hide whitespace changes
Inline
Side-by-side
epicardium/epicardium.h
View file @
ddebc93c
...
...
@@ -84,6 +84,7 @@ typedef _Bool bool;
#define API_LEDS_SET_ALL 0x6a
#define API_LEDS_SET_ALL_HSV 0x6b
#define API_LEDS_SET_GAMMA_TABLE 0x6c
#define API_LEDS_CLEAR_ALL 0x6d
#define API_VIBRA_SET 0x70
#define API_VIBRA_VIBRATE 0x71
...
...
@@ -648,6 +649,15 @@ API(API_LEDS_SET_GAMMA_TABLE, void epic_leds_set_gamma_table(
uint8_t
*
gamma_table
));
/**
* Set all LEDs to a certain RGB color.
*
* :param uint8_t r: Value for the red color channel.
* :param uint8_t g: Value for the green color channel.
* :param uint8_t b: Value for the blue color channel.
*/
API
(
API_LEDS_CLEAR_ALL
,
void
epic_leds_clear_all
(
uint8_t
r
,
uint8_t
g
,
uint8_t
b
));
/**
* Sensor Data Streams
* ===================
...
...
epicardium/modules/leds.c
View file @
ddebc93c
...
...
@@ -87,3 +87,16 @@ void epic_leds_set_gamma_table(uint8_t rgb_channel, uint8_t gamma_table[256])
{
leds_set_gamma_table
(
rgb_channel
,
gamma_table
);
}
void
epic_leds_clear_all
(
uint8_t
r
,
uint8_t
g
,
uint8_t
b
)
{
for
(
int
i
=
0
;
i
<
NUM_LEDS
;
i
++
)
{
if
(
i
==
PERSONAL_STATE_LED
&&
personal_state_enabled
)
continue
;
leds_prep
(
i
,
r
,
g
,
b
);
}
leds_update_power
();
leds_update
();
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment