Changed detector to allow for usage / usage page detection

* Small correction to packet bytes in CMARGBcontroller.h to allow packet
to send 0x00 at first byte
* Rearranged modes in RGBController_CMARGBController.cpp to have single
colour modes first
This commit is contained in:
Chris
2020-11-01 21:03:25 +11:00
committed by Adam Honse
parent 547a35307e
commit 154f5afa44
4 changed files with 48 additions and 31 deletions

View File

@@ -153,9 +153,16 @@ void CMARGBController::SendUpdate()
buffer[CM_ARGB_FUNCTION_BYTE] = boolPassthru ? 0x02 : 0x01;
hid_write(dev, buffer, buffer_size);
hid_read_timeout(dev, buffer, buffer_size, CM_ARGB_INTERRUPT_TIMEOUT);
//hid_read_timeout(dev, buffer, buffer_size, CM_ARGB_INTERRUPT_TIMEOUT);
if ( boolARGB_header & !boolPassthru )
if ( boolPassthru )
{
//If setting pass thru mode send the init packet again
hid_write(dev, buffer, buffer_size);
hid_write(dev, buffer, buffer_size);
hid_write(dev, buffer, buffer_size);
}
else if ( boolARGB_header )
{
buffer[CM_ARGB_COMMAND_BYTE] = 0x0b; //ARGB sends 0x0b (1011) RGB sends 0x04 (0100)
buffer[CM_ARGB_FUNCTION_BYTE] = (false) ? 0x01 : 0x02; //This controls custom mode TODO