GPS: cache model and baudrate and skip full sweep every startup#10544
GPS: cache model and baudrate and skip full sweep every startup#10544HarukiToreda wants to merge 10 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c045e4a55b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR improves GPS startup responsiveness by persisting the last known-good GNSS model + baud rate to the filesystem and attempting a fast “cached verify” path on subsequent boots, avoiding a full model/baud sweep on every startup.
Changes:
- Add a versioned
/prefs/gps_probe_cache.datrecord to cache detected GNSS model and baud. - On boot, try cached model/baud first and actively/passively verify the GPS is present before trusting it.
- If cached verification fails, clear the cache and suppress full probing for the remainder of that boot (GPS marked not present until reboot).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/gps/GPS.h | Adds cache/probe helper declarations and new state to track cached model/baud and boot-latched outcomes. |
| src/gps/GPS.cpp | Implements cache load/save/clear, cached presence verification logic, and integrates the cached flow into GPS::setup() / GPS::runOnce(). |
|
Good idea. Just to note: changes to detection code of this extent should be tested on each GPS chip we support prior to merge. Testing hitlist:
|
Useful fix Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
So far tested on |
Description
Boot was spending too much time sweeping GPS models and baud rates every time, making nodes slugish and unresponsive on first boot.
This change keeps startup fast by remembering the last known-good GPS settings, while still verifying the cached value is real on each boot.
What changed
New GPS cache flow
/prefs/gps_probe_cache.dat.Setup/runtime behavior updates
GPS::setup()now:GPS::runOnce()now:Maintainability
How to test
GNSS Chips to test: