Improve responsivity at lower sample rates
This commit is contained in:
parent
f5001d53e4
commit
466003a283
@ -391,10 +391,14 @@ void RFThread::thread_main() {
|
|||||||
endSettingChange();
|
endSettingChange();
|
||||||
}
|
}
|
||||||
// do Rx
|
// do Rx
|
||||||
// get up to 256k samples per iteration
|
// get up to 256k samples per iteration; but don't spend more than 20ms
|
||||||
|
// doing so
|
||||||
|
auto rxstart = chrono::steady_clock::now();
|
||||||
temp_buf_ptr = temp_buf;
|
temp_buf_ptr = temp_buf;
|
||||||
for (int i = 0; i < 250; i++) {
|
for (int i = 0; i < 250; i++) {
|
||||||
temp_buf_ptr += rx_get_data(temp_buf_ptr);
|
temp_buf_ptr += rx_get_data(temp_buf_ptr);
|
||||||
|
if ((chrono::steady_clock::now() - rxstart) > chrono::milliseconds(20))
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
lock_guard<mutex> guard(sample_buf_mutex);
|
lock_guard<mutex> guard(sample_buf_mutex);
|
||||||
|
Loading…
Reference in New Issue
Block a user