Fix even more warnings
This commit is contained in:
parent
06ca1448d1
commit
fb963f4ab2
22 changed files with 91 additions and 91 deletions
|
|
@ -301,7 +301,7 @@ void AlienwareAW410KController::SendDirectOn
|
|||
void AlienwareAW410KController::SetMode
|
||||
(
|
||||
unsigned char mode,
|
||||
unsigned short speed,
|
||||
unsigned char speed,
|
||||
unsigned char direction,
|
||||
unsigned char colorMode,
|
||||
unsigned char red,
|
||||
|
|
@ -365,7 +365,7 @@ void AlienwareAW410KController::SendMode
|
|||
(
|
||||
unsigned char /*zone*/,
|
||||
unsigned char mode,
|
||||
unsigned short speed,
|
||||
unsigned char speed,
|
||||
unsigned char direction,
|
||||
unsigned char colorMode,
|
||||
unsigned char red,
|
||||
|
|
@ -405,7 +405,7 @@ void AlienwareAW410KController::SendMode
|
|||
void AlienwareAW410KController::SetMorphMode
|
||||
(
|
||||
unsigned char mode,
|
||||
unsigned short speed,
|
||||
unsigned char speed,
|
||||
unsigned char red1,
|
||||
unsigned char green1,
|
||||
unsigned char blue1,
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ public:
|
|||
void SetMode
|
||||
(
|
||||
unsigned char mode,
|
||||
unsigned short speed,
|
||||
unsigned char speed,
|
||||
unsigned char direction,
|
||||
unsigned char colorMode,
|
||||
unsigned char red,
|
||||
|
|
@ -120,7 +120,7 @@ public:
|
|||
void SetMorphMode
|
||||
(
|
||||
unsigned char mode,
|
||||
unsigned short speed,
|
||||
unsigned char speed,
|
||||
unsigned char red1,
|
||||
unsigned char green1,
|
||||
unsigned char blue1,
|
||||
|
|
@ -145,7 +145,7 @@ private:
|
|||
(
|
||||
unsigned char zone,
|
||||
unsigned char mode,
|
||||
unsigned short speed,
|
||||
unsigned char speed,
|
||||
unsigned char direction,
|
||||
unsigned char colorMode,
|
||||
unsigned char red,
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ void AlienwareAW510KController::SendDirectOn
|
|||
std::vector<SelectedKeys> &frame_data
|
||||
)
|
||||
{
|
||||
SendfeatureReport(0x0E, frame_data.size(), 0x00, 0x01);
|
||||
SendfeatureReport(0x0E, (unsigned char)frame_data.size(), 0x00, 0x01);
|
||||
|
||||
/*-----------------------------------------------*\
|
||||
| To Guarantee the data are always %4 =0 append |
|
||||
|
|
@ -295,7 +295,7 @@ void AlienwareAW510KController::SendDirectOn
|
|||
void AlienwareAW510KController::SetMode
|
||||
(
|
||||
unsigned char mode,
|
||||
unsigned short speed,
|
||||
unsigned char speed,
|
||||
unsigned char direction,
|
||||
unsigned char colorMode,
|
||||
unsigned char red,
|
||||
|
|
@ -359,7 +359,7 @@ void AlienwareAW510KController::SendMode
|
|||
(
|
||||
unsigned char /*zone*/,
|
||||
unsigned char mode,
|
||||
unsigned short speed,
|
||||
unsigned char speed,
|
||||
unsigned char direction,
|
||||
unsigned char colorMode,
|
||||
unsigned char red,
|
||||
|
|
@ -399,7 +399,7 @@ void AlienwareAW510KController::SendMode
|
|||
void AlienwareAW510KController::SetMorphMode
|
||||
(
|
||||
unsigned char mode,
|
||||
unsigned short speed,
|
||||
unsigned char speed,
|
||||
unsigned char red1,
|
||||
unsigned char green1,
|
||||
unsigned char blue1,
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ public:
|
|||
void SetMode
|
||||
(
|
||||
unsigned char mode,
|
||||
unsigned short speed,
|
||||
unsigned char speed,
|
||||
unsigned char direction,
|
||||
unsigned char colorMode,
|
||||
unsigned char red,
|
||||
|
|
@ -121,7 +121,7 @@ public:
|
|||
void SetMorphMode
|
||||
(
|
||||
unsigned char mode,
|
||||
unsigned short speed,
|
||||
unsigned char speed,
|
||||
unsigned char red1,
|
||||
unsigned char green1,
|
||||
unsigned char blue1,
|
||||
|
|
@ -146,7 +146,7 @@ private:
|
|||
(
|
||||
unsigned char zone,
|
||||
unsigned char mode,
|
||||
unsigned short speed,
|
||||
unsigned char speed,
|
||||
unsigned char direction,
|
||||
unsigned char colorMode,
|
||||
unsigned char red,
|
||||
|
|
|
|||
|
|
@ -427,7 +427,7 @@ void AuraTUFKeyboardController::UpdateScopeIIRainbowRipple
|
|||
continue;
|
||||
}
|
||||
|
||||
usb_buf[5 + i * 4] = (100.0f / (float)colors.size() * (i + 1 + 6));
|
||||
usb_buf[5 + i * 4] = (unsigned char)(100.0f / (float)colors.size() * (i + 1 + 6));
|
||||
usb_buf[6 + i * 4] = RGBGetRValue(colors[i + 6]);
|
||||
usb_buf[7 + i * 4] = RGBGetGValue(colors[i + 6]);
|
||||
usb_buf[8 + i * 4] = RGBGetBValue(colors[i + 6]);
|
||||
|
|
|
|||
|
|
@ -392,7 +392,7 @@ void CMKeyboardV1Controller::SetLeds(std::vector<led> leds, std::vector<RGBColor
|
|||
std::vector<uint8_t> data;
|
||||
data.push_back(0xC0);
|
||||
data.push_back(0x02);
|
||||
data.push_back(i*2);
|
||||
data.push_back((uint8_t)(i * 2));
|
||||
data.push_back(0x00);
|
||||
|
||||
for(size_t j = 0; j < 16; j++)
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ void CMKeyboardV2Controller::SetLeds(std::vector<led> leds, std::vector<RGBColor
|
|||
data.clear();
|
||||
data.push_back(0x56);
|
||||
data.push_back(0x83);
|
||||
data.push_back(i);
|
||||
data.push_back((uint8_t)i);
|
||||
data.push_back(0x00);
|
||||
|
||||
for(size_t j = 0; j < 60; j++)
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ void DetectCoolerMasterARGB(hid_device_info* info, const std::string&)
|
|||
\*-------------------------------------------------*/
|
||||
std::shared_ptr<std::mutex> cm_mutex = std::make_shared<std::mutex>();
|
||||
|
||||
for(std::size_t i = 0; i < CM_ARGB_HEADER_DATA_SIZE; i++)
|
||||
for(unsigned char i = 0; i < CM_ARGB_HEADER_DATA_SIZE; i++)
|
||||
{
|
||||
CMARGBController* controller = new CMARGBController(dev, info->path, i, cm_mutex);
|
||||
RGBController_CMARGBController* rgb_controller = new RGBController_CMARGBController(controller);
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ RGBController_CMARGBController::RGBController_CMARGBController(CMARGBController*
|
|||
SetupZones();
|
||||
|
||||
int temp_mode = controller->GetMode();
|
||||
for(std::size_t mode_idx = 0; mode_idx < modes.size() ; mode_idx++)
|
||||
for(int mode_idx = 0; mode_idx < (int)modes.size() ; mode_idx++)
|
||||
{
|
||||
if (temp_mode == modes[mode_idx].value)
|
||||
{
|
||||
|
|
@ -382,7 +382,7 @@ void RGBController_CMARGBController::DeviceUpdateLEDs()
|
|||
{
|
||||
uint8_t end_zone = last_zone(cmargb->GetZoneIndex());
|
||||
|
||||
for(std::size_t zone_idx = first_zone(cmargb->GetZoneIndex()); zone_idx < end_zone; zone_idx++)
|
||||
for(int zone_idx = first_zone(cmargb->GetZoneIndex()); zone_idx < end_zone; zone_idx++)
|
||||
{
|
||||
UpdateZoneLEDs(zone_idx);
|
||||
}
|
||||
|
|
@ -400,7 +400,7 @@ void RGBController_CMARGBController::UpdateSingleLED(int led)
|
|||
|
||||
void RGBController_CMARGBController::SetCustomMode()
|
||||
{
|
||||
for(std::size_t mode_idx = 0; mode_idx < modes.size() ; mode_idx++)
|
||||
for(int mode_idx = 0; mode_idx < (int)modes.size() ; mode_idx++)
|
||||
{
|
||||
if (modes[mode_idx].value == CM_ARGB_MODE_DIRECT)
|
||||
{
|
||||
|
|
@ -423,12 +423,12 @@ int RGBController_CMARGBController::GetLED_Zone(int led_idx)
|
|||
/*---------------------------------------------------------*\
|
||||
| This may be more useful in the abstract RGBController.cpp |
|
||||
\*---------------------------------------------------------*/
|
||||
for(size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
|
||||
for(int zone_idx = 0; zone_idx < (int)zones.size(); zone_idx++)
|
||||
{
|
||||
int zone_start = zones[zone_idx].start_idx;
|
||||
int zone_end = zone_start + zones[zone_idx].leds_count - 1;
|
||||
|
||||
if( zone_start <= led_idx && zone_end >= led_idx)
|
||||
if(zone_start <= led_idx && zone_end >= led_idx)
|
||||
{
|
||||
return(zone_idx);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,16 +107,16 @@ RGBController_CMMM711Controller::RGBController_CMMM711Controller(CMMM711Controll
|
|||
|
||||
uint8_t temp_mode = controller->GetMode();
|
||||
|
||||
for(std::size_t mode_index = 0; mode_index < modes.size(); mode_index++)
|
||||
for(int mode_index = 0; mode_index < (int)modes.size(); mode_index++)
|
||||
{
|
||||
if (modes[mode_index].value == temp_mode)
|
||||
if(modes[mode_index].value == temp_mode)
|
||||
{
|
||||
active_mode = mode_index;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC)
|
||||
if(modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC)
|
||||
{
|
||||
modes[active_mode].colors[0] = ToRGBColor(controller->GetLedRed(),controller->GetLedGreen(),controller->GetLedBlue());
|
||||
}
|
||||
|
|
@ -184,9 +184,9 @@ void RGBController_CMMM711Controller::UpdateSingleLED(int /*led*/)
|
|||
|
||||
void RGBController_CMMM711Controller::SetCustomMode()
|
||||
{
|
||||
for(std::size_t mode_index = 0; mode_index < modes.size(); mode_index++)
|
||||
for(int mode_index = 0; mode_index < (int)modes.size(); mode_index++)
|
||||
{
|
||||
if (modes[mode_index].value == CM_MM711_MODE_CUSTOM)
|
||||
if(modes[mode_index].value == CM_MM711_MODE_CUSTOM)
|
||||
{
|
||||
active_mode = mode_index;
|
||||
break;
|
||||
|
|
@ -198,9 +198,9 @@ void RGBController_CMMM711Controller::DeviceUpdateMode()
|
|||
{
|
||||
RGBColor colour = 0;
|
||||
|
||||
if (modes[active_mode].value != CM_MM711_MODE_CUSTOM)
|
||||
if(modes[active_mode].value != CM_MM711_MODE_CUSTOM)
|
||||
{
|
||||
if( modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC )
|
||||
if(modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC )
|
||||
{
|
||||
colour = modes[active_mode].colors[0];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ RGBController_CMMMController::RGBController_CMMMController(CMMMController* contr
|
|||
|
||||
uint8_t temp_mode = controller->GetMode();
|
||||
|
||||
for(std::size_t mode_index = 0; mode_index < modes.size(); mode_index++)
|
||||
for(int mode_index = 0; mode_index < (int)modes.size(); mode_index++)
|
||||
{
|
||||
if(modes[mode_index].value == temp_mode)
|
||||
{
|
||||
|
|
@ -249,7 +249,7 @@ void RGBController_CMMMController::UpdateSingleLED(int /*led*/)
|
|||
|
||||
void RGBController_CMMMController::SetCustomMode()
|
||||
{
|
||||
for(std::size_t mode_index = 0; mode_index < modes.size(); mode_index++)
|
||||
for(int mode_index = 0; mode_index < (int)modes.size(); mode_index++)
|
||||
{
|
||||
if(modes[mode_index].value == CM_MM_MODE_CUSTOM)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ void RGBController_CMRGBController::ReadAllModeConfigsFromDevice()
|
|||
{
|
||||
int device_mode = controller->GetMode();
|
||||
|
||||
for(std::size_t mode_idx = 0; mode_idx < modes.size(); mode_idx++)
|
||||
for(int mode_idx = 0; mode_idx < (int)modes.size(); mode_idx++)
|
||||
{
|
||||
if(device_mode == modes[mode_idx].value)
|
||||
{
|
||||
|
|
@ -188,14 +188,14 @@ void RGBController_CMRGBController::ReadAllModeConfigsFromDevice()
|
|||
|
||||
void RGBController_CMRGBController::LoadConfigFromDeviceController(int mode_idx)
|
||||
{
|
||||
for(std::size_t color_idx = 0; color_idx < modes[mode_idx].colors.size(); color_idx++)
|
||||
for(int color_idx = 0; color_idx < (int)modes[mode_idx].colors.size(); color_idx++)
|
||||
{
|
||||
modes[mode_idx].colors[0] = controller->GetModeColor(color_idx);
|
||||
}
|
||||
|
||||
if(modes[mode_idx].flags & MODE_FLAG_HAS_PER_LED_COLOR)
|
||||
{
|
||||
for (std::size_t led_idx = 0; led_idx < leds.size(); led_idx++)
|
||||
for(int led_idx = 0; led_idx < (int)leds.size(); led_idx++)
|
||||
{
|
||||
SetLED(led_idx, controller->GetPortColor(led_idx));
|
||||
}
|
||||
|
|
@ -248,7 +248,7 @@ void RGBController_CMRGBController::ResizeZone(int /*zone*/, int /*new_size*/)
|
|||
|
||||
void RGBController_CMRGBController::DeviceUpdateLEDs()
|
||||
{
|
||||
for(size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
|
||||
for(int zone_idx = 0; zone_idx < (int)zones.size(); zone_idx++)
|
||||
{
|
||||
UpdateZoneLEDs(zone_idx);
|
||||
}
|
||||
|
|
@ -265,9 +265,9 @@ void RGBController_CMRGBController::UpdateSingleLED(int /*led*/)
|
|||
|
||||
void RGBController_CMRGBController::SetCustomMode()
|
||||
{
|
||||
for(std::size_t mode_idx = 0; mode_idx < modes.size() ; mode_idx++)
|
||||
for(int mode_idx = 0; mode_idx < (int)modes.size() ; mode_idx++)
|
||||
{
|
||||
if (modes[mode_idx].value == CM_RGBC_MODE_MULTIPLE)
|
||||
if(modes[mode_idx].value == CM_RGBC_MODE_MULTIPLE)
|
||||
{
|
||||
active_mode = mode_idx;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -155,9 +155,9 @@ RGBController_CMSmallARGBController::RGBController_CMSmallARGBController(CMSmall
|
|||
|
||||
int temp_mode = controller->GetMode();
|
||||
|
||||
for(std::size_t mode_idx = 0; mode_idx < modes.size() ; mode_idx++)
|
||||
for(int mode_idx = 0; mode_idx < (int)modes.size() ; mode_idx++)
|
||||
{
|
||||
if (temp_mode == modes[mode_idx].value)
|
||||
if(temp_mode == modes[mode_idx].value)
|
||||
{
|
||||
active_mode = mode_idx;
|
||||
break;
|
||||
|
|
@ -259,7 +259,7 @@ void RGBController_CMSmallARGBController::ResizeZone(int zone, int new_size)
|
|||
|
||||
void RGBController_CMSmallARGBController::DeviceUpdateLEDs()
|
||||
{
|
||||
for(size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
|
||||
for(int zone_idx = 0; zone_idx < (int)zones.size(); zone_idx++)
|
||||
{
|
||||
UpdateZoneLEDs(zone_idx);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ void RGBController_CorsairDominatorPlatinum::ResizeZone(int /*zone*/, int /*new_
|
|||
|
||||
void RGBController_CorsairDominatorPlatinum::DeviceUpdateLEDs()
|
||||
{
|
||||
for(std::size_t led = 0; led < colors.size(); led++)
|
||||
for(unsigned int led = 0; led < (unsigned int)colors.size(); led++)
|
||||
{
|
||||
RGBColor color = colors[led];
|
||||
unsigned char red = RGBGetRValue(color);
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ void CorsairHydroController::SetFixed
|
|||
/*-----------------------------------------------------*\
|
||||
| Fixed mode seems to just be shift mode with the same |
|
||||
| value for both colors |
|
||||
\*-----------------------------------------------------*/
|
||||
\*-----------------------------------------------------*/
|
||||
SendApplyShift();
|
||||
}
|
||||
|
||||
|
|
@ -208,7 +208,7 @@ void CorsairHydroController::SendColors
|
|||
| Set up Send Colors packet |
|
||||
\*-----------------------------------------------------*/
|
||||
usb_buf[0] = 0x56;
|
||||
usb_buf[1] = colors.size();
|
||||
usb_buf[1] = (unsigned char)colors.size();
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Fill in colors from vector |
|
||||
|
|
@ -226,7 +226,7 @@ void CorsairHydroController::SendColors
|
|||
\*---------------------------------------------------------*/
|
||||
if((color_idx == 0) && colors.size() == 1)
|
||||
{
|
||||
usb_buf[1] = colors.size() + 1;
|
||||
usb_buf[1] = (unsigned char)colors.size() + 1;
|
||||
usb_buf[(color_idx * 3) + 5] = RGBGetRValue(colors[color_idx]);
|
||||
usb_buf[(color_idx * 3) + 6] = RGBGetGValue(colors[color_idx]);
|
||||
usb_buf[(color_idx * 3) + 7] = RGBGetBValue(colors[color_idx]);
|
||||
|
|
|
|||
|
|
@ -112,17 +112,17 @@ std::string CorsairHydroPlatinumController::GetFirmwareString()
|
|||
|
||||
void CorsairHydroPlatinumController::SetupColors(std::vector<RGBColor> colors)
|
||||
{
|
||||
unsigned int end_led = colors.size() >= 20 ? 20 : colors.size();
|
||||
unsigned int end_led = (colors.size() >= 20) ? 20 : (unsigned int)colors.size();
|
||||
SendColors(colors, 0, end_led, CORSAIR_HYDRO_PLATINUM_SET_LIGHTING_1);
|
||||
|
||||
if(colors.size() > 20)
|
||||
{
|
||||
end_led = colors.size() >= 40 ? 40 : colors.size();
|
||||
end_led = (colors.size() >= 40) ? 40 : (unsigned int)colors.size();
|
||||
SendColors(colors, 20, end_led, CORSAIR_HYDRO_PLATINUM_SET_LIGHTING_2);
|
||||
}
|
||||
if(colors.size() > 40)
|
||||
{
|
||||
end_led = colors.size() >= 48 ? 48 : colors.size();
|
||||
end_led = (colors.size() >= 48) ? 48 : (unsigned int)colors.size();
|
||||
SendColors(colors, 40, end_led, CORSAIR_HYDRO_PLATINUM_SET_LIGHTING_3);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -297,7 +297,7 @@ void RGBController_CorsairLightingNode::ResizeZone(int zone, int new_size)
|
|||
|
||||
void RGBController_CorsairLightingNode::DeviceUpdateLEDs()
|
||||
{
|
||||
for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
|
||||
for(unsigned char zone_idx = 0; zone_idx < (unsigned char)zones.size(); zone_idx++)
|
||||
{
|
||||
controller->SetChannelLEDs(zone_idx, zones[zone_idx].colors, zones[zone_idx].leds_count);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -258,12 +258,12 @@ void CorsairPeripheralController::SetLEDsKeyboardFull(std::vector<RGBColor> colo
|
|||
|
||||
void CorsairPeripheralController::SetLEDsMouse(std::vector<RGBColor> colors)
|
||||
{
|
||||
SubmitMouseColors(colors.size(), &colors[0]);
|
||||
SubmitMouseColors((unsigned char)colors.size(), &colors[0]);
|
||||
}
|
||||
|
||||
void CorsairPeripheralController::SetLEDsMousemat(std::vector<RGBColor> colors)
|
||||
{
|
||||
SubmitMousematColors(colors.size(), &colors[0]);
|
||||
SubmitMousematColors((unsigned char)colors.size(), &colors[0]);
|
||||
}
|
||||
|
||||
void CorsairPeripheralController::SetLEDsKeyboardLimited(std::vector<RGBColor> colors)
|
||||
|
|
@ -329,7 +329,7 @@ void CorsairPeripheralController::SetLEDsKeyboardLimited(std::vector<RGBColor> c
|
|||
StreamPacket(2, 60, &data_pkt[60]);
|
||||
StreamPacket(3, 60, &data_pkt[120]);
|
||||
StreamPacket(4, 36, &data_pkt[180]);
|
||||
|
||||
|
||||
SubmitKeyboardLimitedColors(216);
|
||||
}
|
||||
|
||||
|
|
@ -374,7 +374,7 @@ void CorsairPeripheralController::SwitchMode(bool software)
|
|||
|
||||
void CorsairPeripheralController::LightingControl()
|
||||
{
|
||||
char usb_buf[CORSAIR_PERIPHERAL_PACKET_LENGTH];
|
||||
unsigned char usb_buf[CORSAIR_PERIPHERAL_PACKET_LENGTH];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
|
|
@ -412,11 +412,11 @@ void CorsairPeripheralController::LightingControl()
|
|||
usb_buf[0x05] = 0x03;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_write(dev, (unsigned char *)usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
hid_write(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
|
|
@ -425,7 +425,7 @@ void CorsairPeripheralController::LightingControl()
|
|||
|
||||
void CorsairPeripheralController::SetupK55AndK95LightingControl()
|
||||
{
|
||||
char usb_buf[CORSAIR_PERIPHERAL_PACKET_LENGTH];
|
||||
unsigned char usb_buf[CORSAIR_PERIPHERAL_PACKET_LENGTH];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
|
|
@ -445,11 +445,11 @@ void CorsairPeripheralController::SetupK55AndK95LightingControl()
|
|||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_write(dev, (unsigned char *)usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
hid_write(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
|
||||
unsigned int* skipped_identifiers = key_mapping_k95_plat_ansi;
|
||||
int skipped_identifiers_count = sizeof(key_mapping_k95_plat_ansi) / sizeof(key_mapping_k95_plat_ansi[0]);
|
||||
|
||||
|
||||
if (physical_layout == CORSAIR_LAYOUT_ISO)
|
||||
{
|
||||
if(logical_layout == CORSAIR_TYPE_K70_MK2)
|
||||
|
|
@ -497,13 +497,13 @@ void CorsairPeripheralController::SetupK55AndK95LightingControl()
|
|||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_write(dev, (unsigned char *)usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
hid_write(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
}
|
||||
}
|
||||
|
||||
void CorsairPeripheralController::SpecialFunctionControl()
|
||||
{
|
||||
char usb_buf[CORSAIR_PERIPHERAL_PACKET_LENGTH];
|
||||
unsigned char usb_buf[CORSAIR_PERIPHERAL_PACKET_LENGTH];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
|
|
@ -517,17 +517,17 @@ void CorsairPeripheralController::SpecialFunctionControl()
|
|||
usb_buf[0x01] = CORSAIR_COMMAND_WRITE;
|
||||
usb_buf[0x02] = CORSAIR_PROPERTY_SPECIAL_FUNCTION;
|
||||
usb_buf[0x03] = CORSAIR_LIGHTING_CONTROL_SOFTWARE;
|
||||
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_write(dev, (unsigned char *)usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
hid_write(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
}
|
||||
|
||||
void CorsairPeripheralController::ReadFirmwareInfo()
|
||||
{
|
||||
int actual;
|
||||
char usb_buf[CORSAIR_PERIPHERAL_PACKET_LENGTH];
|
||||
unsigned char usb_buf[CORSAIR_PERIPHERAL_PACKET_LENGTH];
|
||||
char offset = 0;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
|
|
@ -547,8 +547,8 @@ void CorsairPeripheralController::ReadFirmwareInfo()
|
|||
| If that fails, repeat the send and read the reply as |
|
||||
| a feature report. |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_write(dev, (unsigned char*)usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
actual = hid_read_timeout(dev, (unsigned char*)usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH, 1000);
|
||||
hid_write(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
actual = hid_read_timeout(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH, 1000);
|
||||
|
||||
if(actual == 0)
|
||||
{
|
||||
|
|
@ -564,8 +564,8 @@ void CorsairPeripheralController::ReadFirmwareInfo()
|
|||
usb_buf[0x01] = CORSAIR_COMMAND_READ;
|
||||
usb_buf[0x02] = CORSAIR_PROPERTY_FIRMWARE_INFO;
|
||||
|
||||
hid_send_feature_report(dev, (unsigned char*)usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
actual = hid_get_feature_report(dev, (unsigned char*)usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
hid_send_feature_report(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
actual = hid_get_feature_report(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
offset = 1;
|
||||
}
|
||||
|
||||
|
|
@ -574,14 +574,14 @@ void CorsairPeripheralController::ReadFirmwareInfo()
|
|||
| 0xC0 Device is a keyboard |
|
||||
| 0xC1 Device is a mouse |
|
||||
| 0xC2 Device is a mousepad or headset stand |
|
||||
\*-----------------------------------------------------*/
|
||||
LOG_DEBUG("[%s] Device type %02X", CORSAIR_PERIPHERAL_CONTROLLER_NAME, (unsigned char)usb_buf[0x14 + offset]);
|
||||
\*-----------------------------------------------------*/
|
||||
LOG_DEBUG("[%s] Device type %02X", CORSAIR_PERIPHERAL_CONTROLLER_NAME, usb_buf[0x14 + offset]);
|
||||
|
||||
switch((unsigned char)usb_buf[0x14 + offset])
|
||||
switch(usb_buf[0x14 + offset])
|
||||
{
|
||||
case 0xC0:
|
||||
{
|
||||
unsigned short pid = (unsigned short)(usb_buf[0x0E] << 8) + (unsigned char)(usb_buf[0x0F]);
|
||||
unsigned short pid = (unsigned short)(usb_buf[0x0E] << 8) + (unsigned short)(usb_buf[0x0F]);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Get the correct Keyboard Type |
|
||||
|
|
@ -619,7 +619,7 @@ void CorsairPeripheralController::ReadFirmwareInfo()
|
|||
| Get the correct Keyboard Layout. |
|
||||
| Currently unused but can be implemented in the future.|
|
||||
\*-----------------------------------------------------*/
|
||||
switch((unsigned char)usb_buf[0x17 + offset])
|
||||
switch(usb_buf[0x17 + offset])
|
||||
{
|
||||
case CORSAIR_LAYOUT_ANSI:
|
||||
physical_layout = CORSAIR_LAYOUT_ANSI;
|
||||
|
|
@ -651,7 +651,7 @@ void CorsairPeripheralController::ReadFirmwareInfo()
|
|||
|
||||
case 0xC2:
|
||||
{
|
||||
unsigned short pid = (unsigned short)(usb_buf[0x0F] << 8) + (unsigned char)(usb_buf[0x0E]);
|
||||
unsigned short pid = (unsigned short)(usb_buf[0x0F] << 8) + (unsigned short)(usb_buf[0x0E]);
|
||||
|
||||
switch(pid)
|
||||
{
|
||||
|
|
@ -659,7 +659,7 @@ void CorsairPeripheralController::ReadFirmwareInfo()
|
|||
type = DEVICE_TYPE_HEADSET_STAND;
|
||||
SpecialFunctionControl();
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
type = DEVICE_TYPE_MOUSEMAT;
|
||||
SpecialFunctionControl();
|
||||
|
|
@ -689,7 +689,7 @@ void CorsairPeripheralController::StreamPacket
|
|||
unsigned char* data_ptr
|
||||
)
|
||||
{
|
||||
char usb_buf[CORSAIR_PERIPHERAL_PACKET_LENGTH];
|
||||
unsigned char usb_buf[CORSAIR_PERIPHERAL_PACKET_LENGTH];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
|
|
@ -712,7 +712,7 @@ void CorsairPeripheralController::StreamPacket
|
|||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_write(dev, (unsigned char *)usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
hid_write(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
}
|
||||
|
||||
void CorsairPeripheralController::SetHardwareMode
|
||||
|
|
@ -822,7 +822,7 @@ void CorsairPeripheralController::SubmitKeyboardFullColors
|
|||
unsigned char finish_val
|
||||
)
|
||||
{
|
||||
char usb_buf[CORSAIR_PERIPHERAL_PACKET_LENGTH];
|
||||
unsigned char usb_buf[CORSAIR_PERIPHERAL_PACKET_LENGTH];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
|
|
@ -842,7 +842,7 @@ void CorsairPeripheralController::SubmitKeyboardFullColors
|
|||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_write(dev, (unsigned char *)usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
hid_write(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
}
|
||||
|
||||
void CorsairPeripheralController::SubmitKeyboardZonesColors
|
||||
|
|
@ -852,7 +852,7 @@ void CorsairPeripheralController::SubmitKeyboardZonesColors
|
|||
RGBColor right
|
||||
)
|
||||
{
|
||||
char usb_buf[CORSAIR_PERIPHERAL_PACKET_LENGTH];
|
||||
unsigned char usb_buf[CORSAIR_PERIPHERAL_PACKET_LENGTH];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
|
|
@ -880,7 +880,7 @@ void CorsairPeripheralController::SubmitKeyboardZonesColors
|
|||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_write(dev, (unsigned char *)usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
hid_write(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
}
|
||||
|
||||
void CorsairPeripheralController::SubmitKeyboardLimitedColors
|
||||
|
|
@ -888,7 +888,7 @@ void CorsairPeripheralController::SubmitKeyboardLimitedColors
|
|||
unsigned char byte_count
|
||||
)
|
||||
{
|
||||
char usb_buf[CORSAIR_PERIPHERAL_PACKET_LENGTH];
|
||||
unsigned char usb_buf[CORSAIR_PERIPHERAL_PACKET_LENGTH];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
|
|
@ -906,7 +906,7 @@ void CorsairPeripheralController::SubmitKeyboardLimitedColors
|
|||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_write(dev, (unsigned char *)usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
hid_write(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
}
|
||||
|
||||
void CorsairPeripheralController::SubmitMouseColors
|
||||
|
|
@ -915,7 +915,7 @@ void CorsairPeripheralController::SubmitMouseColors
|
|||
RGBColor * color_data
|
||||
)
|
||||
{
|
||||
char usb_buf[CORSAIR_PERIPHERAL_PACKET_LENGTH];
|
||||
unsigned char usb_buf[CORSAIR_PERIPHERAL_PACKET_LENGTH];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
|
|
@ -945,7 +945,7 @@ void CorsairPeripheralController::SubmitMouseColors
|
|||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_write(dev, (unsigned char *)usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
hid_write(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
}
|
||||
|
||||
void CorsairPeripheralController::SubmitMousematColors
|
||||
|
|
@ -954,7 +954,7 @@ void CorsairPeripheralController::SubmitMousematColors
|
|||
RGBColor * color_data
|
||||
)
|
||||
{
|
||||
char usb_buf[CORSAIR_PERIPHERAL_PACKET_LENGTH];
|
||||
unsigned char usb_buf[CORSAIR_PERIPHERAL_PACKET_LENGTH];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
|
|
@ -984,5 +984,5 @@ void CorsairPeripheralController::SubmitMousematColors
|
|||
| Send packet using feature reports, as headset stand |
|
||||
| seems to not update completely using HID writes |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_write(dev, (unsigned char *)usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
hid_write(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ void CorsairPeripheralV2HWController::SetLedsDirect(std::vector<RGBColor *>color
|
|||
|
||||
void CorsairPeripheralV2HWController::SetLedsDirectColourBlocks(std::vector<RGBColor *>colors)
|
||||
{
|
||||
uint16_t count = colors.size();
|
||||
uint16_t count = (uint16_t)colors.size();
|
||||
uint16_t green = count;
|
||||
uint16_t blue = (count * 2);
|
||||
uint16_t length = (count * 3);
|
||||
|
|
@ -63,7 +63,7 @@ void CorsairPeripheralV2HWController::SetLedsDirectColourBlocks(std::vector<RGBC
|
|||
|
||||
void CorsairPeripheralV2HWController::SetLedsDirectTriplets(std::vector<RGBColor *>colors)
|
||||
{
|
||||
uint16_t count = colors.size();
|
||||
uint16_t count = (uint16_t)colors.size();
|
||||
uint16_t length = (count * 3) + CORSAIR_V2HW_DATA_OFFSET;
|
||||
uint8_t* buffer = new uint8_t[length];
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ CorsairPeripheralV2SWController::~CorsairPeripheralV2SWController()
|
|||
|
||||
void CorsairPeripheralV2SWController::SetLedsDirect(std::vector<RGBColor *>colors)
|
||||
{
|
||||
uint16_t count = colors.size();
|
||||
uint16_t count = (uint16_t)colors.size();
|
||||
uint16_t green = count;
|
||||
uint16_t blue = count * 2;
|
||||
uint16_t length = count * 3;
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ void RGBController_CorsairV2HW::SetupZones()
|
|||
LOG_DEBUG("[%s] Created KB matrix with %d rows and %d columns containing %d keys",
|
||||
controller->GetName().c_str(), new_kb.GetRowCount(), new_kb.GetColumnCount(), new_zone.leds_count);
|
||||
|
||||
for(size_t led_idx = 0; led_idx < new_zone.leds_count; led_idx++)
|
||||
for(unsigned int led_idx = 0; led_idx < new_zone.leds_count; led_idx++)
|
||||
{
|
||||
led new_led;
|
||||
|
||||
|
|
@ -192,7 +192,7 @@ void RGBController_CorsairV2HW::SetupZones()
|
|||
|
||||
new_led.name = new_zone.name + " ";
|
||||
new_led.name.append(std::to_string( led_idx ));
|
||||
new_led.value = leds.size();
|
||||
new_led.value = (unsigned int)leds.size();
|
||||
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ void RGBController_CorsairV2SW::SetupZones()
|
|||
|
||||
new_led.name = new_zone.name + " ";
|
||||
new_led.name.append(std::to_string( led_idx ));
|
||||
new_led.value = leds.size();
|
||||
new_led.value = (unsigned int)leds.size();
|
||||
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue