atof() does not work in MQX 4.1

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

atof() does not work in MQX 4.1

326 Views
troide
Contributor II

Hello Community,

I try to use atof() in MQX 4.1 but it seems it's not define there. Any idea how can I define it?

Cheers,

Sina

0 Kudos
1 Reply

208 Views
DavidS
NXP Employee
NXP Employee

Hi Sina,

What Kinetis device are you using?

What development tool are you using?

I did my test with TWR-K70F120M using CW10.6.

The user_config.h header for this Kinetis device has the #define's for MQXCFG_ENABLE_FP and MQX_INCLUDE_FLOATING_POINT_IO set to "1".

I had to add "#include <stdlib.h>" at top of file.  I've attached my example which started with the mqx/examples/lwadc project.  Look for "//DES" to see what I have made enhancements.

I had to update the Properties for the Librarian to use c9x_noio Model.

ScreenHunter_79 Oct. 07 10.52.gif

My terminal output has following:

ADC Test for TWRK70F120M

f=1823.403442 1823.40344 1823.403400 1823.4034  sf=1823.4034

f=1823.403442 1823.40344 1823.403400 1823.4034  sf=1823.4034

Regards,

David

0 Kudos