-
Notifications
You must be signed in to change notification settings - Fork 17.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Global: Change the division of float values to multiplication #28258
base: master
Are you sure you want to change the base?
Global: Change the division of float values to multiplication #28258
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This overall looks good and matches the official coding guidelines. I believe all the exponents line up too.
@@ -603,7 +603,7 @@ int decodeECU_TelemetrySlow1PacketStructure(const void* _pg_pkt, ECU_TelemetrySl | |||
|
|||
// Input voltage in Volts | |||
// Range of voltage is 0.0f to 25.5f. | |||
_pg_user->voltage = float32ScaledFrom1UnsignedBytes(_pg_data, &_pg_byteindex, 0.0f, 1.0f/10.0f); | |||
_pg_user->voltage = float32ScaledFrom1UnsignedBytes(_pg_data, &_pg_byteindex, 0.0f, 0.1f); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Files in this directory are generated, I don't think we should change them. I think constant elimination will take care of this anyway.
We wil want this rebased on top of the other PR which does very similar things |
The other PR this will be rebased on: #26855 |
The STM32 is better at multiplication than division.