Repository navigation
Conversation
The header declared motor[0..7], while the I and P frames write getMotorCount() values, up to MAX_SUPPORTED_MOTORS (12). With 9 to 12 motors and motor logging on, every frame carried more values than the header described, and no frame of the log decoded. The header now declares motor[8..11] behind four more conditions. The condition cache was a uint64_t already full on dual-gyro targets, so it becomes an array of 32-bit words sized for every condition. The MSP enum reference gets the new values (that enum's section only).
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
PR Summary by QodoBlackbox: declare up to 12 motors in log headers
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can keep summaries lean with Findings visible per group, which tucks the rest behind a View link |
|
RAM / Flash usage vs. base commit
See RAM/flash optimization guide for techniques to reduce usage. |
|
Test firmware build ready — commit Download firmware for PR #12127 251 targets built. Find your board's
|
The log header declares motor[0..7], but the I and P frames write
getMotorCount()motors, up toMAX_SUPPORTED_MOTORS(12). With 9 to 12 motors and motor logging on, every frame carries more values than the header describes, and nothing in the log decodes: on SITL with a 12-motor mixer, blackbox_decode read none of 681 frames.This declares motor[8..11] behind four more conditions,
AT_LEAST_MOTORS_9to12, with the same predictors and encodings as motors 1 to 7. The condition cache was auint64_tthat the dual-gyro targets already fill to the last bit, so it becomes an array of 32-bit words sized fromFLIGHT_LOG_FIELD_CONDITION_LAST, and a static assert tiesMAX_SUPPORTED_MOTORSto the 12 motors the header can now declare.With 8 motors or fewer the header is the same as before. The MSP enum reference (
inav_enums.json,inav_enums_ref.md) gets the new condition values; I regenerated only this enum's section, since a full regeneration also rewrites unrelated enums that were already out of date.Testing
SITL, blackbox to a file, decoded with the current blackbox_decode:
Unit tests pass. Built for MATEKF405SE, MATEKF722SE, KAKUTEF7, KAKUTEF7HDV, MATEKH743 and TBS_LUCID_H7_WING: flash -32 to -176 B (testing a bit in a 32-bit word takes less code than in a 64-bit one), RAM +0 to +8 B, ITCM unchanged on KAKUTEF7 and KAKUTEF7HDV.
Not tested on a real craft with more than 8 motors: if you fly one with the blackbox on, I'd like to know whether your logs decode with this.
blackbox-log-viewer reads these logs, but its motor lists stop at 8: it labels motor[7] "motor[8]" next to the real motor[8], shows motors 9 to 12 as raw values instead of percent, and leaves them out of the per-motor current and the activity bar.
Related: #12126, another case where P frames didn't match what decoders read from the header.