mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
Improve Blackbox header writing reliability
This commit is contained in:
parent
f29b9dd329
commit
2b356a47dc
1 changed files with 9 additions and 1 deletions
|
@ -1332,7 +1332,15 @@ void handleBlackbox(void)
|
||||||
|
|
||||||
//Keep writing chunks of the system info headers until it returns true to signal completion
|
//Keep writing chunks of the system info headers until it returns true to signal completion
|
||||||
if (blackboxWriteSysinfo()) {
|
if (blackboxWriteSysinfo()) {
|
||||||
blackboxSetState(BLACKBOX_STATE_RUNNING);
|
|
||||||
|
/*
|
||||||
|
* Wait for header buffers to drain completely before data logging begins to ensure reliable header delivery
|
||||||
|
* (overflowing circular buffers causes all data to be discarded, so the first few logged iterations
|
||||||
|
* could wipe out the end of the header if we weren't careful)
|
||||||
|
*/
|
||||||
|
if (blackboxDeviceFlush()) {
|
||||||
|
blackboxSetState(BLACKBOX_STATE_RUNNING);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BLACKBOX_STATE_PAUSED:
|
case BLACKBOX_STATE_PAUSED:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue