mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-05-29 20:58:24 +00:00
Revise CaptureThread loop to not get stuck if SD write speed too slow.
This commit is contained in:
parent
f250f30ada
commit
4a348e2c6c
@ -134,12 +134,12 @@ private:
|
|||||||
StreamOutput stream { write_size_log2, buffer_count_log2 };
|
StreamOutput stream { write_size_log2, buffer_count_log2 };
|
||||||
|
|
||||||
while( !chThdShouldTerminate() ) {
|
while( !chThdShouldTerminate() ) {
|
||||||
chEvtWaitAny(EVT_MASK_CAPTURE_THREAD);
|
if( stream.available() >= write_size ) {
|
||||||
|
|
||||||
while( stream.available() >= write_size ) {
|
|
||||||
if( !transfer(stream, write_buffer.get()) ) {
|
if( !transfer(stream, write_buffer.get()) ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
chEvtWaitAny(EVT_MASK_CAPTURE_THREAD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user