mirror of
https://github.com/MatMoul/g810-led.git
synced 2024-12-23 17:26:11 +00:00
Another fix for G910s firmware crashes
This commit is contained in:
parent
d0c5b91815
commit
139af6c3b0
@ -623,12 +623,10 @@ bool LedKeyboard::sendDataInternal(byte_buffer_t &data) {
|
|||||||
#if defined(hidapi)
|
#if defined(hidapi)
|
||||||
data.insert(data.begin(), 0x00);
|
data.insert(data.begin(), 0x00);
|
||||||
if (hid_write(m_hidHandle, const_cast<unsigned char*>(data.data()), data.size()) < 0) {
|
if (hid_write(m_hidHandle, const_cast<unsigned char*>(data.data()), data.size()) < 0) {
|
||||||
std::cout<<"Error: Can not write to hidraw, try with the libusb version"<<std::endl;
|
std::cout<<"Error: Can not write to device. Exiting..."<<std::endl;
|
||||||
return false;
|
exit(1);
|
||||||
}
|
}
|
||||||
byte_buffer_t data2;
|
usleep(1100); // Do not remove or decrease this value below 1100 or there will be firmware crashes on G910.
|
||||||
data2.resize(21, 0x00);
|
|
||||||
hid_read_timeout(m_hidHandle, const_cast<unsigned char*>(data2.data()), data2.size(), 1);
|
|
||||||
return true;
|
return true;
|
||||||
#elif defined(libusb)
|
#elif defined(libusb)
|
||||||
if (data.size() > 20) {
|
if (data.size() > 20) {
|
||||||
|
Loading…
Reference in New Issue
Block a user