Repository navigation
MicroPython port: stm32 builds with single-precision floats link - #8
Merged
Merged
Conversation
LVGL's gesture recogniser calls the double sqrt(), and an stm32 firmware built with MICROPY_FLOAT_IMPL=single links only MicroPython's single-precision libm, which has sqrtf() and no sqrt(). The link failed on the Arduino Giga R1. The port now adds a sqrt() that calls sqrtf() to those builds only; gesture distances are pixels, so single precision is enough.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An stm32 firmware with LVGL and
MICROPY_FLOAT_IMPL=singlefailed to link: LVGL's gesture recogniser (src/indev/lv_indev_gesture.c) calls the doublesqrt(), and those builds link only MicroPython's single-precision libm, which hassqrtf()and nosqrt(). The MicroPython port now adds asqrt()that callssqrtf(), to stm32 builds with single-precision floats only. Gesture distances are in pixels, so single precision is enough. Ports that link a full libm don't get it, because a definition here would replace their own.I hit this building for the Arduino GIGA R1 (STM32H747). That firmware, built with this change, links and runs LVGL on the GIGA Display Shield. The port's source-check tests pass, one of them new. I haven't built another stm32 board with LVGL.