This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

libfixmath nRF51 example project

This is probably a sign that I should upgrade to nRF52 (with a built-in FPU) but, in the meantime, does anybody have an example of the libfixmath library integrated with an nRF51. My attempts, so far, have resulted in compilation success but runtime failure.

In short, the problem that I am seeing is that every float that I convert into a fix16_t and then back into a float becomes '0' when I use NRF_LOG:

For example, my code reads:

NRF_LOG_RAW_INFO("fix-test: %f-%d\r\n", fix16_to_dbl(fix16_one));

And the output reads:

fix-test: 0.000000

So I have no idea what is going on. An example project that uses libfixmath would really help. Cheers!

Note: I'm trying to do this because the nRF51 series does not have a built-in FPU and libfixmath is supposed to be four times faster than using in-software floats.

Related