Skip to content

Commit e2c3e6c

Browse files
committed
Add preprocessor macro. Comments.
1 parent d89172c commit e2c3e6c

File tree

2 files changed

+45
-35
lines changed

2 files changed

+45
-35
lines changed

src/bin/daemon/logitechG510.cpp

Lines changed: 40 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* This file is part of GLogiK project.
44
* GLogiK, daemon to handle special features on gaming keyboards
5-
* Copyright (C) 2016-2020 Fabrice Delliaux <[email protected]>
5+
* Copyright (C) 2016-2021 Fabrice Delliaux <[email protected]>
66
*
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by
@@ -89,36 +89,45 @@ const std::vector<MKeyLed> G510Base::ledsMask = {
8989
};
9090

9191
const std::vector<USBDeviceID> G510Base::knownDevices = {
92-
{ "Logitech", /* vendor */
93-
"G510s", /* model */
94-
"Gaming Keyboard", /* product name */
95-
VENDOR_ID_LOGITECH,
96-
"c22d",
97-
toEnumType( Caps::GK_BACKLIGHT_COLOR |
98-
Caps::GK_MACROS_KEYS |
99-
Caps::GK_MEDIA_KEYS |
100-
Caps::GK_LCD_SCREEN ),
101-
1, 1, 0, 2,
102-
8, // expected libusb keys interrupt read max length
103-
5, // MacrosKeys transfer length
104-
2, // MediaKeys transfer length
105-
5 // LCDKeys transfer length
106-
},
107-
{ "Logitech", /* vendor */
108-
"G510s", /* model */
109-
"Gaming Keyboard", /* product name */
110-
VENDOR_ID_LOGITECH,
111-
"c22e", /* with onboard audio enabled */
112-
toEnumType( Caps::GK_BACKLIGHT_COLOR |
113-
Caps::GK_MACROS_KEYS |
114-
Caps::GK_MEDIA_KEYS |
115-
Caps::GK_LCD_SCREEN ),
116-
1, 1, 0, 2,
117-
8, // expected libusb keys interrupt read max length
118-
5, // MacrosKeys transfer length
119-
2, // MediaKeys transfer length
120-
5 // LCDKeys transfer length
121-
},
92+
/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */
93+
{
94+
/* vendor */ VENDOR_LOGITECH,
95+
/* model */ "G510s",
96+
/* product name */ "Gaming Keyboard",
97+
/* vendor ID */ VENDOR_ID_LOGITECH,
98+
/* product ID */ "c22d",
99+
/* capabilities */ toEnumType(
100+
Caps::GK_BACKLIGHT_COLOR |
101+
Caps::GK_MACROS_KEYS |
102+
Caps::GK_MEDIA_KEYS |
103+
Caps::GK_LCD_SCREEN
104+
),
105+
1, 1, 0, 2,
106+
/* (libusb) interrupt read max length */ 8,
107+
/* MacrosKeys transfer length */ 5,
108+
/* MediaKeys transfer length */ 2,
109+
/* LCDKeys transfer length */ 5
110+
},
111+
/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */
112+
{
113+
/* vendor */ VENDOR_LOGITECH,
114+
/* model */ "G510s",
115+
/* product name */ "Gaming Keyboard",
116+
/* vendor ID */ VENDOR_ID_LOGITECH,
117+
/* (onboard audio) product ID */ "c22e",
118+
/* capabilities */ toEnumType(
119+
Caps::GK_BACKLIGHT_COLOR |
120+
Caps::GK_MACROS_KEYS |
121+
Caps::GK_MEDIA_KEYS |
122+
Caps::GK_LCD_SCREEN
123+
),
124+
1, 1, 0, 2,
125+
/* (libusb) interrupt read max length */ 8,
126+
/* MacrosKeys transfer length */ 5,
127+
/* MediaKeys transfer length */ 2,
128+
/* LCDKeys transfer length */ 5
129+
},
130+
/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */
122131
};
123132

124133
const char* G510Base::getDriverName() const {

src/bin/daemon/logitechG510.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* This file is part of GLogiK project.
44
* GLogiK, daemon to handle special features on gaming keyboards
5-
* Copyright (C) 2016-2020 Fabrice Delliaux <[email protected]>
5+
* Copyright (C) 2016-2021 Fabrice Delliaux <[email protected]>
66
*
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by
@@ -22,8 +22,6 @@
2222
#ifndef SRC_BIN_DAEMON_LOGITECH_G510_DRIVER_HPP_
2323
#define SRC_BIN_DAEMON_LOGITECH_G510_DRIVER_HPP_
2424

25-
#define GLOGIKD_DRIVER_ID_G510 ( 1 << 0 )
26-
2725
#include <cstdint>
2826

2927
#include <vector>
@@ -41,7 +39,10 @@
4139
namespace GLogiK
4240
{
4341

44-
#define VENDOR_ID_LOGITECH "046d"
42+
#define GLOGIKD_DRIVER_ID_G510 ( 1 << 0 )
43+
44+
#define VENDOR_LOGITECH "Logitech"
45+
#define VENDOR_ID_LOGITECH "046d"
4546

4647
/* RKey - Recognized Keys */
4748
struct RKey

0 commit comments

Comments
 (0)