Skip to content

Fix RMC precedence flags not resetting when data unavailable#21

Merged
rustyeddy merged 4 commits intogtu7from
copilot/sub-pr-16-one-more-time
Jan 17, 2026
Merged

Fix RMC precedence flags not resetting when data unavailable#21
rustyeddy merged 4 commits intogtu7from
copilot/sub-pr-16-one-more-time

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 16, 2026

The haveRMCSpeed and haveRMCCourse flags were set once when RMC provided data but never cleared, preventing VTG sentences from updating speed/course when subsequent RMC sentences lacked those fields.

Changes

  • Reset precedence flags to false when RMC sentence fields are empty/NaN
  • Added test case verifying VTG fallback when RMC stops providing data

Implementation

if !math.IsNaN(fix.SpeedKnots) {
    last.SpeedKnots = fix.SpeedKnots
    last.SpeedMPS = fix.SpeedMPS
    haveRMCSpeed = true
} else {
    haveRMCSpeed = false  // Now resets per-sentence
}

This implements per-sentence precedence rather than sticky global state.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@rustyeddy rustyeddy marked this pull request as ready for review January 16, 2026 17:56
Copilot AI review requested due to automatic review settings January 16, 2026 17:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI and others added 2 commits January 16, 2026 18:00
Co-authored-by: rustyeddy <2903425+rustyeddy@users.noreply.github.com>
Co-authored-by: rustyeddy <2903425+rustyeddy@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on Gtu7 sensor and serial drivers implementation Fix RMC precedence flags not resetting when data unavailable Jan 16, 2026
Copilot AI requested a review from rustyeddy January 16, 2026 18:02
@rustyeddy rustyeddy merged commit dee1215 into gtu7 Jan 17, 2026
@rustyeddy rustyeddy deleted the copilot/sub-pr-16-one-more-time branch January 17, 2026 16:06
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.

3 participants