Non-important warnings removed
Commit amended by Adam Honse <calcprogrammer1@gmail.com> due to merging from a different branch.
This commit is contained in:
parent
94c18fc9b4
commit
8b8451017e
41 changed files with 216 additions and 199 deletions
|
|
@ -24,7 +24,7 @@ ATC800Controller::~ATC800Controller()
|
|||
void ATC800Controller::SendCoolerMode
|
||||
(
|
||||
unsigned char mode,
|
||||
unsigned short speed,
|
||||
unsigned short /*speed*/,
|
||||
unsigned char channel,
|
||||
unsigned char red,
|
||||
unsigned char green,
|
||||
|
|
|
|||
|
|
@ -10,6 +10,21 @@
|
|||
#include "AuraSMBusController.h"
|
||||
#include <cstring>
|
||||
|
||||
static const char* aura_channels[] = /* Aura channel strings */
|
||||
{
|
||||
"Audio",
|
||||
"Backplate",
|
||||
"Back I/O",
|
||||
"Center",
|
||||
"Center",
|
||||
"DRAM",
|
||||
"PCIe",
|
||||
"RGB Header",
|
||||
"RGB Header 2",
|
||||
"RGB Header",
|
||||
"Unknown",
|
||||
};
|
||||
|
||||
AuraSMBusController::AuraSMBusController(i2c_smbus_interface* bus, aura_dev_id dev)
|
||||
{
|
||||
this->bus = bus;
|
||||
|
|
|
|||
|
|
@ -66,21 +66,6 @@ enum
|
|||
AURA_LED_CHANNEL_RGB_HEADER_3 = 0x91, /* RGB Header 3 LED channel */
|
||||
};
|
||||
|
||||
static const char* aura_channels[] = /* Aura channel strings */
|
||||
{
|
||||
"Audio",
|
||||
"Backplate",
|
||||
"Back I/O",
|
||||
"Center",
|
||||
"Center",
|
||||
"DRAM",
|
||||
"PCIe",
|
||||
"RGB Header",
|
||||
"RGB Header 2",
|
||||
"RGB Header",
|
||||
"Unknown",
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
AURA_CONFIG_LED_COUNT = 0x02, /* LED Count configuration offset */
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ void AuraAddressableController::SetChannelLEDs(unsigned char channel, RGBColor *
|
|||
leds_to_send = num_colors - leds_sent;
|
||||
}
|
||||
|
||||
for(int led_idx = 0; led_idx < leds_to_send; led_idx++)
|
||||
for(unsigned int led_idx = 0; led_idx < leds_to_send; led_idx++)
|
||||
{
|
||||
led_data[(led_idx * 3) + 0] = RGBGetRValue(colors[led_idx + leds_sent]);
|
||||
led_data[(led_idx * 3) + 1] = RGBGetGValue(colors[led_idx + leds_sent]);
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ void AuraMainboardController::SetChannelLEDs(unsigned char channel, RGBColor * c
|
|||
leds_to_send = num_colors - leds_sent;
|
||||
}
|
||||
|
||||
for(int led_idx = 0; led_idx < leds_to_send; led_idx++)
|
||||
for(unsigned int led_idx = 0; led_idx < leds_to_send; led_idx++)
|
||||
{
|
||||
led_data[(led_idx * 3) + 0] = RGBGetRValue(colors[led_idx + leds_sent]);
|
||||
led_data[(led_idx * 3) + 1] = RGBGetGValue(colors[led_idx + leds_sent]);
|
||||
|
|
|
|||
|
|
@ -9,18 +9,38 @@
|
|||
|
||||
#include "CMMP750Controller.h"
|
||||
|
||||
static unsigned char colour_mode_data[][6] =
|
||||
{
|
||||
{ 0x01, 0x04, 0xFF, 0x00, 0xFF, 0x00 }, /* Static */
|
||||
{ 0x02, 0x04, 0xFF, 0x00, 0xFF, 0x80 }, /* Blinking */
|
||||
{ 0x03, 0x04, 0xFF, 0x00, 0xFF, 0x80 }, /* Breathing */
|
||||
{ 0x04, 0x04, 0x80, 0x00, 0x00, 0x00 }, /* Colour Cycle */
|
||||
{ 0x05, 0x04, 0x80, 0x00, 0x00, 0x00 } /* Colour Breath */
|
||||
};
|
||||
|
||||
static unsigned char speed_mode_data[][9] =
|
||||
{
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },/* Static */
|
||||
{ 0xFF, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20, 0x00 },/* Blinking */
|
||||
{ 0xFF, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20, 0x00 },/* Breathing */
|
||||
{ 0xFF, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20, 0x00 },/* Colour Cycle */
|
||||
{ 0xFF, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20, 0x00 } /* Colour Breath */
|
||||
};
|
||||
|
||||
CMMP750Controller::CMMP750Controller(hid_device* dev_handle, wchar_t *_vendor, wchar_t *_device_name, char *_path)
|
||||
{
|
||||
int tmp_size = wcslen(_vendor);
|
||||
dev = dev_handle;
|
||||
location = _path;
|
||||
std::size_t tmp_size = wcslen(_vendor);
|
||||
dev = dev_handle;
|
||||
location = _path;
|
||||
|
||||
for (int i=0; ( i<tmp_size && i<CM_DEVICE_NAME_SIZE); i++)
|
||||
for(std::size_t i = 0; (i < tmp_size) && (i < CM_DEVICE_NAME_SIZE); i++)
|
||||
{
|
||||
device_name[i] = (char)_vendor[i];
|
||||
}
|
||||
for (int j=0; ( j<wcslen(_vendor) && tmp_size+j<CM_DEVICE_NAME_SIZE); j++)
|
||||
device_name[tmp_size+j] = (char)_device_name[j];
|
||||
for(std::size_t j = 0; (j < wcslen(_vendor)) && (tmp_size + j < CM_DEVICE_NAME_SIZE); j++)
|
||||
{
|
||||
device_name[tmp_size + j] = (char)_device_name[j];
|
||||
}
|
||||
|
||||
GetStatus(); //When setting up device get current status
|
||||
}
|
||||
|
|
@ -39,20 +59,22 @@ void CMMP750Controller::GetStatus()
|
|||
hid_write(dev, buffer, buffer_size);
|
||||
hid_read(dev, buffer, buffer_size);
|
||||
|
||||
if( buffer[0] == 0x80 && buffer[1] == 0x05 )
|
||||
if((buffer[0] == 0x80) && (buffer[1] == 0x05))
|
||||
{
|
||||
current_mode = buffer[2] - 1;
|
||||
current_red = buffer[3];
|
||||
current_green = buffer[4];
|
||||
current_blue = buffer[5];
|
||||
|
||||
for( int i = 0; speed_mode_data[current_mode][i] >= buffer[6]; i++)
|
||||
for(int i = 0; speed_mode_data[current_mode][i] >= buffer[6]; i++)
|
||||
{
|
||||
current_speed = i;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Code should never reach here however just in case there is a failure set something
|
||||
current_mode = MP750_MODE_COLOR_CYCLE; //Unicorn Spew
|
||||
current_mode = MP750_MODE_COLOR_CYCLE; //Unicorn Spew
|
||||
current_red = 0xFF;
|
||||
current_green = 0xFF;
|
||||
current_blue = 0xFF;
|
||||
|
|
@ -122,7 +144,7 @@ void CMMP750Controller::SendUpdate()
|
|||
unsigned char buffer[0x40] = { 0x00 };
|
||||
int buffer_size = (sizeof(buffer) / sizeof(buffer[0]));
|
||||
|
||||
for(int i = 0; i < CM_COLOUR_MODE_DATA_SIZE; i++)
|
||||
for(std::size_t i = 0; i < CM_COLOUR_MODE_DATA_SIZE; i++)
|
||||
{
|
||||
buffer[i] = colour_mode_data[current_mode][i];
|
||||
}
|
||||
|
|
@ -130,16 +152,16 @@ void CMMP750Controller::SendUpdate()
|
|||
if(current_mode > MP750_MODE_BREATHING)
|
||||
{
|
||||
//If the mode is random colours set SPEED at BYTE2
|
||||
buffer[CM_RED_BYTE] = speed_mode_data[current_mode][current_speed];
|
||||
buffer[CM_RED_BYTE] = speed_mode_data[current_mode][current_speed];
|
||||
}
|
||||
else
|
||||
{
|
||||
//Otherwise SPEED is BYTE5
|
||||
buffer[CM_RED_BYTE] = current_red;
|
||||
buffer[CM_GREEN_BYTE] = current_green;
|
||||
buffer[CM_BLUE_BYTE] = current_blue;
|
||||
buffer[CM_SPEED_BYTE] = speed_mode_data[current_mode][current_speed];
|
||||
buffer[CM_RED_BYTE] = current_red;
|
||||
buffer[CM_GREEN_BYTE] = current_green;
|
||||
buffer[CM_BLUE_BYTE] = current_blue;
|
||||
buffer[CM_SPEED_BYTE] = speed_mode_data[current_mode][current_speed];
|
||||
}
|
||||
|
||||
hid_write(dev, buffer, buffer_size);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,24 +44,6 @@ enum
|
|||
MP750_MODE_BREATH_CYCLE = 0x04 //Breathing Cycle Mode
|
||||
};
|
||||
|
||||
static unsigned char colour_mode_data[][6] =
|
||||
{
|
||||
{ 0x01, 0x04, 0xFF, 0x00, 0xFF, 0x00 }, /* Static */
|
||||
{ 0x02, 0x04, 0xFF, 0x00, 0xFF, 0x80 }, /* Blinking */
|
||||
{ 0x03, 0x04, 0xFF, 0x00, 0xFF, 0x80 }, /* Breathing */
|
||||
{ 0x04, 0x04, 0x80, 0x00, 0x00, 0x00 }, /* Colour Cycle */
|
||||
{ 0x05, 0x04, 0x80, 0x00, 0x00, 0x00 } /* Colour Breath */
|
||||
};
|
||||
|
||||
static unsigned char speed_mode_data[][9] =
|
||||
{
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },/* Static */
|
||||
{ 0xFF, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20, 0x00 },/* Blinking */
|
||||
{ 0xFF, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20, 0x00 },/* Breathing */
|
||||
{ 0xFF, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20, 0x00 },/* Colour Cycle */
|
||||
{ 0xFF, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20, 0x00 } /* Colour Breath */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
MP750_SPEED_SLOWEST = 0x00, /* Slowest speed */
|
||||
|
|
|
|||
|
|
@ -9,25 +9,60 @@
|
|||
|
||||
#include "EKController.h"
|
||||
|
||||
static unsigned char colour_mode_data[][16] =
|
||||
{
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x01, 0x00, 0xFF, 0x64}, // Static
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x02, 0x00, 0xFF, 0x64}, // Breathing
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x03, 0xFF, 0xFF, 0x64}, // Fading
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x04, 0x00, 0xFF, 0x64}, // Marquee
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x05, 0x00, 0xFF, 0x64}, // Covering Marquee
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x06, 0x00, 0xFF, 0x64}, // Pulse
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x07, 0x00, 0xFF, 0x64}, // Wave
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x08, 0x00, 0xFF, 0x64}, // Alternating
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x09, 0x00, 0xFF, 0x64}, // Candle
|
||||
};
|
||||
|
||||
static unsigned char speed_mode_data[][9] =
|
||||
{
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // Static
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Breathing
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Fading
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Marquee
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Covering Marquee
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Pulse
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Wave
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Alternating
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 } // Candle
|
||||
};
|
||||
|
||||
EKController::EKController(hid_device* dev_handle, wchar_t *_vendor, wchar_t *_device_name, char *_path)
|
||||
{
|
||||
int tmp_size = wcslen(_vendor);
|
||||
std::size_t tmp_size = wcslen(_vendor);
|
||||
|
||||
dev = dev_handle;
|
||||
|
||||
for(int i=0; (i < tmp_size) && (i < EK_DEVICE_NAME_SIZE); i++)
|
||||
for(std::size_t i = 0; (i < tmp_size) && (i < EK_DEVICE_NAME_SIZE); i++)
|
||||
{
|
||||
device_name[i] = (char)_vendor[i];
|
||||
}
|
||||
|
||||
for(int j=0; (j < wcslen(_vendor)) && ((tmp_size + j) < EK_DEVICE_NAME_SIZE); j++)
|
||||
for(std::size_t j = 0; (j < wcslen(_vendor)) && ((tmp_size + j) < EK_DEVICE_NAME_SIZE); j++)
|
||||
{
|
||||
device_name[tmp_size+j] = (char)_device_name[j];
|
||||
device_name[tmp_size + j] = (char)_device_name[j];
|
||||
}
|
||||
|
||||
location = _path;
|
||||
|
||||
current_mode = EK_MODE_STATIC;
|
||||
current_mode = EK_MODE_STATIC;
|
||||
current_speed = EK_SPEED_NORMAL;
|
||||
}
|
||||
|
||||
|
|
@ -76,15 +111,15 @@ void EKController::SendUpdate()
|
|||
unsigned char buffer[EK_PACKET_LENGTH] = { 0x00 };
|
||||
int buffer_size = (sizeof(buffer) / sizeof(buffer[0]));
|
||||
|
||||
for(int i = 0; i < EK_COLOUR_MODE_DATA_SIZE; i++)
|
||||
for(std::size_t i = 0; i < EK_COLOUR_MODE_DATA_SIZE; i++)
|
||||
{
|
||||
buffer[i] = colour_mode_data[current_mode][i];
|
||||
}
|
||||
|
||||
//Set the relevant colour info
|
||||
buffer[EK_RED_BYTE] = current_red;
|
||||
buffer[EK_RED_BYTE] = current_red;
|
||||
buffer[EK_GREEN_BYTE] = current_green;
|
||||
buffer[EK_BLUE_BYTE] = current_blue;
|
||||
buffer[EK_BLUE_BYTE] = current_blue;
|
||||
buffer[EK_SPEED_BYTE] = speed_mode_data[current_mode][current_speed];
|
||||
|
||||
buffer[10] = 0x10;
|
||||
|
|
|
|||
|
|
@ -39,41 +39,6 @@ enum
|
|||
EK_MODE_CANDLE = 0x08 //Candle Mode
|
||||
};
|
||||
|
||||
static unsigned char colour_mode_data[][16] =
|
||||
{
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x01, 0x00, 0xFF, 0x64}, // Static
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x02, 0x00, 0xFF, 0x64}, // Breathing
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x03, 0xFF, 0xFF, 0x64}, // Fading
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x04, 0x00, 0xFF, 0x64}, // Marquee
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x05, 0x00, 0xFF, 0x64}, // Covering Marquee
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x06, 0x00, 0xFF, 0x64}, // Pulse
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x07, 0x00, 0xFF, 0x64}, // Wave
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x08, 0x00, 0xFF, 0x64}, // Alternating
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x09, 0x00, 0xFF, 0x64}, // Candle
|
||||
};
|
||||
|
||||
static unsigned char speed_mode_data[][9] =
|
||||
{
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // Static
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Breathing
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Fading
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Marquee
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Covering Marquee
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Pulse
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Wave
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Alternating
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 } // Candle
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
EK_SPEED_SLOWEST = 0x00, // Slowest speed
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ void HyperXAlloyOriginsController::SendDirectColorPacket
|
|||
/*-----------------------------------------------------*\
|
||||
| Copy in color data |
|
||||
\*-----------------------------------------------------*/
|
||||
for(int color_idx = 0; color_idx < color_count; color_idx++)
|
||||
for(unsigned int color_idx = 0; color_idx < color_count; color_idx++)
|
||||
{
|
||||
buf[(color_idx * 4) + 1] = 0x81;
|
||||
buf[(color_idx * 4) + 2] = RGBGetRValue(color_data[color_idx]);
|
||||
|
|
@ -128,4 +128,4 @@ void HyperXAlloyOriginsController::SendDirectColorPacket
|
|||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_send_feature_report(dev, buf, 65);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ std::string NZXTHue2Controller::GetFirmwareVersion()
|
|||
void NZXTHue2Controller::SendFan
|
||||
(
|
||||
unsigned char port,
|
||||
unsigned char mode,
|
||||
unsigned char /*mode*/,
|
||||
unsigned char speed
|
||||
)
|
||||
{
|
||||
|
|
@ -120,7 +120,7 @@ void NZXTHue2Controller::UpdateDeviceList()
|
|||
ret_val = hid_read(dev, usb_buf, sizeof(usb_buf));
|
||||
} while( (ret_val != 64) || (usb_buf[0] != 0x21) || (usb_buf[1] != 0x03) );
|
||||
|
||||
for(int chan = 0; chan < num_rgb_channels; chan++)
|
||||
for(unsigned int chan = 0; chan < num_rgb_channels; chan++)
|
||||
{
|
||||
unsigned int start = 0x0F + (6 * chan);
|
||||
unsigned int num_leds_on_channel = 0;
|
||||
|
|
@ -179,7 +179,7 @@ void NZXTHue2Controller::UpdateStatus()
|
|||
/*-----------------------------------------------------*\
|
||||
| Extract fan information |
|
||||
\*-----------------------------------------------------*/
|
||||
for(int fan_idx = 0; fan_idx < num_fan_channels; fan_idx++)
|
||||
for(unsigned int fan_idx = 0; fan_idx < num_fan_channels; fan_idx++)
|
||||
{
|
||||
unsigned char cmd;
|
||||
unsigned short rpm;
|
||||
|
|
|
|||
|
|
@ -61,9 +61,9 @@ void RGBFusion2DRAMController::Apply()
|
|||
|
||||
void RGBFusion2DRAMController::SetLEDEffect
|
||||
(
|
||||
unsigned int led,
|
||||
unsigned int /*led*/,
|
||||
int mode,
|
||||
unsigned int speed,
|
||||
unsigned int /*speed*/,
|
||||
unsigned char red,
|
||||
unsigned char green,
|
||||
unsigned char blue
|
||||
|
|
@ -75,4 +75,4 @@ void RGBFusion2DRAMController::SetLEDEffect
|
|||
led_data[RGB_FUSION_2_DRAM_IDX_BLUE] = blue;
|
||||
|
||||
bus->i2c_smbus_write_block_data(dev, RGB_FUSION_2_DRAM_LED_START_ADDR, 32, led_data);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ void SapphireGPUController::SetColor(unsigned char red, unsigned char green, uns
|
|||
bus->i2c_smbus_write_byte_data(dev, SAPPHIRE_GPU_REG_BLUE, blue);
|
||||
}
|
||||
|
||||
void SapphireGPUController::SetMode(unsigned char mode, unsigned char speed)
|
||||
void SapphireGPUController::SetMode(unsigned char mode, unsigned char /*speed*/)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, SAPPHIRE_GPU_REG_MODE, mode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,12 +18,12 @@
|
|||
|
||||
bool TestForSapphireGPUController(i2c_smbus_interface* bus, unsigned char address)
|
||||
{
|
||||
bool pass = false;
|
||||
int res;
|
||||
//bool pass = false;
|
||||
//int res;
|
||||
|
||||
if(bus->i2c_smbus_read_byte_data(address, 0x06) == 0xCC)
|
||||
{
|
||||
pass = true;
|
||||
//pass = true;
|
||||
}
|
||||
|
||||
return(false); //TODO - better detection, leaving disabled for now
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
static void send_usb_msg(hid_device* dev, char * data_pkt, unsigned int size)
|
||||
{
|
||||
char* usb_pkt = new char[16];
|
||||
unsigned char usb_pkt[16];
|
||||
memset(usb_pkt, 0x00, sizeof(usb_pkt));
|
||||
|
||||
// Report number
|
||||
|
|
@ -30,9 +30,7 @@ static void send_usb_msg(hid_device* dev, char * data_pkt, unsigned int size)
|
|||
usb_pkt[4 + i] = data_pkt[1 + i];
|
||||
}
|
||||
|
||||
hid_write(dev, (unsigned char *)usb_pkt, 16);
|
||||
|
||||
delete[] usb_pkt;
|
||||
hid_write(dev, usb_pkt, 16);
|
||||
}
|
||||
|
||||
SteelSeriesSiberiaController::SteelSeriesSiberiaController
|
||||
|
|
|
|||
|
|
@ -9,6 +9,18 @@
|
|||
|
||||
#include "TecknetController.h"
|
||||
|
||||
static unsigned char tecknet_colour_mode_data[][16] =
|
||||
{
|
||||
{ 0x02, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00 }, // Static
|
||||
{ 0x02, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00 }, // Breathing
|
||||
};
|
||||
|
||||
static unsigned char tecknet_speed_mode_data[][9] =
|
||||
{
|
||||
{ 0x00, 0x00, 0x00, 0x00 }, // Static
|
||||
{ 0x00, 0x06, 0x03, 0x01 }, // Breathing
|
||||
};
|
||||
|
||||
TecknetController::TecknetController(hid_device* dev_handle, char *_path)
|
||||
{
|
||||
const int szTemp = 256;
|
||||
|
|
@ -79,17 +91,17 @@ void TecknetController::SendUpdate()
|
|||
unsigned char buffer[TECKNET_PACKET_LENGTH] = { 0x00 };
|
||||
int buffer_size = (sizeof(buffer) / sizeof(buffer[0]));
|
||||
|
||||
for(int i = 0; i < TECKNET_COLOUR_MODE_DATA_SIZE; i++)
|
||||
for(std::size_t i = 0; i < TECKNET_COLOUR_MODE_DATA_SIZE; i++)
|
||||
{
|
||||
buffer[i] = tecknet_colour_mode_data[current_mode][i];
|
||||
}
|
||||
|
||||
//Set the relevant colour info
|
||||
buffer[TECKNET_RED_BYTE] = current_red;
|
||||
buffer[TECKNET_GREEN_BYTE] = current_green;
|
||||
buffer[TECKNET_BLUE_BYTE] = current_blue;
|
||||
buffer[TECKNET_RED_BYTE] = current_red;
|
||||
buffer[TECKNET_GREEN_BYTE] = current_green;
|
||||
buffer[TECKNET_BLUE_BYTE] = current_blue;
|
||||
buffer[TECKNET_BRIGHTNESS_BYTE] = current_brightness;
|
||||
buffer[TECKNET_SPEED_BYTE] = tecknet_speed_mode_data[current_mode][current_speed];
|
||||
buffer[TECKNET_SPEED_BYTE] = tecknet_speed_mode_data[current_mode][current_speed];
|
||||
|
||||
hid_send_feature_report(dev, buffer, buffer_size);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,18 +41,6 @@ enum
|
|||
TECKNET_BRIGHTNESS_HIGH = 0x03
|
||||
};
|
||||
|
||||
static unsigned char tecknet_colour_mode_data[][16] =
|
||||
{
|
||||
{ 0x02, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00 }, // Static
|
||||
{ 0x02, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00 }, // Breathing
|
||||
};
|
||||
|
||||
static unsigned char tecknet_speed_mode_data[][9] =
|
||||
{
|
||||
{ 0x00, 0x00, 0x00, 0x00 }, // Static
|
||||
{ 0x00, 0x06, 0x03, 0x01 }, // Breathing
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
TECKNET_SPEED_OFF = 0x00, // Breathe Off
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ enum
|
|||
TECKNET_USAGE_PAGE = 3
|
||||
};
|
||||
|
||||
static const unsigned int tecknet_pids[][4] =
|
||||
static const int tecknet_pids[][4] =
|
||||
{ // PID, Interface, Usage, Usage_Page
|
||||
{ TECKNET_M0008_PID, 0, TECKNET_M0008_U, TECKNET_M0008_UPG } //Tecknet M008 Mouse
|
||||
};
|
||||
|
|
|
|||
|
|
@ -373,7 +373,7 @@ void NetworkClient::ListenThreadFunction()
|
|||
{
|
||||
int tmp_bytes_read = 0;
|
||||
|
||||
tmp_bytes_read = recv_select(client_sock, &data[bytes_read], header.pkt_size - bytes_read, 0);
|
||||
tmp_bytes_read = recv_select(client_sock, &data[(unsigned int)bytes_read], header.pkt_size - bytes_read, 0);
|
||||
|
||||
if(tmp_bytes_read <= 0)
|
||||
{
|
||||
|
|
@ -404,9 +404,9 @@ listen_done:
|
|||
server_initialized = false;
|
||||
server_connected = false;
|
||||
|
||||
for(int server_controller_idx = 0; server_controller_idx < server_controllers.size(); server_controller_idx++)
|
||||
for(size_t server_controller_idx = 0; server_controller_idx < server_controllers.size(); server_controller_idx++)
|
||||
{
|
||||
for(int controller_idx = 0; controller_idx < controllers.size(); controller_idx++)
|
||||
for(size_t controller_idx = 0; controller_idx < controllers.size(); controller_idx++)
|
||||
{
|
||||
if(controllers[controller_idx] == server_controllers[server_controller_idx])
|
||||
{
|
||||
|
|
|
|||
|
|
@ -438,7 +438,7 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
|
|||
{
|
||||
int tmp_bytes_read = 0;
|
||||
|
||||
tmp_bytes_read = recv_select(client_sock, &data[bytes_read], header.pkt_size - bytes_read, 0);
|
||||
tmp_bytes_read = recv_select(client_sock, &data[(unsigned int)bytes_read], header.pkt_size - bytes_read, 0);
|
||||
|
||||
if(tmp_bytes_read <= 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -231,6 +231,7 @@ HEADERS += \
|
|||
RGBController/RGBController_SteelSeriesApex.h \
|
||||
RGBController/RGBController_Tecknet.h \
|
||||
RGBController/RGBController_ThermaltakeRiing.h \
|
||||
RGBController/OpenRazerDevices.h \
|
||||
|
||||
SOURCES += \
|
||||
dependencies/dmiinfo.cpp \
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
#define RAZER_MAX_ZONES 6
|
||||
|
||||
#include <string>
|
||||
#include "RGBController.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
std::string name;
|
||||
|
|
|
|||
|
|
@ -357,7 +357,7 @@ unsigned char * RGBController::GetDeviceDescription()
|
|||
/*---------------------------------------------------------*\
|
||||
| Copy in matrix map |
|
||||
\*---------------------------------------------------------*/
|
||||
for(int matrix_idx = 0; matrix_idx < (zones[zone_index].matrix_map->height * zones[zone_index].matrix_map->width); matrix_idx++)
|
||||
for(unsigned int matrix_idx = 0; matrix_idx < (zones[zone_index].matrix_map->height * zones[zone_index].matrix_map->width); matrix_idx++)
|
||||
{
|
||||
memcpy(&data_buf[data_ptr], &zones[zone_index].matrix_map->map[matrix_idx], sizeof(zones[zone_index].matrix_map->map[matrix_idx]));
|
||||
data_ptr += sizeof(zones[zone_index].matrix_map->map[matrix_idx]);
|
||||
|
|
@ -677,7 +677,7 @@ void RGBController::ReadDeviceDescription(unsigned char* data_buf)
|
|||
\*---------------------------------------------------------*/
|
||||
new_map->map = new unsigned int[new_map->height * new_map->width];
|
||||
|
||||
for(int matrix_idx = 0; matrix_idx < (new_map->height * new_map->width); matrix_idx++)
|
||||
for(unsigned int matrix_idx = 0; matrix_idx < (new_map->height * new_map->width); matrix_idx++)
|
||||
{
|
||||
memcpy(&new_map->map[matrix_idx], &data_buf[data_ptr], sizeof(new_map->map[matrix_idx]));
|
||||
data_ptr += sizeof(new_map->map[matrix_idx]);
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ void RGBController_AuraCore::SetupZones()
|
|||
Keyboard.matrix_map = NULL;
|
||||
zones.push_back(Keyboard);
|
||||
|
||||
for(int led_idx = 0; led_idx < Keyboard.leds_count; led_idx++)
|
||||
for(unsigned int led_idx = 0; led_idx < Keyboard.leds_count; led_idx++)
|
||||
{
|
||||
led KeyLED;
|
||||
KeyLED.name = "Keyboard LED ";
|
||||
|
|
|
|||
|
|
@ -98,12 +98,12 @@ void RGBController_CorsairHydro::DeviceUpdateLEDs()
|
|||
DeviceUpdateMode();
|
||||
}
|
||||
|
||||
void RGBController_CorsairHydro::UpdateZoneLEDs(int zone)
|
||||
void RGBController_CorsairHydro::UpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_CorsairHydro::UpdateSingleLED(int led)
|
||||
void RGBController_CorsairHydro::UpdateSingleLED(int /*led*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
|
@ -133,4 +133,4 @@ void RGBController_CorsairHydro::DeviceUpdateMode()
|
|||
corsair->SetPulse(modes[active_mode].colors, modes[active_mode].speed);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -227,16 +227,18 @@ void RGBController_DuckyKeyboard::SetupZones()
|
|||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_DuckyKeyboard::ResizeZone(int zone, int new_size)
|
||||
void RGBController_DuckyKeyboard::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| This device does not support resizing zones |
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_DuckyKeyboard::DeviceUpdateLEDs()
|
||||
{
|
||||
unsigned char colordata[155*3];
|
||||
|
||||
for(int color_idx = 0; color_idx < colors.size(); color_idx++)
|
||||
for(std::size_t color_idx = 0; color_idx < colors.size(); color_idx++)
|
||||
{
|
||||
colordata[(color_idx*3)+0] = RGBGetRValue(colors[color_idx]);
|
||||
colordata[(color_idx*3)+1] = RGBGetGValue(colors[color_idx]);
|
||||
|
|
@ -246,12 +248,12 @@ void RGBController_DuckyKeyboard::DeviceUpdateLEDs()
|
|||
ducky->SendColors(colordata, sizeof(colordata));
|
||||
}
|
||||
|
||||
void RGBController_DuckyKeyboard::UpdateZoneLEDs(int zone)
|
||||
void RGBController_DuckyKeyboard::UpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_DuckyKeyboard::UpdateSingleLED(int led)
|
||||
void RGBController_DuckyKeyboard::UpdateSingleLED(int /*led*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
|
@ -264,4 +266,4 @@ void RGBController_DuckyKeyboard::SetCustomMode()
|
|||
void RGBController_DuckyKeyboard::DeviceUpdateMode()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ RGBController_E131::RGBController_E131(std::vector<E131Device> device_list)
|
|||
case E131_MATRIX_ORDER_HORIZONTAL_TOP_RIGHT:
|
||||
for(unsigned int y = 0; y < new_map->height; y++)
|
||||
{
|
||||
for(unsigned int x = new_map->width - 1; x >= 0; x--)
|
||||
for(int x = new_map->width - 1; x >= 0; x--)
|
||||
{
|
||||
new_map->map[(y * new_map->width) + x] = led_idx;
|
||||
led_idx++;
|
||||
|
|
@ -114,7 +114,7 @@ RGBController_E131::RGBController_E131(std::vector<E131Device> device_list)
|
|||
}
|
||||
break;
|
||||
case E131_MATRIX_ORDER_HORIZONTAL_BOTTOM_LEFT:
|
||||
for(unsigned int y = new_map->height; y >= 0; y--)
|
||||
for(int y = new_map->height; y >= 0; y--)
|
||||
{
|
||||
for(unsigned int x = 0; x < new_map->width; x++)
|
||||
{
|
||||
|
|
@ -124,9 +124,9 @@ RGBController_E131::RGBController_E131(std::vector<E131Device> device_list)
|
|||
}
|
||||
break;
|
||||
case E131_MATRIX_ORDER_HORIZONTAL_BOTTOM_RIGHT:
|
||||
for(unsigned int y = new_map->height; y >= 0; y--)
|
||||
for(int y = new_map->height; y >= 0; y--)
|
||||
{
|
||||
for(unsigned int x = new_map->width - 1; x >= 0; x--)
|
||||
for(int x = new_map->width - 1; x >= 0; x--)
|
||||
{
|
||||
new_map->map[(y * new_map->width) + x] = led_idx;
|
||||
led_idx++;
|
||||
|
|
@ -144,7 +144,7 @@ RGBController_E131::RGBController_E131(std::vector<E131Device> device_list)
|
|||
}
|
||||
break;
|
||||
case E131_MATRIX_ORDER_VERTICAL_TOP_RIGHT:
|
||||
for(unsigned int x = new_map->width - 1; x >= 0; x--)
|
||||
for(int x = new_map->width - 1; x >= 0; x--)
|
||||
{
|
||||
for(unsigned int y = 0; y < new_map->height; y++)
|
||||
{
|
||||
|
|
@ -156,7 +156,7 @@ RGBController_E131::RGBController_E131(std::vector<E131Device> device_list)
|
|||
case E131_MATRIX_ORDER_VERTICAL_BOTTOM_LEFT:
|
||||
for(unsigned int x = 0; x < new_map->width; x++)
|
||||
{
|
||||
for(unsigned int y = new_map->height - 1; y >= 0; y++)
|
||||
for(int y = new_map->height - 1; y >= 0; y--)
|
||||
{
|
||||
new_map->map[(y * new_map->width) + x] = led_idx;
|
||||
led_idx++;
|
||||
|
|
@ -164,9 +164,9 @@ RGBController_E131::RGBController_E131(std::vector<E131Device> device_list)
|
|||
}
|
||||
break;
|
||||
case E131_MATRIX_ORDER_VERTICAL_BOTTOM_RIGHT:
|
||||
for(unsigned int x = new_map->width - 1; x >= 0; x--)
|
||||
for(int x = new_map->width - 1; x >= 0; x--)
|
||||
{
|
||||
for(unsigned int y = new_map->height - 1; y >= 0; y--)
|
||||
for(int y = new_map->height - 1; y >= 0; y--)
|
||||
{
|
||||
new_map->map[(y * new_map->width) + x] = led_idx;
|
||||
led_idx++;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ int RGBController_GalaxGPU::GetDeviceMode()
|
|||
{
|
||||
int modereg1 = galax_gpu->GalaxGPURegisterRead(GALAX_MODE_REGISTER_1);
|
||||
int modereg2 = galax_gpu->GalaxGPURegisterRead(GALAX_MODE_REGISTER_2);
|
||||
int color_mode = MODE_COLORS_PER_LED;
|
||||
|
||||
if (modereg1 == GALAX_MODE_STATIC_VALUE_1 && modereg2 == GALAX_MODE_STATIC_VALUE_2)
|
||||
{
|
||||
|
|
@ -38,7 +37,6 @@ int RGBController_GalaxGPU::GetDeviceMode()
|
|||
modes[active_mode].color_mode = MODE_COLORS_NONE;
|
||||
}
|
||||
|
||||
|
||||
return(active_mode);
|
||||
}
|
||||
|
||||
|
|
@ -46,7 +44,6 @@ RGBController_GalaxGPU::RGBController_GalaxGPU(GalaxGPUController * galax_gpu_pt
|
|||
{
|
||||
galax_gpu = galax_gpu_ptr;
|
||||
|
||||
|
||||
name = galax_gpu->GetDeviceName();
|
||||
type = DEVICE_TYPE_GPU;
|
||||
description = "GALAX / KFA2 RTX GPU";
|
||||
|
|
|
|||
|
|
@ -269,9 +269,11 @@ void RGBController_HyperXAlloyOrigins::SetupZones()
|
|||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_HyperXAlloyOrigins::ResizeZone(int zone, int new_size)
|
||||
void RGBController_HyperXAlloyOrigins::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| This device does not support resizing zones |
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_HyperXAlloyOrigins::DeviceUpdateLEDs()
|
||||
|
|
@ -279,12 +281,12 @@ void RGBController_HyperXAlloyOrigins::DeviceUpdateLEDs()
|
|||
hyperx->SetLEDsDirect(colors);
|
||||
}
|
||||
|
||||
void RGBController_HyperXAlloyOrigins::UpdateZoneLEDs(int zone)
|
||||
void RGBController_HyperXAlloyOrigins::UpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_HyperXAlloyOrigins::UpdateSingleLED(int led)
|
||||
void RGBController_HyperXAlloyOrigins::UpdateSingleLED(int /*led*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ void RGBController_LogitechG810::DeviceUpdateLEDs()
|
|||
/*---------------------------------------------------------*\
|
||||
| TODO: Send packets with multiple LED frames |
|
||||
\*---------------------------------------------------------*/
|
||||
for(int led_idx = 0; led_idx < leds.size(); led_idx++)
|
||||
for(std::size_t led_idx = 0; led_idx < leds.size(); led_idx++)
|
||||
{
|
||||
zone = ( leds[led_idx].value >> 8 );
|
||||
idx = ( leds[led_idx].value & 0xFF );
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
\*-----------------------------------------*/
|
||||
|
||||
#include "RGBController_OpenRazer.h"
|
||||
#include "OpenRazerDevices.h"
|
||||
|
||||
#include <fstream>
|
||||
#include <unistd.h>
|
||||
|
|
@ -398,9 +399,9 @@ void RGBController_OpenRazer::SetupZones()
|
|||
|
||||
new_map->map = new unsigned int[new_map->height * new_map->width];
|
||||
|
||||
for(int y = 0; y < new_map->height; y++)
|
||||
for(unsigned int y = 0; y < new_map->height; y++)
|
||||
{
|
||||
for(int x = 0; x < new_map->width; x++)
|
||||
for(unsigned int x = 0; x < new_map->width; x++)
|
||||
{
|
||||
new_map->map[(y * new_map->width) + x] = (y * new_map->width) + x;
|
||||
}
|
||||
|
|
@ -428,7 +429,7 @@ void RGBController_OpenRazer::SetupZones()
|
|||
|
||||
if(device_list[device_index]->keymap != NULL)
|
||||
{
|
||||
for(int i = 0; i < device_list[device_index]->keymap_size; i++)
|
||||
for(unsigned int i = 0; i < device_list[device_index]->keymap_size; i++)
|
||||
{
|
||||
if(zone_id == device_list[device_index]->keymap[i].zone &&
|
||||
row_id == device_list[device_index]->keymap[i].row &&
|
||||
|
|
@ -468,7 +469,7 @@ void RGBController_OpenRazer::SetCustomMode()
|
|||
\*---------------------------------------------------------*/
|
||||
else
|
||||
{
|
||||
for(int i = 0; i < modes.size(); i++)
|
||||
for(unsigned int i = 0; i < modes.size(); i++)
|
||||
{
|
||||
if(modes[i].value == RAZER_MODE_STATIC)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "OpenRazerDevices.h"
|
||||
|
||||
#include <fstream>
|
||||
|
||||
|
|
|
|||
|
|
@ -346,9 +346,9 @@ void RGBController_OpenRazer::SetupZones()
|
|||
|
||||
new_map->map = new unsigned int[new_map->height * new_map->width];
|
||||
|
||||
for(int y = 0; y < new_map->height; y++)
|
||||
for(unsigned int y = 0; y < new_map->height; y++)
|
||||
{
|
||||
for(int x = 0; x < new_map->width; x++)
|
||||
for(unsigned int x = 0; x < new_map->width; x++)
|
||||
{
|
||||
new_map->map[(y * new_map->width) + x] = (y * new_map->width) + x;
|
||||
}
|
||||
|
|
@ -376,7 +376,7 @@ void RGBController_OpenRazer::SetupZones()
|
|||
|
||||
if(device_list[device_index]->keymap != NULL)
|
||||
{
|
||||
for(int i = 0; i < device_list[device_index]->keymap_size; i++)
|
||||
for(unsigned int i = 0; i < device_list[device_index]->keymap_size; i++)
|
||||
{
|
||||
if(zone_id == device_list[device_index]->keymap[i].zone &&
|
||||
row_id == device_list[device_index]->keymap[i].row &&
|
||||
|
|
@ -416,7 +416,7 @@ void RGBController_OpenRazer::SetCustomMode()
|
|||
\*---------------------------------------------------------*/
|
||||
else
|
||||
{
|
||||
for(int i = 0; i < modes.size(); i++)
|
||||
for(unsigned int i = 0; i < modes.size(); i++)
|
||||
{
|
||||
if(modes[i].value == RAZER_MODE_STATIC)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ void RGBController_RGBFusion2USB::Init_Controller()
|
|||
std::vector<LedPort> lp = zl->second;
|
||||
int LED_count = 0; //We're going to count the leds in the zone
|
||||
bool boolSingleLED = true; //If all the Ledport.count == 1 then the zone is ZONE_TYPE_SINGLE
|
||||
for(int lp_idx = 0; lp_idx < lp.size(); lp_idx++)
|
||||
for(std::size_t lp_idx = 0; lp_idx < lp.size(); lp_idx++)
|
||||
{
|
||||
int lp_count = lp[lp_idx].count;
|
||||
boolSingleLED = boolSingleLED && (lp_count == 1); //Is this a single LED zone??
|
||||
|
|
@ -241,7 +241,7 @@ void RGBController_RGBFusion2USB::SetupZones()
|
|||
controller->DisableBuiltinEffect(0, 0x3);
|
||||
}
|
||||
|
||||
for(int lp_idx = 0; lp_idx < zones[zone_idx].leds_count; lp_idx++)
|
||||
for(unsigned int lp_idx = 0; lp_idx < zones[zone_idx].leds_count; lp_idx++)
|
||||
{
|
||||
led new_led;
|
||||
|
||||
|
|
@ -310,7 +310,7 @@ void RGBController_RGBFusion2USB::UpdateZoneLEDs(int zone)
|
|||
unsigned char grn = 0;
|
||||
unsigned char blu = 0;
|
||||
|
||||
for(size_t led_idx = 0; led_idx < zones[zone].leds_count; led_idx++)
|
||||
for(std::size_t led_idx = 0; led_idx < zones[zone].leds_count; led_idx++)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Initialize mode value |
|
||||
|
|
@ -455,11 +455,12 @@ void RGBController_RGBFusion2USB::DeviceUpdateMode()
|
|||
int RGBController_RGBFusion2USB::GetLED_Zone(int led_idx)
|
||||
{
|
||||
//This may be more useful in the abstract RGBController.cpp
|
||||
for(int zone_idx = 0; zone_idx < zones.size(); zone_idx++)
|
||||
for(size_t zone_idx = 0; zone_idx < 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)
|
||||
return(zone_idx);
|
||||
}
|
||||
return -1; // NotFound error?
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ void RGBController_SteelSeriesRival::DeviceUpdateMode()
|
|||
{
|
||||
/* Strictly, the device actually does support different modes for the
|
||||
* different zones, but we don't support that. */
|
||||
steelseries_type mouse_type = rival->GetMouseType();
|
||||
//steelseries_type mouse_type = rival->GetMouseType();
|
||||
switch (modes[active_mode].value)
|
||||
{
|
||||
case STEELSERIES_RIVAL_STATIC:
|
||||
|
|
|
|||
22
cli.cpp
22
cli.cpp
|
|
@ -700,7 +700,7 @@ int ProcessOptions(int argc, char *argv[], Options *options, std::vector<Network
|
|||
std::string ip = argument.substr(0, pos);
|
||||
unsigned short port_val;
|
||||
|
||||
if(pos == -1)
|
||||
if(pos == argument.npos)
|
||||
{
|
||||
port_val = OPENRGB_SDK_PORT;
|
||||
}
|
||||
|
|
@ -748,14 +748,22 @@ int ProcessOptions(int argc, char *argv[], Options *options, std::vector<Network
|
|||
{
|
||||
if (argument != "")
|
||||
{
|
||||
unsigned short port = std::stoi(argument);
|
||||
if (port >= 1024 && port <= 65535)
|
||||
try
|
||||
{
|
||||
options->servOpts.port = port;
|
||||
}
|
||||
else
|
||||
int port = std::stoi(argument);
|
||||
if (port >= 1024 && port <= 65535)
|
||||
{
|
||||
options->servOpts.port = port;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Error: Port out of range: " << port << " (1024-65535)" << std::endl;
|
||||
return RET_FLAG_PRINT_HELP;
|
||||
}
|
||||
}
|
||||
catch(std::invalid_argument& e)
|
||||
{
|
||||
std::cout << "Error: port out of range: " << port << " (1024-65535)" << std::endl;
|
||||
std::cout << "Error: Invalid data in --server-port argument (expected a number in range 1024-65535)" << std::endl;
|
||||
return RET_FLAG_PRINT_HELP;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -159,8 +159,6 @@ s32 i2c_smbus_interface::i2c_smbus_write_i2c_block_data(u8 addr, u8 command, u8
|
|||
|
||||
s32 i2c_smbus_interface::i2c_smbus_xfer_call(u8 addr, char read_write, u8 command, int size, i2c_smbus_data* data)
|
||||
{
|
||||
s32 ret_val = 0;
|
||||
|
||||
i2c_smbus_xfer_mutex.lock();
|
||||
|
||||
i2c_addr = addr;
|
||||
|
|
@ -179,8 +177,6 @@ s32 i2c_smbus_interface::i2c_smbus_xfer_call(u8 addr, char read_write, u8 comman
|
|||
i2c_smbus_done_cv.wait(done_lock, [this]{ return i2c_smbus_done.load(); });
|
||||
i2c_smbus_done = false;
|
||||
|
||||
ret_val = i2c_ret;
|
||||
|
||||
i2c_smbus_xfer_mutex.unlock();
|
||||
|
||||
return(i2c_ret);
|
||||
|
|
|
|||
2
main.cpp
2
main.cpp
|
|
@ -190,7 +190,7 @@ int main(int argc, char* argv[])
|
|||
|
||||
dlg.AddClientTab();
|
||||
|
||||
for(int client_idx = 0; client_idx < clients.size(); client_idx++)
|
||||
for(std::size_t client_idx = 0; client_idx < clients.size(); client_idx++)
|
||||
{
|
||||
dlg.AddClient(clients[client_idx]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ public:
|
|||
|
||||
OpenRGBClientInfoPage::OpenRGBClientInfoPage(std::vector<RGBController *>& control, QWidget *parent) :
|
||||
QFrame(parent),
|
||||
controllers(control),
|
||||
ui(new Ui::OpenRGBClientInfoPageUi)
|
||||
ui(new Ui::OpenRGBClientInfoPageUi),
|
||||
controllers(control)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Set initial values for GUI fields |
|
||||
|
|
@ -80,7 +80,7 @@ void OpenRGBClientInfoPage::UpdateInfo()
|
|||
/*-----------------------------------------------------*\
|
||||
| Loop through all clients in list and display them |
|
||||
\*-----------------------------------------------------*/
|
||||
for(int client_idx = 0; client_idx < rgb_clients.size(); client_idx++)
|
||||
for(std::size_t client_idx = 0; client_idx < rgb_clients.size(); client_idx++)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the top level tree widget items and display the|
|
||||
|
|
@ -106,7 +106,7 @@ void OpenRGBClientInfoPage::UpdateInfo()
|
|||
/*-----------------------------------------------------*\
|
||||
| Add child items for each device in the client |
|
||||
\*-----------------------------------------------------*/
|
||||
for(int dev_idx = 0; dev_idx < rgb_clients[client_idx]->server_controllers.size(); dev_idx++)
|
||||
for(std::size_t dev_idx = 0; dev_idx < rgb_clients[client_idx]->server_controllers.size(); dev_idx++)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Create child tree widget items and display the device |
|
||||
|
|
@ -118,7 +118,7 @@ void OpenRGBClientInfoPage::UpdateInfo()
|
|||
/*-----------------------------------------------------*\
|
||||
| Add child items for each zone in the device |
|
||||
\*-----------------------------------------------------*/
|
||||
for(int zone_idx = 0; zone_idx < rgb_clients[client_idx]->server_controllers[dev_idx]->zones.size(); zone_idx++)
|
||||
for(std::size_t zone_idx = 0; zone_idx < rgb_clients[client_idx]->server_controllers[dev_idx]->zones.size(); zone_idx++)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Create child tree widget items and display the zone |
|
||||
|
|
|
|||
|
|
@ -205,6 +205,11 @@ void Ui::OpenRGBDevicePage::on_ZoneBox_currentIndexChanged(int /*index*/)
|
|||
|
||||
void Ui::OpenRGBDevicePage::on_LEDBox_currentIndexChanged(int index)
|
||||
{
|
||||
if(index < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Read selected mode |
|
||||
\*-----------------------------------------------------*/
|
||||
|
|
@ -214,11 +219,11 @@ void Ui::OpenRGBDevicePage::on_LEDBox_currentIndexChanged(int index)
|
|||
{
|
||||
case MODE_COLORS_PER_LED:
|
||||
{
|
||||
int selected_zone = ui->ZoneBox->currentIndex();
|
||||
bool multiple = index == device->leds.size() + 1;
|
||||
int selected_zone = ui->ZoneBox->currentIndex();
|
||||
bool multiple = (std::size_t(index) == (device->leds.size() + 1));
|
||||
|
||||
RGBColor color = 0x00000000;
|
||||
bool updateColor = 0;
|
||||
RGBColor color = 0x00000000;
|
||||
bool updateColor = 0;
|
||||
|
||||
if(device->zones.size() > 1)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ void Ui::OpenRGBSystemInfoPage::on_DetectButton_clicked()
|
|||
current_index = 0;
|
||||
}
|
||||
|
||||
if(busses.size() > current_index)
|
||||
if((int)(busses.size()) > current_index)
|
||||
{
|
||||
i2c_smbus_interface* bus = busses[current_index];
|
||||
|
||||
|
|
@ -80,7 +80,7 @@ void Ui::OpenRGBSystemInfoPage::on_DumpButton_clicked()
|
|||
current_index = 0;
|
||||
}
|
||||
|
||||
if(busses.size() > current_index)
|
||||
if((int)(busses.size()) > current_index)
|
||||
{
|
||||
i2c_smbus_interface* bus = busses[current_index];
|
||||
unsigned char address = ui->DumpAddressBox->value();
|
||||
|
|
@ -98,7 +98,7 @@ void Ui::OpenRGBSystemInfoPage::on_ReadButton_clicked()
|
|||
current_index = 0;
|
||||
}
|
||||
|
||||
if(busses.size() > current_index)
|
||||
if((int)(busses.size()) > current_index)
|
||||
{
|
||||
i2c_smbus_interface* bus = busses[current_index];
|
||||
unsigned char address = ui->ReadAddressBox->value();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue