From aac70462c5eadc2328ae0645c9215bcf7b4b8571 Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Mon, 3 Jun 2024 11:30:50 -0500 Subject: [PATCH] Update OKS keyboard controller files to new standardized header comment --- .../OKSController/OKSKeyboardController.cpp | 18 ++++---- .../OKSController/OKSKeyboardController.h | 42 +++++++++---------- .../OKSKeyboardControllerDetect.cpp | 15 ++++++- .../RGBController_OKSKeyboard.cpp | 18 ++++---- .../OKSController/RGBController_OKSKeyboard.h | 21 ++++++---- 5 files changed, 66 insertions(+), 48 deletions(-) diff --git a/Controllers/OKSController/OKSKeyboardController.cpp b/Controllers/OKSController/OKSKeyboardController.cpp index f5819bb2..f52d0370 100644 --- a/Controllers/OKSController/OKSKeyboardController.cpp +++ b/Controllers/OKSController/OKSKeyboardController.cpp @@ -1,11 +1,13 @@ -/*-----------------------------------------*\ -| OKSKeyboardController.cpp | -| | -| Driver for OKS RGB keyboardlighting | -| controller | -| | -| Merafour (OKS) 2/24/2023 | -\*-----------------------------------------*/ +/*---------------------------------------------------------*\ +| OKSKeyboardController.cpp | +| | +| Driver for OKS keyboard | +| | +| Merafour (OKS) 24 Feb 2023 | +| | +| This file is part of the OpenRGB project | +| SPDX-License-Identifier: GPL-2.0-only | +\*---------------------------------------------------------*/ #include #include "OKSKeyboardController.h" diff --git a/Controllers/OKSController/OKSKeyboardController.h b/Controllers/OKSController/OKSKeyboardController.h index b701790b..7a47c3fe 100644 --- a/Controllers/OKSController/OKSKeyboardController.h +++ b/Controllers/OKSController/OKSKeyboardController.h @@ -1,37 +1,38 @@ -/*-----------------------------------------*\ -| OKSKeyboardController.h | -| | -| Definitions and types for OKS RGB | -| keyboard lighting controller | -| | -| Merafour (OKS) 2/24/2023 | -\*-----------------------------------------*/ +/*---------------------------------------------------------*\ +| OKSKeyboardController.h | +| | +| Driver for OKS keyboard | +| | +| Merafour (OKS) 24 Feb 2023 | +| | +| This file is part of the OpenRGB project | +| SPDX-License-Identifier: GPL-2.0-only | +\*---------------------------------------------------------*/ -#include "RGBController.h" +#pragma once #include #include #include - -#pragma once +#include "RGBController.h" /*-----------------------------------------------------*\ -| OKS vendor ID | +| OKS vendor ID | \*-----------------------------------------------------*/ -#define OKS_VID 0x1C4F +#define OKS_VID 0x1C4F /*-----------------------------------------------------*\ | Keyboard product IDs | \*-----------------------------------------------------*/ -#define OKS_OPTICAL_RGB_PID 0xEE88 +#define OKS_OPTICAL_RGB_PID 0xEE88 /*-----------------------------------------------------*\ -| communication protocol | +| Communication protocol | \*-----------------------------------------------------*/ -#define KB2_PACK_HEAD (0x5C&0xFF) -#define KB2_HEAD_SIZE 4 -#define KB2_PORT_SIZE (64*4) -#define KB2_DATA_SIZE (KB2_PORT_SIZE-KB2_HEAD_SIZE) +#define KB2_PACK_HEAD (0x5C&0xFF) +#define KB2_HEAD_SIZE 4 +#define KB2_PORT_SIZE (64*4) +#define KB2_DATA_SIZE (KB2_PORT_SIZE-KB2_HEAD_SIZE) union kb2_port_t { uint8_t bin[KB2_PORT_SIZE]; @@ -72,11 +73,10 @@ public: std::string GetDeviceLocation(); std::string GetSerialString(); unsigned short GetUSBPID(); - + void SendColors(unsigned char* color_data, unsigned int color_data_size); void SendKeyboardModeEx(const mode &m, unsigned char red, unsigned char green, unsigned char blue); - private: hid_device* dev; std::string location; diff --git a/Controllers/OKSController/OKSKeyboardControllerDetect.cpp b/Controllers/OKSController/OKSKeyboardControllerDetect.cpp index c5870bfd..e4edebff 100644 --- a/Controllers/OKSController/OKSKeyboardControllerDetect.cpp +++ b/Controllers/OKSController/OKSKeyboardControllerDetect.cpp @@ -1,10 +1,21 @@ +/*---------------------------------------------------------*\ +| OKSKeyboardControllerDetect.cpp | +| | +| Detector for OKS keyboard | +| | +| Merafour (OKS) 24 Feb 2023 | +| | +| This file is part of the OpenRGB project | +| SPDX-License-Identifier: GPL-2.0-only | +\*---------------------------------------------------------*/ + +#include #include "Detector.h" #include "OKSKeyboardController.h" #include "RGBController.h" #include "RGBController_OKSKeyboard.h" -#include + /******************************************************************************************\ -* * * DetectOKSKeyboardControllers * * Reference: DuckyKeyboardController * * Tests the USB address to see if a OKS Optical Axis RGB Keyboard controller exists there.* diff --git a/Controllers/OKSController/RGBController_OKSKeyboard.cpp b/Controllers/OKSController/RGBController_OKSKeyboard.cpp index 844b894a..06149aaf 100644 --- a/Controllers/OKSController/RGBController_OKSKeyboard.cpp +++ b/Controllers/OKSController/RGBController_OKSKeyboard.cpp @@ -1,11 +1,13 @@ -/*-----------------------------------------*\ -| RGBController_OKSKeyboard.cpp | -| | -| Generic RGB Interface for OKS RGB | -| keyboard devices | -| | -| Merafour (OKS) 2/24/2023 | -\*-----------------------------------------*/ +/*---------------------------------------------------------*\ +| RGBController_OKSKeyboard.cpp | +| | +| RGBController for OKS keyboard | +| | +| Merafour (OKS) 24 Feb 2023 | +| | +| This file is part of the OpenRGB project | +| SPDX-License-Identifier: GPL-2.0-only | +\*---------------------------------------------------------*/ #include "RGBControllerKeyNames.h" #include "RGBController_OKSKeyboard.h" diff --git a/Controllers/OKSController/RGBController_OKSKeyboard.h b/Controllers/OKSController/RGBController_OKSKeyboard.h index 71560c0a..84b25881 100644 --- a/Controllers/OKSController/RGBController_OKSKeyboard.h +++ b/Controllers/OKSController/RGBController_OKSKeyboard.h @@ -1,13 +1,16 @@ -/*-----------------------------------------*\ -| RGBController_OKSKeyboard.h | -| | -| Generic RGB Interface for OKS RGB | -| keyboard devices | -| | -| Merafour (OKS) 2/24/2023 | -\*-----------------------------------------*/ +/*---------------------------------------------------------*\ +| RGBController_OKSKeyboard.h | +| | +| RGBController for OKS keyboard | +| | +| Merafour (OKS) 24 Feb 2023 | +| | +| This file is part of the OpenRGB project | +| SPDX-License-Identifier: GPL-2.0-only | +\*---------------------------------------------------------*/ #pragma once + #include "RGBController.h" #include "OKSKeyboardController.h" @@ -58,7 +61,7 @@ public: void SetupZones(); void ResizeZone(int zone, int new_size); - + void DeviceUpdateLEDs(); void UpdateZoneLEDs(int zone); void UpdateSingleLED(int led);