Add delay in between packets to stop flickering
This commit is contained in:
parent
2d990ca037
commit
db50b1f568
1 changed files with 6 additions and 1 deletions
|
|
@ -31,6 +31,7 @@
|
|||
#define JGINYUE_RG_DEFAULT 0x01
|
||||
#define JGINYUE_RG_SWAP 0x00
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
JGINYUEInternalUSBController::JGINYUEInternalUSBController(hid_device* dev_handle, const char* path)
|
||||
{
|
||||
|
|
@ -151,7 +152,9 @@ void JGINYUEInternalUSBController::WriteZoneMode
|
|||
usb_buf[0x04] = device_config[Active_zone].Direction;
|
||||
usb_buf[0x05] = device_config[Active_zone].Direct_Mode_control;
|
||||
|
||||
hid_write(dev, usb_buf ,16);
|
||||
hid_write(dev, usb_buf, 16);
|
||||
|
||||
std::this_thread::sleep_for(5ms);
|
||||
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
|
|
@ -204,6 +207,8 @@ void JGINYUEInternalUSBController::DirectLEDControl
|
|||
|
||||
hid_write(dev, usb_buf, 16);
|
||||
|
||||
std::this_thread::sleep_for(5ms);
|
||||
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
usb_buf[0x00] = JGINYUE_USB_PER_LED_SET_COMMAND_HEADER;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue