Fixed bug in rx_callback(), where time_stamp.tv_usec was sent through modulo before time_stamp.tv_sec was updated.

This commit is contained in:
Morten Shearman Kirkegaard
2017-08-22 17:17:45 +02:00
parent 97d3e65866
commit 161d8f77f4

View File

@ -252,8 +252,8 @@ int rx_callback(hackrf_transfer* transfer) {
(uint64_t)(num_samples + THROWAWAY_BLOCKS * SAMPLES_PER_BLOCK)
* j * FREQ_ONE_MHZ / DEFAULT_SAMPLE_RATE_HZ;
if(999999 < time_stamp.tv_usec) {
time_stamp.tv_usec = time_stamp.tv_usec % 1000000;
time_stamp.tv_sec += time_stamp.tv_usec / 1000000;
time_stamp.tv_usec = time_stamp.tv_usec % 1000000;
}
}
if(do_exit) {