MCU : s12zvl
CW: 10.6
I need to convert a floating point variable ram to fraction value for Using Fraction Lib
float f_t1;
tFrac16 test_frac1,test_frac2 ;
f_t1=0.5;
test_frac1 = FRAC16(0.5); // <--- O.K
test_frac1 = FRAC16(f_t1) ; // Compile Err
How can i do ?
Solved! Go to Solution.
Hi Ahn,
I built your project from my side, I got error message:
this is because symbols such as __fcmp are supported in floating library only. while this project use integer library ansii.lib which doesn't support symbols.
So Fiona is correct, change ansii.lib(c_no_float support library) to ansif.lib(c_float support library) can correct the problem.
for HCS12z library usage of, see below:
my modified project is attached.
can this help you?
Have a great day,
Jennie Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello Ahn
Please choose the floating Point Library instead. Please open the Project Properties from ‘Project’ menu-> Properties. Then go to C/C++ Build-> Settings, under <Tool Settings> tab, go to S12Z Linker->Input, please replace :
"${MCUToolsBaseDir}/S12lisa_Support/s12lisac/lib_small/ansii.lib"
With:
"${MCUToolsBaseDir}/S12lisa_Support/s12lisac/lib_small/ansif.lib"
I also attached a simple example project for using FRAC16 macro.
Best Regards
Fiona Kuang
Technical Information & Commercial Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Ahn,
what error message do you have? can you please send a screenshot of it?
to solve the problem faster, can you please send your demo project here thus i can work on your issue directly. thanks!
Have a great day,
Jennie Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Ahn,
I built your project from my side, I got error message:
this is because symbols such as __fcmp are supported in floating library only. while this project use integer library ansii.lib which doesn't support symbols.
So Fiona is correct, change ansii.lib(c_no_float support library) to ansif.lib(c_float support library) can correct the problem.
for HCS12z library usage of, see below:
my modified project is attached.
can this help you?
Have a great day,
Jennie Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thank you Fast service
Pls check attached Proj.
Thanks your kindly service
Best Regards
……………………………………
Joseph Ahn(안연수)
Assistant Software Design Manager
Avnet Electronic Marketing.
Joseph.ahn@avnet.com<mailto:Joseph.ahn@avnet.com>
……………………………………
12th Floor, KBS Media Center, Maebongsan-ro 45 (Sangam-dong),
Mapo-gu, Seoul, 121-915, Korea
Direct:
82-2-6277-6395
Fax:
82-2-761-2133