Dear sir, I have a TWR-K21F120M
But, when I want to use floating-point operations, there will be an error
Thank you very much ~~
Hello 佑煊 黃,
Please, check settings in KDS.
these documents could help you solve your problem:
Printing Floating point values to fsl_debug_console FRDM-K64F
and printf() with float values
I hope it helps,
Best Regards,
Iva
Dear sir,
Sorry! I do not understand how to set this.
Thank you very much ~~
Dear 佑煊 黃,
Never mind. Please, try do it by this way:
Change std_prv.h to following:
#ifndef STD_FP_IO | //DES added #ifndef | |
#define STD_FP_IO 0 |
#endif
and change the value in Preprocessor STD_FP_IO = 1
Best Regards,
Iva
Dear sir,
I can not find the preprocessor options
Hi 佑煊,
Do you use CW10.6 ?
In you screenshot , where show the float error ?
And about the float configuration on CodeWarrior, you can select on here :
And i have test on my side (mk21fn1m0 - CW10.6), when define like your code (float tt; tt = 2.0f), it can work well.
So could you show detail the float error .
Best Regards,
Alice
------------------------------------------------------------------------------------------
If this post answers your question, please click the Correct Answer button.
-----------------------------------------------------------------------------------
If this post help your question, please click the helpful Answer button.