Hello.
In my program I want print or save in file some variables.
When I program this above,it does not work.
float i=1.234;
printf ("Variable= %f", i);
Then, I need to program this:
float i=1.234;
int j;
i=1.234*1000;
j=i/1000;
i=i-(j*1000); //the operator % does not work.
printf ("Variable= %d.%d",j,i); //It work!
This situation occurs in printf and sprintf.
Anyone can solve it?
Thank you.
Solved! Go to Solution.
You will need to add the file mqx\source\fio\io_fp.c to the psp project as well (it should have been there).
Refer to page 128 of the MQX User's manual.
Add:
#define MQX_INCLUDE_FLOATING_POINT_IO 1
to user_config.h (make sure you add it to the correct file in the config directory, not in the lib directory).
Rebuild the PSP library. then rebuild the application.
Note: This will require additional stack space for the tasks calling printf.
Ok,Monday I will probe it.
Very thanks.
I have just to probe it.
I rebuild all libreries.
But when I recompile hvac_demoEVB for 52259, I can read thetwo next errors:
undefined _io_dtoe
undefined _io_dtof
both referenced from "io_do_print"
Thanks
You will need to add the file mqx\source\fio\io_fp.c to the psp project as well (it should have been there).
Yes. It is the solution.
I use MQX 3.2 with codewarrior 7.1.2.
I make this changes, and now it is work.
Thank you.