mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-26 01:35:41 +03:00
Stop Blackbox logging when flash fills up
This commit is contained in:
parent
80ea5e4419
commit
3b8e05fb46
5 changed files with 41 additions and 3 deletions
|
@ -457,8 +457,9 @@ bool blackboxDeviceOpen(void)
|
|||
break;
|
||||
#ifdef FLASHFS
|
||||
case BLACKBOX_DEVICE_FLASH:
|
||||
if (flashfsGetSize() == 0)
|
||||
if (flashfsGetSize() == 0 || isBlackboxDeviceFull()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
break;
|
||||
|
@ -509,3 +510,19 @@ bool isBlackboxDeviceIdle(void)
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool isBlackboxDeviceFull(void)
|
||||
{
|
||||
switch (masterConfig.blackbox_device) {
|
||||
case BLACKBOX_DEVICE_SERIAL:
|
||||
return false;
|
||||
|
||||
#ifdef FLASHFS
|
||||
case BLACKBOX_DEVICE_FLASH:
|
||||
return flashfsIsEOF();
|
||||
#endif
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue