AP_Logger: address review commenst from #14299

This commit is contained in:
Andy Piper 2020-09-05 08:36:12 +01:00 committed by Peter Barker
parent 76ee7bec77
commit 5c554221c7
2 changed files with 5 additions and 3 deletions

View File

@ -530,7 +530,7 @@ bool AP_Logger_Backend::logging_enabled() const
void AP_Logger_Backend::Write_AP_Logger_Stats_File(const struct df_stats &_stats)
{
struct log_DSF pkt = {
const struct log_DSF pkt {
LOG_PACKET_HEADER_INIT(LOG_DF_FILE_STATS),
time_us : AP_HAL::micros64(),
dropped : _dropped,
@ -543,7 +543,8 @@ void AP_Logger_Backend::Write_AP_Logger_Stats_File(const struct df_stats &_stats
WriteBlock(&pkt, sizeof(pkt));
}
void AP_Logger_Backend::df_stats_gather(const uint16_t bytes_written, uint32_t space_remaining) {
void AP_Logger_Backend::df_stats_gather(const uint16_t bytes_written, uint32_t space_remaining)
{
if (space_remaining < stats.buf_space_min) {
stats.buf_space_min = space_remaining;
}

View File

@ -126,10 +126,11 @@ bool AP_Logger_Block::_WritePrioritisedBlock(const void *pBuffer, uint16_t size,
}
if (!write_sem.take(1)) {
_dropped++;
return false;
}
uint32_t space = writebuf.space();
const uint32_t space = writebuf.space();
if (_writing_startup_messages &&
_startup_messagewriter->fmt_done()) {