Floating Point Library

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Floating Point Library

跳至解决方案
2,651 次查看
v_dave
Contributor IV

Hello All,

 

OK, this should hopefully be a simple issue but I can't seem to find the answer.

 

I started a project with CW10.3 for the HCS08 CPU (S08AW60) and when I started the project wizard I did not select the floating point library.  Now I find myself wanting to use floating point for 1 calculation but I can't find the setting to use the correct floating point lib.

 

I am using the ADS1118 for thermocouple measurement and I need to calculate the internal temperature sensor value:

 

#include <float.h>

float Temp_Sensor;

int Sensor_Reading;

 

Temp_Sensor  = (float)Sensor_Reading * 0.03125;                                  //calculate degrees

 

When I compile this I get the following errors:

3402_3402.JPGCW10_3 FP_Errors.JPG

I am pretty certain the issue is the missing floating point library.

 

Can anyone tell me where I go to include the floating point libraries in my project?  I looked all through the project settings and don't see a "use floating point libraries" check box.

 

Thanks,

Dave

标签 (1)
标记 (3)
1 解答
1,635 次查看
BlackNight
NXP Employee
NXP Employee

Hello,

the different library file names are described in C:\Freescale\CW MCU v10.3\MCU\lib\hc08c\readme.txt.

Remove the __NO_FLOAT__ from the compiler preprocessor setting in the project options.

And in the linker Input settings change the library to the other one you want as described in the readme.txt.

This should do it.

在原帖中查看解决方案

2 回复数
1,636 次查看
BlackNight
NXP Employee
NXP Employee

Hello,

the different library file names are described in C:\Freescale\CW MCU v10.3\MCU\lib\hc08c\readme.txt.

Remove the __NO_FLOAT__ from the compiler preprocessor setting in the project options.

And in the linker Input settings change the library to the other one you want as described in the readme.txt.

This should do it.

1,635 次查看
v_dave
Contributor IV

Hello,

Thanks for the response.  I thought that was what I needed to do but I was not sure.  I searched the online help for __NO_FLOAT__ but did not find anything so I was not quite sure that would fix the issue.

I have removed it and now that part of my code seems to be compiling without any errors.

Thanks,

Dave

0 项奖励