Use 100ms delay between checking for results on all bflsc devices as the buffering of results mean checking more frequently just wastes CPU and causes more lock contention for only marginally better latencies.
Use the cgsleep reentrant function to sleep for bflsc between read results to account for time taken to perform reads.
On windows use the higher accuracy timegettime function to really get 1ms clock and timer accuracy.
Simplify cgsleep code for windows by using a typedef for cgtimer_t that resolves to clock resolution, using that internally.
Prepare sleep time on bflsc if no dev needs work yet to avoid busy waiting.
We should be using que_low to decrease scan sleep time in bflsc.
Check for thr->work_restart in restart_wait.
Sleep for half a work period only in bflsc_get_results if no dev is suitable.
Provide a timeval_to_cgtime helper function to reuse values.
Provide cgtimer_to_timeval helper functions.
Reuse times extracted from the clock in bflsc_get_results.
Revert "Reuse times extracted from the clock in bflsc_get_results."

This reverts commit 1d8235334d0bac696e91dc246af2aab9f1d35d36.

Monotonic clock does not return the same times as gettimeofday.
Increase the que_low watermarks on BFLSC for they are too low to keep the device busy on scanwork loops.
Import Aaron D. Gifford's fast sha256 implementation.
Carve out the unused portions of sha2 implementation.
BTB get version from Firmware
Merge pull request #478 from kanoi/btb

BTB get version from Firmware
Only grab a queued work item if we successfully grab the lock to submit work in bflsc_send_work
Quotient/remainder error in ms division.
Revert "Sleep for half a work period only in bflsc_get_results if no dev is suitable."

This reverts commit 974319454795979dad013c705ca9d53aae67668d.

Fine now that sleep works properly with the longer sleep.