1
0
Fork 0
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:
Nicholas Sherlock 2015-08-30 02:33:16 +12:00
parent f29b9dd329
commit 2b356a47dc

View file

@ -1332,8 +1332,16 @@ void handleBlackbox(void)
//Keep writing chunks of the system info headers until it returns true to signal completion
if (blackboxWriteSysinfo()) {
/*
* 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;
case BLACKBOX_STATE_PAUSED:
// Only allow resume to occur during an I-frame iteration, so that we have an "I" base to work from