Skip to content

Use float and not double in calcRxDelay#2725

Open
toofishes wants to merge 1 commit into
meshcore-dev:devfrom
toofishes:optimize-calc-rx-delay
Open

Use float and not double in calcRxDelay#2725
toofishes wants to merge 1 commit into
meshcore-dev:devfrom
toofishes:optimize-calc-rx-delay

Conversation

@toofishes

Copy link
Copy Markdown
  • Swaps constant double values for constant float values
  • Use powf instead of pow for the calcualation

On an ESP32 platform, this eliminates several implicit calls to the soft floating point routines __extendsfdf2, __subdf3, __floatunsidf, __muldf3, and __fixdfsi. After making the change, only the powf call remains. The code size also shrinks by ~80 bytes in a companion radio build.

This is quite similar to #2723 in terms of eliminating unnecessary use of double when float is appropriate.

* Swaps constant double values for constant float values
* Use `powf` instead of `pow` for the calcualation

On an ESP32 platform, this eliminates several implicit calls to the soft
floating point routines __extendsfdf2, __subdf3, __floatunsidf, __muldf3, and
__fixdfsi. After making the change, only the `powf` call remains. The code size
also shrinks by ~80 bytes in a companion radio build.
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