mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-02-24 18:27:05 -05:00
Replace Sleep() by std::thread::sleep_for()
This commit is contained in:
committed by
Adam Honse
parent
60baf6d05f
commit
b79ff124e6
@@ -10,16 +10,7 @@
|
||||
#include "GloriousModelOController.h"
|
||||
#include <cstring>
|
||||
|
||||
#ifdef WIN32
|
||||
#include <Windows.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
|
||||
static void Sleep(unsigned int milliseconds)
|
||||
{
|
||||
usleep(1000 * milliseconds);
|
||||
}
|
||||
#endif
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
GloriousModelOController::GloriousModelOController(hid_device* dev_handle)
|
||||
{
|
||||
@@ -139,7 +130,7 @@ void GloriousModelOController::SetLEDColor(RGBColor* color_buf)
|
||||
*/
|
||||
|
||||
hid_send_feature_report(dev, usb_buf, sizeof(usb_buf));
|
||||
Sleep(1);
|
||||
std::this_thread::sleep_for(1ms);
|
||||
}
|
||||
|
||||
void GloriousModelOController::SetMode(unsigned char mode,
|
||||
@@ -283,5 +274,5 @@ void GloriousModelOController::SetMode(unsigned char mode,
|
||||
}
|
||||
|
||||
hid_send_feature_report(dev, usb_buf, sizeof(usb_buf));
|
||||
Sleep(1);
|
||||
std::this_thread::sleep_for(1ms);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user