Created
May 3, 2017 05:45
-
-
Save b26168/79d7e18ce41de7b024cb76a14a37d758 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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