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 6473a22e89
commit 31e02655f2

View File

@@ -48,6 +48,7 @@ void HYTEMousematController::FirmwareAnimationControl(bool enabled)
void HYTEMousematController::StreamingCommand(RGBColor* colors)
{
unsigned char serial_buf[157];
unsigned int max_brightness = 72;
memset(serial_buf, 0, sizeof(serial_buf));
@@ -61,9 +62,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;
}
serialport->serial_write((char *)serial_buf, sizeof(serial_buf));