Update Dygma Raise controller files to new standardized header comment

This commit is contained in:
Adam Honse 2024-05-16 11:33:12 -05:00
parent 4f870489ad
commit d8f3baf8e8
5 changed files with 64 additions and 44 deletions

View file

@ -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::vector<RGBColor>colors, size_t led_num)
{
{
char serial_buf[MAX_LEN];
/*-----------------------------------------------------*\
@ -76,7 +79,7 @@ void DygmaRaiseController::SendDirect(std::vector<RGBColor>colors, 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::vector<RGBColor>colors, size_t led_nu
| Add the final newline |
\*-----------------------------------------------------*/
sprintf(serial_buf+actual_length,"\n");
actual_length++;
actual_length++;
/*-----------------------------------------------------*\
| Send packet |

View file

@ -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 <string>
#include <vector>
#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;
};
};

View file

@ -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 <vector>
#include <stdio.h>
#define DYGMA_RAISE_VID 0x1209
#define DYGMA_RAISE_PID 0x2201

View file

@ -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());

View file

@ -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"