mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 01:05:27 +03:00
Added blackbox erase for flashchips
revert back initBlackbox Fixed blackbox erase when full. Change BOXBLACKBOXERASE to the end Blackbox erase changes Moved the ARM detect into the blackbox statemachine Added blackbox erase start and end beep Tab to space
This commit is contained in:
parent
51b19855dd
commit
22d11e35b2
10 changed files with 143 additions and 75 deletions
|
@ -66,6 +66,14 @@ static struct {
|
|||
|
||||
#endif
|
||||
|
||||
void blackboxOpen()
|
||||
{
|
||||
serialPort_t *sharedBlackboxAndMspPort = findSharedSerialPort(FUNCTION_BLACKBOX, FUNCTION_MSP);
|
||||
if (sharedBlackboxAndMspPort) {
|
||||
mspSerialReleasePortIfAllocated(sharedBlackboxAndMspPort);
|
||||
}
|
||||
}
|
||||
|
||||
void blackboxWrite(uint8_t value)
|
||||
{
|
||||
switch (blackboxConfig()->device) {
|
||||
|
@ -602,6 +610,43 @@ bool blackboxDeviceOpen(void)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Erase all blackbox logs
|
||||
*/
|
||||
void blackboxEraseAll(void)
|
||||
{
|
||||
switch (blackboxConfig()->device) {
|
||||
#ifdef USE_FLASHFS
|
||||
case BLACKBOX_DEVICE_FLASH:
|
||||
flashfsEraseCompletely();
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
//not supported
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check to see if erasing is done
|
||||
*/
|
||||
bool isBlackboxErased(void)
|
||||
{
|
||||
switch (blackboxConfig()->device) {
|
||||
#ifdef USE_FLASHFS
|
||||
case BLACKBOX_DEVICE_FLASH:
|
||||
return flashfsIsReady();
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
//not supported
|
||||
return true;
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the Blackbox logging device immediately without attempting to flush any remaining data.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue