From 1b7cff78eb1e4d21d75523ef208277ed07d43fdb Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Thu, 5 Oct 2023 19:24:40 -0500 Subject: [PATCH] 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 --- .../HYTEMousematController/HYTEMousematController.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Controllers/HYTEMousematController/HYTEMousematController.cpp b/Controllers/HYTEMousematController/HYTEMousematController.cpp index 96406a5d..f9d302bb 100644 --- a/Controllers/HYTEMousematController/HYTEMousematController.cpp +++ b/Controllers/HYTEMousematController/HYTEMousematController.cpp @@ -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; } /*-----------------------------------------------------*\