feat(color): show switch colors for customisable switches on diagnostic page (#6124)
This commit is contained in:
@@ -57,3 +57,8 @@ uint32_t rgbGetLedColor(uint8_t led)
|
||||
uint8_t* pixel = &_led_colors[led * WS2812_BYTES_PER_LED];
|
||||
return (pixel[1] << 16) + (pixel[0] << 8) + pixel[2];
|
||||
}
|
||||
|
||||
uint32_t fsGetLedRGB(uint8_t index)
|
||||
{
|
||||
return rgbGetLedColor(index);
|
||||
}
|
||||
|
||||
@@ -65,10 +65,15 @@ uint8_t ledMapping[] = {12, 14, 16, 18, 20, 22};
|
||||
|
||||
void fsLedRGB(uint8_t index, uint32_t color)
|
||||
{
|
||||
rgbSetLedColor(ledMapping[index], GET_RED(color), \
|
||||
GET_GREEN(color),GET_BLUE(color));
|
||||
rgbSetLedColor(ledMapping[index]+1, GET_RED(color), \
|
||||
GET_GREEN(color),GET_BLUE(color));
|
||||
rgbSetLedColor(ledMapping[index], GET_RED(color), \
|
||||
GET_GREEN(color),GET_BLUE(color));
|
||||
rgbSetLedColor(ledMapping[index]+1, GET_RED(color), \
|
||||
GET_GREEN(color),GET_BLUE(color));
|
||||
}
|
||||
|
||||
uint32_t fsGetLedRGB(uint8_t index)
|
||||
{
|
||||
return rgbGetLedColor(ledMapping[index]);
|
||||
}
|
||||
|
||||
uint8_t getRGBColorIndex(uint32_t color)
|
||||
|
||||
@@ -69,6 +69,11 @@ void fsLedRGB(uint8_t index, uint32_t color)
|
||||
GET_BLUE(color));
|
||||
}
|
||||
|
||||
uint32_t fsGetLedRGB(uint8_t index)
|
||||
{
|
||||
return rgbGetLedColor(ledMapping[index]);
|
||||
}
|
||||
|
||||
uint8_t getRGBColorIndex(uint32_t color)
|
||||
{
|
||||
for (uint8_t i = 0; i < DIM(colorTable); i++) {
|
||||
|
||||
Reference in New Issue
Block a user