Skip to content
Snippets Groups Projects
Commit ddebc93c authored by trilader's avatar trilader
Browse files

feat(epicardium): Add API function to clear all LEDs to a single color

parent 3e886c50
No related branches found
No related tags found
No related merge requests found
......@@ -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
* ===================
......
......@@ -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();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment