Skip to content

Round Decent fixed-point values#110

Draft
ODevStudio wants to merge 1 commit into
mainfrom
odev/round-decent-values
Draft

Round Decent fixed-point values#110
ODevStudio wants to merge 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

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