Skip to content

Refine serial transmission timing - #19

Open
da-Kai wants to merge 8 commits into
developmentfrom
feature/transmission-wait-timing
Open

da-Kai wants to merge 8 commits into
developmentfrom
feature/transmission-wait-timing

Conversation

@da-Kai

@da-Kai da-Kai commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Fix serial timing and refactor transmission delay handling

Reworked serial write pacing to use a target end time with calibrated fudge factors, combining coarse sleep and final busy-wait for better timing accuracy across short and long delays. The transmission wait API was simplified (no external start time), timing constants were normalized to doubles, and interruption/runtime issues during wait are now handled without breaking write flow.
@da-Kai da-Kai changed the title Refine serial transmission timing and simplify API Refine serial transmission timing Sep 7, 2026
@da-Kai
da-Kai requested a review from Howaner September 7, 2026 07:06
@da-Kai
da-Kai marked this pull request as draft September 7, 2026 07:06
Adjusts Modbus serial transmit pacing to use `LockSupport.parkNanos` for long waits and revises the sleep threshold/margin logic for better timing precision.
Replaces fixed long/short transmission fudge factors with a calibrated power-law wait model and explicit min/max bounds. It also adds timing thresholds for parkNanos vs busy-wait behavior, with updated comments explaining the empirical tuning for serial timing on constrained Linux/USB-RS485 setups.
@da-Kai
da-Kai marked this pull request as ready for review September 9, 2026 05:37
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.

2 participants