From d8f3baf8e8df0fd5c53177dfc690fed46a41458e Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Thu, 16 May 2024 11:33:12 -0500 Subject: [PATCH] Update Dygma Raise controller files to new standardized header comment --- .../DygmaRaiseController.cpp | 35 ++++++++++--------- .../DygmaRaiseController.h | 24 +++++++------ .../DygmaRaiseControllerDetect.cpp | 12 ++++++- .../RGBController_DygmaRaise.cpp | 19 +++++----- .../RGBController_DygmaRaise.h | 18 ++++++---- 5 files changed, 64 insertions(+), 44 deletions(-) diff --git a/Controllers/DygmaRaiseController/DygmaRaiseController.cpp b/Controllers/DygmaRaiseController/DygmaRaiseController.cpp index 38292801..46a2a9b5 100644 --- a/Controllers/DygmaRaiseController/DygmaRaiseController.cpp +++ b/Controllers/DygmaRaiseController/DygmaRaiseController.cpp @@ -1,10 +1,13 @@ -/*-----------------------------------------*\ -| DygmaRaiseController.cpp | -| | -| Driver for Dygma Raise keyboard | -| | -| Timo Schlegel (@eispalast) 12/12/2021 | -\*-----------------------------------------*/ +/*---------------------------------------------------------*\ +| DygmaRaiseController.cpp | +| | +| Driver for Dygma Raise keyboard | +| | +| Timo Schlegel (@eispalast) Dec 12 2021 | +| | +| This file is part of the OpenRGB project | +| SPDX-License-Identifier: GPL-2.0-only | +\*---------------------------------------------------------*/ #include "DygmaRaiseController.h" @@ -27,13 +30,13 @@ static int val_char_len(int number) } } -DygmaRaiseController::DygmaRaiseController() +DygmaRaiseController::DygmaRaiseController() { - + } -DygmaRaiseController::~DygmaRaiseController() -{ +DygmaRaiseController::~DygmaRaiseController() +{ serialport->serial_close(); delete serialport; } @@ -41,17 +44,17 @@ DygmaRaiseController::~DygmaRaiseController() void DygmaRaiseController::Initialize(char* port) { port_name = port; - + serialport = new serial_port(port_name.c_str(), DYGMA_RAISE_BAUD); } -std::string DygmaRaiseController::GetDeviceLocation() +std::string DygmaRaiseController::GetDeviceLocation() { return("COM: " + port_name); } void DygmaRaiseController::SendDirect(std::vectorcolors, size_t led_num) -{ +{ char serial_buf[MAX_LEN]; /*-----------------------------------------------------*\ @@ -76,7 +79,7 @@ void DygmaRaiseController::SendDirect(std::vectorcolors, size_t led_nu sprintf(serial_buf+actual_length," %d",r); actual_length += val_char_len(r) + 1; - + sprintf(serial_buf+actual_length," %d",g); actual_length += val_char_len(g) + 1; @@ -88,7 +91,7 @@ void DygmaRaiseController::SendDirect(std::vectorcolors, size_t led_nu | Add the final newline | \*-----------------------------------------------------*/ sprintf(serial_buf+actual_length,"\n"); - actual_length++; + actual_length++; /*-----------------------------------------------------*\ | Send packet | diff --git a/Controllers/DygmaRaiseController/DygmaRaiseController.h b/Controllers/DygmaRaiseController/DygmaRaiseController.h index d0348cea..1fcea40d 100644 --- a/Controllers/DygmaRaiseController/DygmaRaiseController.h +++ b/Controllers/DygmaRaiseController/DygmaRaiseController.h @@ -1,19 +1,21 @@ -/*-----------------------------------------*\ -| DygmaRaiseController.h | -| | -| Driver for Dygma Raise keyboard | -| | -| Timo Schlegel (@eispalast) 12/12/2021 | -\*-----------------------------------------*/ +/*---------------------------------------------------------*\ +| DygmaRaiseController.h | +| | +| Driver for Dygma Raise keyboard | +| | +| Timo Schlegel (@eispalast) Dec 12 2021 | +| | +| This file is part of the OpenRGB project | +| SPDX-License-Identifier: GPL-2.0-only | +\*---------------------------------------------------------*/ #pragma once -#include "RGBController.h" + #include #include +#include "RGBController.h" #include "serial_port.h" -#pragma once - #define DYGMA_RAISE_VID 0x1209 #define DYGMA_RAISE_PID 0x2201 @@ -33,4 +35,4 @@ private: std::string location; std::string port_name; serial_port * serialport = nullptr; -}; \ No newline at end of file +}; diff --git a/Controllers/DygmaRaiseController/DygmaRaiseControllerDetect.cpp b/Controllers/DygmaRaiseController/DygmaRaiseControllerDetect.cpp index 33f4b1c8..6ea320fc 100644 --- a/Controllers/DygmaRaiseController/DygmaRaiseControllerDetect.cpp +++ b/Controllers/DygmaRaiseController/DygmaRaiseControllerDetect.cpp @@ -1,3 +1,14 @@ +/*---------------------------------------------------------*\ +| DygmaRaiseControllerDetect.cpp | +| | +| Detector for Dygma Raise keyboard | +| | +| Timo Schlegel (@eispalast) Dec 12 2021 | +| | +| This file is part of the OpenRGB project | +| SPDX-License-Identifier: GPL-2.0-only | +\*---------------------------------------------------------*/ + #include "Detector.h" #include "DygmaRaiseController.h" #include "RGBController.h" @@ -6,7 +17,6 @@ #include #include - #define DYGMA_RAISE_VID 0x1209 #define DYGMA_RAISE_PID 0x2201 diff --git a/Controllers/DygmaRaiseController/RGBController_DygmaRaise.cpp b/Controllers/DygmaRaiseController/RGBController_DygmaRaise.cpp index a39117d9..30510dd4 100644 --- a/Controllers/DygmaRaiseController/RGBController_DygmaRaise.cpp +++ b/Controllers/DygmaRaiseController/RGBController_DygmaRaise.cpp @@ -1,10 +1,13 @@ -/*-----------------------------------------*\ -| RGBController_DygmaRaise.cpp | -| | -| RGB Interface DygmaRaise keyboard | -| | -| Timo Schlegel (@eispalast) 12/12/2021 | -\*-----------------------------------------*/ +/*---------------------------------------------------------*\ +| RGBController_DygmaRaise.cpp | +| | +| RGBController for Dygma Raise keyboard | +| | +| Timo Schlegel (@eispalast) Dec 12 2021 | +| | +| This file is part of the OpenRGB project | +| SPDX-License-Identifier: GPL-2.0-only | +\*---------------------------------------------------------*/ #include "RGBControllerKeyNames.h" #include "RGBController_DygmaRaise.h" @@ -34,7 +37,6 @@ static unsigned int underglow_matrix[11][14] = { 23, NA, NA, NA, NA, 16, NA, 47, NA, NA, NA, NA, NA, 55 }, { 22, 21, 20, 19, 18, 17, NA, 48, 49, 50, 51, 52, 53, 54, } }; - static const char* zone_names[] = { ZONE_EN_KEYBOARD, @@ -234,7 +236,6 @@ void RGBController_DygmaRaise::ResizeZone(int /*zone*/, int /*new_size*/) \*---------------------------------------------------------*/ } - void RGBController_DygmaRaise::DeviceUpdateLEDs() { controller->SendDirect(colors,leds.size()); diff --git a/Controllers/DygmaRaiseController/RGBController_DygmaRaise.h b/Controllers/DygmaRaiseController/RGBController_DygmaRaise.h index 7ef70107..08ca073f 100644 --- a/Controllers/DygmaRaiseController/RGBController_DygmaRaise.h +++ b/Controllers/DygmaRaiseController/RGBController_DygmaRaise.h @@ -1,12 +1,16 @@ -/*-----------------------------------------*\ -| RGBController_DygmaRaise.h | -| | -| RGB Interface for DygmaRaise keyboard | -| | -| Timo Schlegel (@eispalast) 12/12/2021 | -\*-----------------------------------------*/ +/*---------------------------------------------------------*\ +| RGBController_DygmaRaise.h | +| | +| RGBController for Dygma Raise keyboard | +| | +| Timo Schlegel (@eispalast) Dec 12 2021 | +| | +| This file is part of the OpenRGB project | +| SPDX-License-Identifier: GPL-2.0-only | +\*---------------------------------------------------------*/ #pragma once + #include "RGBController.h" #include "DygmaRaiseController.h"