1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 00:05:33 +03:00

Merge branch 'blackbox-flash' of https://github.com/sherlockflight/cleanflight-dev into sherlockflight-blackbox-flash

This commit is contained in:
Dominic Clifton 2015-02-22 17:24:39 +00:00
commit 2f09b7d1d9
20 changed files with 1417 additions and 119 deletions

View file

@ -609,6 +609,10 @@ static void validateBlackboxConfig()
masterConfig.blackbox_rate_num /= div;
masterConfig.blackbox_rate_denom /= div;
}
if (masterConfig.blackbox_device >= BLACKBOX_DEVICE_END) {
masterConfig.blackbox_device = BLACKBOX_DEVICE_SERIAL;
}
}
void startBlackbox(void)
@ -642,6 +646,9 @@ void startBlackbox(void)
}
}
/**
* Begin Blackbox shutdown.
*/
void finishBlackbox(void)
{
if (blackboxState == BLACKBOX_STATE_RUNNING) {
@ -791,7 +798,8 @@ static bool sendFieldDefinition(const char * const *headerNames, unsigned int he
charsWritten = blackboxPrint("H Field ");
charsWritten += blackboxPrint(headerNames[xmitState.headerIndex]);
charsWritten += blackboxPrint(":");
blackboxWrite(':');
charsWritten++;
xmitState.u.fieldIndex++;
needComma = false;
@ -1122,7 +1130,7 @@ void handleBlackbox(void)
*
* Don't wait longer than it could possibly take if something funky happens.
*/
if (millis() > xmitState.u.startTime + 200 || isBlackboxDeviceIdle()) {
if (millis() > xmitState.u.startTime + 200 || blackboxDeviceFlush()) {
blackboxDeviceClose();
blackboxSetState(BLACKBOX_STATE_STOPPED);
}
@ -1130,6 +1138,11 @@ void handleBlackbox(void)
default:
break;
}
// Did we run out of room on the device? Stop!
if (isBlackboxDeviceFull()) {
blackboxSetState(BLACKBOX_STATE_STOPPED);
}
}
static bool canUseBlackboxWithCurrentConfiguration(void)