Revise CaptureThread loop to not get stuck if SD write speed too slow.

This commit is contained in:
Jared Boone 2016-04-27 10:12:21 -07:00
parent f250f30ada
commit 4a348e2c6c

View File

@ -134,12 +134,12 @@ private:
StreamOutput stream { write_size_log2, buffer_count_log2 };
while( !chThdShouldTerminate() ) {
chEvtWaitAny(EVT_MASK_CAPTURE_THREAD);
while( stream.available() >= write_size ) {
if( stream.available() >= write_size ) {
if( !transfer(stream, write_buffer.get()) ) {
return false;
}
} else {
chEvtWaitAny(EVT_MASK_CAPTURE_THREAD);
}
}