不会是把整个math库全编译进去了吧
使用exp
U16 Ch0,Ch1,lux;
Ch0=AdcDecode(a0);
Ch1=AdcDecode(a1);
lux=(U16)(5*(Ch0-Ch1)*0.39*exp(-0.181*Ch1*Ch1/(Ch0-Ch1)/(Ch0-Ch1)));
Program space used F68h ( 3944) of 1000h words ( 96.3%)
不用exp
U16 Ch0,Ch1,lux;
Ch0=AdcDecode(a0);
Ch1=AdcDecode(a1);
lux=(U16)(5*(Ch0-Ch1)*0.39*(-0.181*Ch1*Ch1/(Ch0-Ch1)/(Ch0-Ch1)));
Program space used B4Ah ( 2890) of 1000h words ( 70.6%)
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
我的myExp用时
10.8457mS
XC8的exp用时
14.6649mS
一周热门 更多>