Merge pull request #16 from n5ac/cpu_fix

Added usleep to connect thread to keep from taking all of the CPU
This commit is contained in:
haylztalez 2019-08-09 13:05:08 -05:00 committed by GitHub
commit 762297a7d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -784,7 +784,9 @@ static void * _thumbDV_connectThread( void * param )
FT_HANDLE handle = *(FT_HANDLE *) param;
while ( !_connectThreadAbort ) {
//TODO Handle reconnection
//waits 1 second before checking status to prevent CPU hogging
usleep(1000000);
ret = FT_GetStatus(handle, &rx_bytes, &tx_bytes, &event_dword);
if (ret != FT_OK) {