Make GTU7 output channel buffer size configurable#19
Merged
Conversation
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] Update implementation for Gtu7 sensor and serial drivers
Make GTU7 output channel buffer size configurable
Jan 16, 2026
rustyeddy
approved these changes
Jan 16, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes the GTU7 GPS sensor output channel buffer size configurable, replacing the hardcoded 4-element buffer with a configurable Buf field that defaults to 16. This addresses GPS data loss issues when modules output at 1-10 Hz with slow consumers.
Changes:
- Added configurable
Buffield toGTU7Configwith default value of 16 - Removed unused dependencies (maciej/bme280, nfnt/resize, golang.org/x/image) that are only referenced in archived code
- Added comprehensive tests for buffer size configuration
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| sensors/gtu7.go | Added Buf field to config and logic to default to 16 when value is ≤ 0 |
| sensors/gtu7_test.go | Added comprehensive tests for default, custom, zero, and negative buffer sizes |
| go.mod | Removed unused direct dependencies and promoted golang.org/x/sys from indirect to direct |
| go.sum | Removed checksums for unused dependencies |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The GTU7 sensor hardcoded its output channel buffer to 4, which is insufficient for GPS modules outputting at 1-10 Hz when consumers are slow.
Changes
Buf intfield toGTU7Configwith default of 16NewGTU7to use configurable buffer sizeFollows the existing pattern from
VH400Config:Usage:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.