From 24c39e4dc8971f12bcd5864a80a3a4d9215328a4 Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Mon, 2 Feb 2026 20:03:43 -0600 Subject: [PATCH] Add autonomous mode as a selectable mode --- .../HIDLampArrayController.cpp | 2 -- .../HIDLampArrayController.h | 2 +- .../RGBController_HIDLampArray.cpp | 16 +++++++++++++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Controllers/HIDLampArrayController/HIDLampArrayController.cpp b/Controllers/HIDLampArrayController/HIDLampArrayController.cpp index d2a100724..8e595f660 100644 --- a/Controllers/HIDLampArrayController/HIDLampArrayController.cpp +++ b/Controllers/HIDLampArrayController/HIDLampArrayController.cpp @@ -160,8 +160,6 @@ HIDLampArrayController::HIDLampArrayController(hid_device *dev_handle, const cha { GetLampAttributesResponseReport(); } - - SetLampArrayControlReport(false); } HIDLampArrayController::~HIDLampArrayController() diff --git a/Controllers/HIDLampArrayController/HIDLampArrayController.h b/Controllers/HIDLampArrayController/HIDLampArrayController.h index 49f2d74c8..2adda02bc 100644 --- a/Controllers/HIDLampArrayController/HIDLampArrayController.h +++ b/Controllers/HIDLampArrayController/HIDLampArrayController.h @@ -121,6 +121,7 @@ public: unsigned int GetLampCount(); std::vector GetLamps(); + void SetLampArrayControlReport(unsigned char AutonomousMode); void SetLampMultiUpdateReport(unsigned char LampCount, unsigned char LampUpdateFlags, unsigned short * LampIds, LampArrayColor * UpdateColors); private: @@ -140,6 +141,5 @@ private: void GetLampArrayAttributesReport(); void GetLampAttributesResponseReport(); - void SetLampArrayControlReport(unsigned char AutonomousMode); void SetLampAttributesRequestReport(unsigned short LampId); }; diff --git a/Controllers/HIDLampArrayController/RGBController_HIDLampArray.cpp b/Controllers/HIDLampArrayController/RGBController_HIDLampArray.cpp index 631f22bae..622b99b93 100644 --- a/Controllers/HIDLampArrayController/RGBController_HIDLampArray.cpp +++ b/Controllers/HIDLampArrayController/RGBController_HIDLampArray.cpp @@ -71,6 +71,13 @@ RGBController_HIDLampArray::RGBController_HIDLampArray(HIDLampArrayController* c Direct.color_mode = MODE_COLORS_PER_LED; modes.push_back(Direct); + mode Autonomous; + Autonomous.name = "Autonomous"; + Autonomous.value = 1; + Autonomous.flags = 0; + Autonomous.color_mode = MODE_COLORS_NONE; + modes.push_back(Autonomous); + SetupZones(); } @@ -411,5 +418,12 @@ void RGBController_HIDLampArray::DeviceUpdateSingleLED(int /*led*/) void RGBController_HIDLampArray::DeviceUpdateMode() { - + if(modes[active_mode].value == 0) + { + controller->SetLampArrayControlReport(false); + } + else + { + controller->SetLampArrayControlReport(true); + } }