mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-13 02:54:09 +08:00
DataFlash: force messagewriters to completion
Setting a dataflash-file buffer size of less than or equal to 2kiB would cause the startup-messagewriter to never push any messages other than FMT out to the logs. This is a combination of the return values of critical_message_reserved_space and non_messagewriter_message_reserved_space This patch forces the startup messages out to the logs by ignoring the space constraints every 100ms
This commit is contained in:
committed by
Peter Barker
parent
fa5757f618
commit
fa7ba7ddbc
@@ -554,11 +554,15 @@ bool DataFlash_File::_WritePrioritisedBlock(const void *pBuffer, uint16_t size,
|
||||
// writing format messages out. It can always get back to us
|
||||
// with more messages later, so let's leave room for other
|
||||
// things:
|
||||
if (space < non_messagewriter_message_reserved_space()) {
|
||||
const uint32_t now = AP_HAL::millis();
|
||||
const bool must_dribble = (now - last_messagewrite_message_sent) > 100;
|
||||
if (!must_dribble &&
|
||||
space < non_messagewriter_message_reserved_space()) {
|
||||
// this message isn't dropped, it will be sent again...
|
||||
semaphore->give();
|
||||
return false;
|
||||
}
|
||||
last_messagewrite_message_sent = now;
|
||||
} else {
|
||||
// we reserve some amount of space for critical messages:
|
||||
if (!is_critical && space < critical_message_reserved_space()) {
|
||||
|
||||
Reference in New Issue
Block a user