ThingSet / thingset-device-library

ThingSet library for resource-constrained devices written in C/C++
https://thingset.io/thingset-device-library/
Apache License 2.0
13 stars 6 forks source link

Add optional low-footprint printf float replacement #6

Closed martinjaeger closed 2 years ago

martinjaeger commented 3 years ago

Disabling float support in the firmware via Kconfig and using this replacement instead saved about 4.5 kB of flash during my tests.

Please double-check if the approach makes sense and if I may have missed any important edge cases.

martinjaeger commented 3 years ago

I'm converting this into a draft PR now. The function doesn't seem to be ready... For example 52.99 with precision set to 1 produces 52.10. We need to revisit the algorithm and add more test cases before merging.

martinjaeger commented 2 years ago

Zephyr now supports picolibc, which should provide a reliable solution for lower-footprint float printf.