1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 00:35:39 +03:00

Fix truncated blackbox headers on fast looptimes/slow UARTs

As a consequence, now supports 19200 baud for Blackbox logging
This commit is contained in:
Nicholas Sherlock 2015-06-23 00:31:30 +12:00
parent 6e504ca52a
commit 94affd5841
6 changed files with 265 additions and 71 deletions

View file

@ -114,11 +114,6 @@ uint32_t flashfsGetSize()
return m25p16_getGeometry()->totalSize;
}
const flashGeometry_t* flashfsGetGeometry()
{
return m25p16_getGeometry();
}
static uint32_t flashfsTransmitBufferUsed()
{
if (bufferHead >= bufferTail)
@ -127,6 +122,27 @@ static uint32_t flashfsTransmitBufferUsed()
return FLASHFS_WRITE_BUFFER_SIZE - bufferTail + bufferHead;
}
/**
* Get the size of the largest single write that flashfs could ever accept without blocking or data loss.
*/
uint32_t flashfsGetWriteBufferSize()
{
return FLASHFS_WRITE_BUFFER_USABLE;
}
/**
* Get the number of bytes that can currently be written to flashfs without any blocking or data loss.
*/
uint32_t flashfsGetWriteBufferFreeSpace()
{
return flashfsGetWriteBufferSize() - flashfsTransmitBufferUsed();
}
const flashGeometry_t* flashfsGetGeometry()
{
return m25p16_getGeometry();
}
/**
* Write the given buffers to flash sequentially at the current tail address, advancing the tail address after
* each write.