Skip to content

Round Decent fixed-point values - #110

Merged
ODevStudio merged 1 commit into
mainfrom
odev/round-decent-values
Jul 29, 2026
Merged

Round Decent fixed-point values#110
ODevStudio merged 1 commit into
mainfrom
odev/round-decent-values

Conversation

@ODevStudio

Copy link
Copy Markdown
Collaborator

Summary

  • round Decent protocol values to the nearest tenth before encoding
  • preserve the existing finite-value handling and signed 16-bit clamping

Root cause

The shared encoder converted the scaled float with a direct integer cast, which truncates toward zero. Weight notifications such as 10.19 g were therefore encoded as 10.1 g instead of 10.2 g.

The shared change also makes voltage, gyro, and LED-response fixed-point values use the same correct rounding behavior.

Validation

  • pio run -e esp32s3

@ODevStudio
ODevStudio marked this pull request as ready for review July 27, 2026 15:18
@ODevStudio
ODevStudio merged commit 2b5ab5d into main Jul 29, 2026
2 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