完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
你好,有人能帮忙吗?我正在使用MPLAB E v3.35HARMonyV1_08_91XC32V1.42HarmonyConfiguratorV1.0.8.7这个数学库可以工作,但只有在“include math.h”从代码中被注释出来时。这导致编译器给出类似于“./src/app.c:326:44:warning:不兼容的内置函数'cosf'[默认启用]GridParamiter[DataSet].Ph1PowerFactor=cosf(Phase1_V_C_pos);”的警告。Y在空的“AppJoice(空)”函数中工作。它在“ValuePARSEDATA(int DataSet)”函数中不起作用。我不知道为什么或者它是编译器优化代码的结果。如果include math.h或“include DSP.H”和“include libq.h”中的任何一个,代码仍然编译,但是sqrt()和cosf()函数返回垃圾。短期修复我做了一个查找表,给出余弦函数的程度。代码现在报告电压、电流和功率。我想用标准库函数求平方根和余弦。
以上来自于百度翻译 以下为原文 Hi Can someone please help. I am using MPLAB E v3.35 Harmony V1_08_91 XC32 V1.42 Harmony Configurator V1.0.8.7 The math library will work but only if the “#include math.h” is remarked out of the code. This results in the compiler giving warnings similer to “../src/app.c:326:44: warning: incompatible implicit declaration of built-in function 'cosf' [enabled by default] GridParamiter[DataSet].Ph1PowerFactor = cosf(Phase1_V_C_pos);” This is repeated for the sqrt() function. The cosf function only works in the void “APP_Tasks ( void )” function. It does not work in the “void ParseData(int DataSet)” function. I don’t know why or if it is a result of the compiler optimizing the code. If the #include math.h or either of the “#include DSP.H” and the “#include libq.h” the code still compiles but the sqrt() and the cosf() functions return rubbish. Short term fix I have made a lookup table that gives the cosine function for degrees. The code now reports voltage, current and power. I wold like to use standard library functions for the square root and cosine. |
|
相关推荐
3个回答
|
|
|
可能与此有关:HTTP://www. McCHIP.COM/FUMMS/M600 074.ASPX
以上来自于百度翻译 以下为原文 Probably related to this: http://www.microchip.com/forums/m600074.aspx |
|
|
|
|
|
谢谢你的回复,你可能是对的。POST是指在编译器命令行中包含编译器标志“-fNO短双”。我不知道怎么做,因为我只使用了MPLABXCAN中的编译按钮,您可以给我关于如何编译编译器标记的说明。
以上来自于百度翻译 以下为原文 Thanks for your reply You are probably correct. the post refers to including the compiler flag "-fno-short-double" on the compiler command line. I don't know how to do this as I have only used the compile buttons within the MPLABx Can you possible give me instructions on how to include the compiler flag Thanks |
|
|
|
|
|
嗨,你说得很对。我使用了include
以上来自于百度翻译 以下为原文 Hi mlp you are quite correct. I used #include // #include // #include // #include I got the sqrt() to work GridParamiter[DataSet].Ph1VoltRMS = sqrt(GridParamiter[DataSet].Ph1VoltRMS); but only when all three above were commented out. I did not get the cosf() function to work so I had to make a lookup table GridParamiter[DataSet].Ph3PowerFactor = cosine[Phase3_V_C_pos]; this is not the best way and I would like to get things working as they should Any ideas are welcome and I will try them ASAP Thanks |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475 浏览 0 评论
5794 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1125浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1098浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
873浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 17:09 , Processed in 0.623073 second(s), Total 76, Slave 59 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1996