Add sleep to OpenRazer driver to fix hangs updating certain devices

This commit is contained in:
Adam Honse 2020-05-31 16:20:35 -05:00
parent 8d29a40954
commit 32938ec2af
2 changed files with 13 additions and 0 deletions

View file

@ -12,6 +12,11 @@
#include <fstream>
#include <unistd.h>
static void Sleep(unsigned int milliseconds)
{
usleep(1000 * milliseconds);
}
void RGBController_OpenRazer::DeviceUpdateLEDs()
{
switch(matrix_type)
@ -73,6 +78,8 @@ void RGBController_OpenRazer::DeviceUpdateLEDs()
}
delete[] output_array;
Sleep(1);
}
if(matrix_type == RAZER_TYPE_MATRIX_FRAME)
@ -542,6 +549,8 @@ void RGBController_OpenRazer::UpdateMode()
matrix_effect_reactive.flush();
break;
}
Sleep(20);
}
break;

View file

@ -74,6 +74,8 @@ void RGBController_OpenRazer::DeviceUpdateLEDs()
}
delete[] output_array;
Sleep(1);
}
if(matrix_type == RAZER_TYPE_MATRIX_FRAME)
@ -482,6 +484,8 @@ void RGBController_OpenRazer::UpdateMode()
razer_functions->matrix_effect_reactive->store(razer_device, NULL, update_value, 1);
break;
}
Sleep(20);
}
break;