Limit HYTE CNVS brightness to 72% of maximum brightness according to V1.1 of protocol documentation. It could be reworked in the future to only limit brightness when the sum exceeds the value, but that would require significantly more math during update

This commit is contained in:
Adam Honse 2023-10-05 19:24:40 -05:00
parent 6e0358d6ea
commit 1b7cff78eb

View file

@ -63,6 +63,7 @@ void HYTEMousematController::FirmwareAnimationControl(bool enabled)
void HYTEMousematController::StreamingCommand(RGBColor* colors)
{
unsigned char serial_buf[157];
unsigned int max_brightness = 72;
/*-----------------------------------------------------*\
| Zero out buffer |
@ -85,9 +86,9 @@ void HYTEMousematController::StreamingCommand(RGBColor* colors)
\*-----------------------------------------------------*/
for(unsigned int color_idx = 0; color_idx < 50; color_idx++)
{
serial_buf[7 + (color_idx * 3)] = RGBGetGValue(colors[color_idx]);
serial_buf[8 + (color_idx * 3)] = RGBGetRValue(colors[color_idx]);
serial_buf[9 + (color_idx * 3)] = RGBGetBValue(colors[color_idx]);
serial_buf[7 + (color_idx * 3)] = ( max_brightness * RGBGetGValue(colors[color_idx]) ) / 100;
serial_buf[8 + (color_idx * 3)] = ( max_brightness * RGBGetRValue(colors[color_idx]) ) / 100;
serial_buf[9 + (color_idx * 3)] = ( max_brightness * RGBGetBValue(colors[color_idx]) ) / 100;
}
/*-----------------------------------------------------*\