Fix warning in LogitechProtocolCommon.h

This commit is contained in:
Adam Honse
2022-09-23 16:59:24 -05:00
parent 89a6abd9ed
commit f5ddbed890
3 changed files with 14 additions and 8 deletions

View File

@@ -9,6 +9,17 @@
#include <LogitechProtocolCommon.h>
const char* logitech_led_locations[] =
{
"Unknown",
"Primary",
"Logo",
"Left",
"Right"
};
const int NUM_LOGITECH_LED_LOCATIONS = sizeof(logitech_led_locations);
static std::vector<uint16_t> logitech_RGB_pages =
{
LOGITECH_HIDPP_PAGE_RGB_EFFECTS1,

View File

@@ -77,13 +77,8 @@ enum LOGITECH_DEVICE_MODE
LOGITECH_DEVICE_LED_CUSTOM = 0x000C
};
static const char* logitech_led_locations[] = {
"Unknown",
"Primary",
"Logo",
"Left",
"Right"
};
extern const char* logitech_led_locations[];
extern const int NUM_LOGITECH_LED_LOCATIONS;
// Used for: {GET,SET}_REGISTER_{REQ,RSP}, SET_LONG_REGISTER_RSP, GET_LONG_REGISTER_REQ
struct message_short

View File

@@ -139,7 +139,7 @@ void RGBController_LogitechLightspeed::SetupZones()
led Lightspeed_logo_led;
logitech_led new_led = controller->lightspeed->getLED_info(i);
if(new_led.location < sizeof(logitech_led_locations) )
if(new_led.location < NUM_LOGITECH_LED_LOCATIONS )
{
Lightspeed_logo_zone.name = logitech_led_locations[new_led.location];
Lightspeed_logo_zone.name.append(" ");