mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-25 16:56:25 +08:00
Fixed missing count
This commit is contained in:
@@ -97,6 +97,14 @@ void mavlink_logbuffer_vasprintf(struct mavlink_logbuffer *lb, int severity, con
|
||||
lb->elems[end].severity = severity;
|
||||
vsnprintf(lb->elems[end].text, sizeof(lb->elems[0].text), fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
/* increase count */
|
||||
if (mavlink_logbuffer_is_full(lb)) {
|
||||
lb->start = (lb->start + 1) % lb->size; /* full, overwrite */
|
||||
|
||||
} else {
|
||||
++lb->count;
|
||||
}
|
||||
}
|
||||
|
||||
__EXPORT void mavlink_vasprintf(int _fd, int severity, const char *fmt, ...)
|
||||
|
||||
Reference in New Issue
Block a user