Formatting and organizational cleanup for controllers through CoolerMasterController

This commit is contained in:
Adam Honse
2024-05-01 00:13:41 -05:00
parent b6d5c64c5b
commit 9c2d30bbbd
56 changed files with 606 additions and 591 deletions

View File

@@ -7,9 +7,8 @@
| Sebastian Kraus 12/25/2021 |
\*-----------------------------------------*/
#include "CherryKeyboardController.h"
#include <cstring>
#include "CherryKeyboardController.h"
CherryKeyboardController::CherryKeyboardController(hid_device* dev_handle, const char* path)
{
@@ -62,7 +61,7 @@ void CherryKeyboardController::SetKeyboardColors
{
packet_size = size;
}
SendKeyboardData
(
&color_data[packet_offset],
@@ -148,7 +147,7 @@ void CherryKeyboardController::SendKeyboardBegin()
usb_buf[0x01] = CHERRY_KB_COMMAND_BEGIN;
usb_buf[0x02] = 0x00;
usb_buf[0x03] = CHERRY_KB_COMMAND_BEGIN;
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
@@ -174,7 +173,7 @@ void CherryKeyboardController::SendKeyboardEnd()
usb_buf[0x01] = CHERRY_KB_COMMAND_END;
usb_buf[0x02] = 0x00;
usb_buf[0x03] = CHERRY_KB_COMMAND_END;
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
@@ -210,7 +209,7 @@ void CherryKeyboardController::SendKeyboardData
| Copy in data bytes |
\*-----------------------------------------------------*/
memcpy(&usb_buf[0x08], data, data_size);
/*-----------------------------------------------------*\
| Compute Checksum |
\*-----------------------------------------------------*/

View File

@@ -7,12 +7,11 @@
| Sebastian Kraus 12/25/2021 |
\*-----------------------------------------*/
#include "RGBController.h"
#pragma once
#include <string>
#include <hidapi/hidapi.h>
#pragma once
#include "RGBController.h"
#define CHERRY_KB_PACKET_SIZE 64
#define CHERRY_KB_MAX_PACKET_SIZE ( 0x36 )/* max packet size for color*/
@@ -85,7 +84,7 @@ enum
CHERRY_KB_MODE_RADIATION = 0x12,
CHERRY_KB_MODE_RIPPLES = 0x13,
CHERRY_KB_MODE_SINGLE_KEY = 0x15,
};
enum

View File

@@ -1,15 +1,15 @@
#include <vector>
#include <hidapi/hidapi.h>
#include "Detector.h"
#include "CherryKeyboardController.h"
#include "RGBController.h"
#include "RGBController_CherryKeyboard.h"
#include <vector>
#include <hidapi/hidapi.h>
/*-----------------------------------------------------*\
| Cherry keyboard VID and usage page |
\*-----------------------------------------------------*/
#define CHERRY_KEYBOARD_VID 0x046A
#define CHERRY_KEYBOARD_USAGE_PAGE 0xFF1C
#define CHERRY_KEYBOARD_VID 0x046A
#define CHERRY_KEYBOARD_USAGE_PAGE 0xFF1C
/******************************************************************************************\
* *

View File

@@ -8,6 +8,7 @@
\*-----------------------------------------*/
#pragma once
#include "RGBController.h"
#include "CherryKeyboardController.h"
@@ -20,7 +21,7 @@ public:
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);