Skip to content

fix: thread remaining buffer through sync_read responses#9

Merged
jimsynz merged 1 commit intomainfrom
fix/sync-read-buffer-threading
Feb 8, 2026
Merged

fix: thread remaining buffer through sync_read responses#9
jimsynz merged 1 commit intomainfrom
fix/sync-read-buffer-threading

Conversation

@jimsynz
Copy link
Contributor

@jimsynz jimsynz commented Feb 8, 2026

Summary

  • At high baud rates (1Mbaud), multiple servo responses arrive faster than individual UART reads can consume them
  • The previous implementation discarded extra bytes after parsing each response, causing subsequent reads to fail or return corrupted data
  • Thread the remaining buffer from each read_sync_response into the next call
  • Propagate remaining bytes through receive_response for consistency

Test plan

  • All existing tests pass (mix check --no-retry)
  • Tested on hardware with 6 STS3215 servos at 1Mbaud — sync_read now returns correct values for all servos consistently

At high baud rates (1Mbaud), multiple servo responses arrive faster
than individual UART reads can consume them. The previous implementation
discarded any extra bytes received after parsing each response, causing
subsequent reads to fail or return corrupted data.

Thread the remaining buffer from each response parse into the next
read_sync_response call, and propagate remaining bytes through
receive_response for consistency.
@jimsynz jimsynz merged commit c77cd23 into main Feb 8, 2026
15 checks passed
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.

1 participant