Make serial port settle delay configurable#24
Conversation
Co-authored-by: rustyeddy <2903425+rustyeddy@users.noreply.github.com>
Co-authored-by: rustyeddy <2903425+rustyeddy@users.noreply.github.com>
Co-authored-by: rustyeddy <2903425+rustyeddy@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
This PR makes the serial port settle delay configurable by adding a SettleDelay field to SerialConfig. The previously hard-coded 10ms delay after terminal configuration can now be customized or disabled based on hardware requirements.
Changes:
- Added
SettleDelayfield toSerialConfigwith documentation explaining its purpose and behavior (zero defaults to 10ms, negative disables) - Updated
configureTermiosto accept and apply the configurable settle delay - Cleaned up unused dependencies from
go.modandgo.sum
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
drivers/serial.go |
Added SettleDelay field to SerialConfig with clear documentation |
drivers/serial_linux.go |
Updated configureTermios signature and implementation to use configurable delay |
go.mod |
Promoted golang.org/x/sys to direct dependency, removed unused dependencies |
go.sum |
Synchronized with go.mod changes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| github.com/stretchr/testify v1.11.1 | ||
| github.com/warthog618/go-gpiocdev v0.9.1 | ||
| golang.org/x/image v0.23.0 | ||
| golang.org/x/sys v0.29.0 |
There was a problem hiding this comment.
The promotion of golang.org/x/sys from an indirect to a direct dependency is appropriate since it's imported directly in drivers/serial_linux.go. However, the removal of github.com/maciej/bme280, github.com/nfnt/resize, and golang.org/x/image appears unrelated to the stated PR purpose of making the serial port settle delay configurable. Consider separating dependency cleanup into a separate PR for clearer change tracking.
Addresses hard-coded 10ms sleep after serial port configuration in
configureTermios. The delay lacks documentation and cannot be adjusted for different hardware requirements or performance-sensitive applications.Changes:
SettleDelayfield toSerialConfigwith behavior:configureTermiosto use configurable delay parameterUsage:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.