Skip to content

fix: guard debug[0-2] gyroUnfilt fallback to GYRO_SCALED mode only#159

Merged
nerdCopter merged 1 commit into
masterfrom
fix/debug-gyro-unfilt-guard
Jun 11, 2026
Merged

fix: guard debug[0-2] gyroUnfilt fallback to GYRO_SCALED mode only#159
nerdCopter merged 1 commit into
masterfrom
fix/debug-gyro-unfilt-guard

Conversation

@nerdCopter

Copy link
Copy Markdown
Owner

AI Generated pull-request

Summary

  • Guards debug[0-2] gyroUnfilt fallback so it only activates when debug_mode = GYRO_SCALED (6)
  • Previously the fallback was unconditional, producing incorrect unfiltered gyro analysis for any other debug mode (e.g. RC_SMOOTHING=7, ACCELEROMETER=4)
  • Adds named constant DEBUG_MODE_GYRO_SCALED = 6 to src/constants.rs
  • When debug_mode is absent from headers, fallback is allowed with an assumption warning
  • When debug_mode is present and ≠ 6, fallback is skipped with a clear console message

Closes #154

Changes

  • src/constants.rs: add DEBUG_MODE_GYRO_SCALED: u32 = 6
  • src/data_input/log_parser.rs: guard fallback assignment; fix None => parsed_debug[axis] to None if using_debug_fallback => parsed_debug[axis], None => None

Previously, debug[0-2] was unconditionally used as a fallback for
gyroUnfilt when dedicated gyroUnfilt columns were absent. This produced
incorrect unfiltered gyro analysis for any debug_mode other than
GYRO_SCALED (6), e.g. RC_SMOOTHING (7) or ACCELEROMETER (4), where
debug[0-2] does not contain raw gyro data.

Now the fallback is guarded: only proceeds when debug_mode=6, warns and
skips otherwise. When debug_mode is absent from headers, the fallback is
allowed with an assumption warning.

Add DEBUG_MODE_GYRO_SCALED = 6 named constant to src/constants.rs.

Closes #154

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@nerdCopter, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 21 minutes and 1 second. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a25ba1c7-f5b7-44d6-a8ea-8e6717b449fe

📥 Commits

Reviewing files that changed from the base of the PR and between 2f6be27 and 620f925.

📒 Files selected for processing (2)
  • src/constants.rs
  • src/data_input/log_parser.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/debug-gyro-unfilt-guard

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nerdCopter nerdCopter merged commit 0d47da9 into master Jun 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: guard debug[0-2] gyroUnfilt fallback against invalid debug mode

1 participant