完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
本帖最后由 一只耳朵怪 于 2018-6-11 17:16 编辑
#include "smopos.h" // Include header for the SMOPOS object #include "smopos_const.h" // Include header for the SMOPOS object #include "park.h" // Include header for the PARK object #include "ipark.h" // Include header for the IPARK object #include "pid_reg3.h" // Include header for the PIDREG3 object #include "clarke.h" // Include header for the CLARKE object #include "svgen_dq.h" // Include header for the SVGENDQ object #include "rampgen.h" // Include header for the RAMPGEN object #include "rmp_cntl.h" // Include header for the RMPCNTL object #include "volt_calc.h" // Include header for the PHASEVOLTAGE object #include "speed_est.h" // Include header for the SPEED_EStiMATION object #include "speed_fr.h" // Include header for the SPEED_MEAS_QEP object #if (DSP2803x_DEVICE_H==1) #include "f2803xileg_vdc.h" // Include header for the ILEG2DCBUSMEAS object #include "f2803xpwm.h" // Include header for the PWMGEN object #include "f2803xpwmdac.h" // Include header for the PWMGEN object #include "f2803xqep.h" // Include header for the QEP object #include "DSP2803x_EPwm_defines.h" // Include header for PWM defines #endif "HVPM_Sensorless.h" 里面包含了很多马达控制宏定义的函数,当我其他.C函数调用"HVPM_Sensorless.h" 时,会出现宏函数里的局部变量会重复定义。 "HVPM_Sensorless.h" 已经在main.c中调用,请问怎么解决,谢谢 错误信息见图 |
|
相关推荐
6个回答
|
|
除了把局部变量定义成全局变量,在头文件中extern外,还有什么办法?
|
|
|
|
楼主, 你好! 没有问题的。我的项目里就是这样做的,我有一个user_Def.c 和user_Def.h文件,user.h里面有调用"HVPM_Sensorless.h" ,user_Def.c 中有对 rc1等结构体进行操作,编译没有问题。只是要把其它的结构体变量声明为extern,估计楼主是否在其他文件里面包含了PeripheralHeaderIncludes.h文件? 例如: extern RMPCNTL rc1; extern RAMPGEN rg1; extern SMOPOS smo1; extern SPEED_ESTIMATION speed3; extern PARK park1 ; extern IPARK ipark1 ; |
|
|
|
Ehunt 发表于 2018-6-11 07:01 你的"HVPM_Sensorless.h"除了在user.h里定义外,还在别的地方include了吗? |
|
|
|
你的"HVPM_Sensorless.h"除了在user.h里定义外,还在别的地方include了吗?比如在main.c中,也include了"HVPM_Sensorless.h"吗? |
|
|
|
am3x2k 发表于 2018-6-11 07:33 是的 ,main.c 里面也包含。如果你的项目过不了,可以贴上来我帮你看一下。 |
|
|
|
问题已经解决,需要把libs库函数升级到V4.0 |
|
|
|
只有小组成员才能发言,加入小组>>
TMS320F28377D:新做了以377d为芯片的板子,上电后芯片复位引脚出现方波请问如何解决?
1888 浏览 0 评论
TPS55340通电后输入端保险丝烧断,芯片输入和GND之间短路
3641 浏览 4 评论
5027 浏览 0 评论
请问如何用DM368对RGB格式的图片数据进行编码生成JPEG格式图片?
1732 浏览 1 评论
9353 浏览 8 评论
CC3100BOOST使用CC3200lunchXL进行烧录
664浏览 2评论
707浏览 1评论
TMS320F28034: 利用C2prog通过SCI给TMS320F28034烧录程序,出现错误提示:Bootloading... failed (invalid echo)!
668浏览 1评论
1186浏览 1评论
求DLPC350 Programmer’s Guide User's Guide 中文版说明书
1189浏览 1评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-4-19 12:22 , Processed in 0.926245 second(s), Total 74, Slave 65 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号