Skip to content

AP_Logger: Refactor the process #29981

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions libraries/AP_Logger/AP_Logger_MAVLink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,7 @@ bool AP_Logger_MAVLink::free_seqno_from_queue(uint32_t seqno, dm_block_queue_t &

bool AP_Logger_MAVLink::WritesOK() const
{
if (!_sending_to_client) {
return false;
}
return true;
return _sending_to_client;
}

/* Write a block of data at current offset */
Expand Down Expand Up @@ -311,6 +308,7 @@ void AP_Logger_MAVLink::stats_init() {
stats.resends = 0;
stats_reset();
}

void AP_Logger_MAVLink::stats_reset() {
stats.state_free = 0;
stats.state_free_min = -1; // unsigned wrap
Expand Down Expand Up @@ -354,10 +352,7 @@ void AP_Logger_MAVLink::Write_DMS(AP_Logger_MAVLink &logger_mav)

void AP_Logger_MAVLink::stats_log()
{
if (!_initialised) {
return;
}
if (stats.collection_count == 0) {
if (!_initialised || stats.collection_count == 0) {
return;
Comment on lines -357 to 356
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't consolidate this

We end up with clauses which are ridiculously difficult to work out what they do.

}
Write_DMS(*this);
Expand Down Expand Up @@ -391,6 +386,7 @@ uint8_t AP_Logger_MAVLink::stack_size(struct dm_block *stack)
}
return ret;
}

uint8_t AP_Logger_MAVLink::queue_size(dm_block_queue_t queue)
{
return stack_size(queue.oldest);
Expand Down
Loading