Skip to content

Instantly share code, notes, and snippets.

@b26168
Created May 3, 2017 05:45
Show Gist options
  • Save b26168/79d7e18ce41de7b024cb76a14a37d758 to your computer and use it in GitHub Desktop.
Save b26168/79d7e18ce41de7b024cb76a14a37d758 to your computer and use it in GitHub Desktop.
void ListenReadQueue()
{
while (true)
{
if (readQueue.empty)
{
continue;
}
readQueue.pop();
char readDataBuffer[MAX_DEVICE_BYTE_LENGTH] = { 0 };
ReadInputReport(readDataBuffer);
}
}
void WriteAndPushQueue()
{
while (!writeQueue.empty)
{
if (readQueue.size < MAX_IO_BUFFER)
{
readQueue.push(writeQueue.front());
WriteFeatureReport(writeQueue.front());
writeQueue.pop();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment