-
-
Notifications
You must be signed in to change notification settings - Fork 158
Resolved bug of undefined ATTITUDE fields disabled flag for previous (4.5.1) BF firmware versions log #876
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
Conversation
… of undefined values
WalkthroughAdds Changes
Sequence Diagram(s)(Skipped — changes are a small mapping update and do not introduce multi-component sequential control flow.) Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (2)📓 Common learnings📚 Learning: 2025-09-29T19:52:17.402ZApplied to files:
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/flightlog.js (1)
1808-1810: Good fix for preventing undefined field access.Setting ATTITUDE and SERVO to
true(disabled) by default is the correct approach to prevent undefined behavior in older firmware versions where these fields don't exist. This ensures expressions like!that.isFieldDisabled().ATTITUDEevaluate correctly asfalsefor older firmware.Minor comment improvement
The comment could be slightly more precise:
- // define new version fields as disabled, to prevent using of undefined values + // Define newer firmware fields as disabled by default to prevent undefined behavior in older firmware
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/flightlog.js
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: ctzsnooze
Repo: betaflight/blackbox-log-viewer PR: 851
File: src/flightlog_fields_presenter.js:0-0
Timestamp: 2025-08-14T02:50:17.745Z
Learning: In the Betaflight blackbox log viewer, PT1K debug fields should use 0.xxx format with /1000 scaling for proper chart display, as confirmed by ctzsnooze for the FEEDFORWARD and FEEDFORWARD_LIMIT debug modes.
Learnt from: haslinghuis
Repo: betaflight/blackbox-log-viewer PR: 859
File: src/flightlog_fields_presenter.js:1315-1325
Timestamp: 2025-09-24T23:23:01.244Z
Learning: In the blackbox-log-viewer codebase, firmware version pre-release identifiers (like "-rc1", "-rc2") are stripped from the `firmwareVersion` property, so Betaflight 4.5.0-RC1 would be exposed as just "4.5.0" for version comparison purposes.
Learnt from: haslinghuis
Repo: betaflight/blackbox-log-viewer PR: 862
File: src/header_dialog.js:1400-1403
Timestamp: 2025-09-29T19:52:17.402Z
Learning: In the Betaflight blackbox-log-viewer codebase, the sysConfig.firmware property can be either a string or number. When comparing firmware versions for PID controller type selection, only integral parts are checked (e.g., >= 3, >= 2), so JavaScript's type coercion handles string-to-number comparisons correctly. The maintainer has confirmed this mixed-type approach is acceptable.
🔇 Additional comments (1)
src/flightlog.js (1)
1813-1825: Bit remapping logic is correct.The code properly reassigns disabled field flags for Betaflight 2025.12.0+: ATTITUDE takes bit 8, with ACC through SERVO shifted to bits 9–15. This version is used consistently across the codebase for feature gating, and the logic is sound.
|
log4.5.txt |
|
|
Preview URL: https://pr876.betaflight-blackbox.pages.dev |



The current BBExplorer has bug in BF 4.5.1 and older logs.
The ATTITUDE disabledFieldsFlags is undefined, and !that.isFieldDisabled().ATTITUDE value is true. As result, the computed fields have wrong values.
Bug fix: define ATTITUDE and SERVO disabledFieldsFlags as true for older BF firmware version.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.