Begin implementing the HID LampArray protocol for Arduino test device

This commit is contained in:
Adam Honse
2024-05-06 19:00:41 -05:00
parent 4f59845e65
commit 0be978eae1
5 changed files with 203 additions and 25 deletions

View File

@@ -1,21 +1,32 @@
/*---------------------------------------------------------*\
| RGBController_HIDLampArray.cpp |
| |
| RGBController for HID LampArray Devices |
| |
| Adam Honse (calcprogrammer1@gmail.com) 26 Mar 2024 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-only |
\*---------------------------------------------------------*/
#include "RGBController_HIDLampArray.h"
RGBController_HIDLampArray::RGBController_HIDLampArray(HIDLampArrayController* controller_ptr)
{
controller = controller_ptr;
controller = controller_ptr;
name = "HID LampArray Device";
vendor = "Generic";
type = DEVICE_TYPE_MOUSEMAT;
description = "HID LampArray Device";
location = controller->GetDeviceLocation();
serial = controller->GetSerialString();
name = "HID LampArray Device";
vendor = "Generic";
type = DEVICE_TYPE_MOUSEMAT;
description = "HID LampArray Device";
location = controller->GetDeviceLocation();
serial = controller->GetSerialString();
mode Direct;
Direct.name = "Direct";
Direct.value = 0;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
Direct.name = "Direct";
Direct.value = 0;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
SetupZones();
@@ -28,7 +39,23 @@ RGBController_HIDLampArray::~RGBController_HIDLampArray()
void RGBController_HIDLampArray::SetupZones()
{
zone new_zone;
new_zone.name = "Test Zone";
new_zone.type = ZONE_TYPE_SINGLE;
new_zone.leds_count = controller->GetLampCount();
new_zone.leds_min = new_zone.leds_count;
new_zone.leds_max = new_zone.leds_count;
new_zone.matrix_map = NULL;
zones.push_back(new_zone);
for(unsigned int led_idx = 0; led_idx < new_zone.leds_count; led_idx++)
{
led new_led;
new_led.name = "Test LED";
leds.push_back(new_led);
}
SetupColors();
}
void RGBController_HIDLampArray::ResizeZone(int /*zone*/, int /*new_size*/)