cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

ZoZu_4799626
New Contributor II

Hello,

我们正在使用PSoC4  CY8C4248LQI-BL583开发产品,需要使用BLE元件。BLE元件我们打算借用Cycling Sensor的配置,并借用其项目中的cps.c/cscs.c文件,但是在初步add file,进行编译的时候,发现几个错误如下:

Build error: conflicting types for 'CYBLE_CPS_POWER_MEASURE_T'

Build error: conflicting types for 'CYBLE_CPS_POWER_VECTOP_T'

Build error: conflicting types for 'powerMeasure'

 

然后双击error定位到如下代码,都在cps.h中:

CYBLE_CYPACKED typedef struct
{
uint16 flags; /* Mandatory */
int16 instantaneousPower; /* Mandatory, Unit is in watts with a resolution of 1 */
uint32 accumulatedTorque; /* Unit is in newton meters with a resolution of 1/32, send only low 2 bytes */
uint32 cumulativeWheelRevolutions; /* When present, these fields are always present as a pair */
uint16 lastWheelEventTime; /* Unit is in seconds with a resolution of 1/2048 */
uint32 accumulatedEnergy; /* Unit is in kilojoules with a resolution of 1, send only low 2 bytes */
}CYBLE_CYPACKED_ATTR CYBLE_CPS_POWER_MEASURE_T;

CYBLE_CYPACKED typedef struct
{
uint8 flags; /* Mandatory */
uint16 cumulativeCrankRevolutions;
uint16 lastCrankEventTime; /* Unit is in seconds with a resolution of 1/1024 */
}CYBLE_CYPACKED_ATTR CYBLE_CPS_POWER_VECTOP_T;

extern CYBLE_CPS_POWER_MEASURE_T powerMeasure;

 

然后我打开BLE Cycling Sensor示例项目,编译后发现没有这个错误提示的,请问是哪里配置出问题了吗?

谢谢!

 

0 Likes
1 Solution
Vison_Zhang
Moderator
Moderator

这个说不好,你最好提供一下可以复现问题的工程

View solution in original post

0 Likes
2 Replies
Vison_Zhang
Moderator
Moderator

这个说不好,你最好提供一下可以复现问题的工程

View solution in original post

0 Likes
ZoZu_4799626
New Contributor II

Hi 张工,

谢谢您!

原先这个编译错误,我重新使用code example后就没有了,然后尝试加入自己的代码,发现我在common.h中自定义结构体变量原型,然后就出现一个错误提示:Build error: conflicting types for 'SystemState_Struct'。

本来我想把工程附在这里,但是可能我们公司IT安全设置的原因,联系了我们的IT也一直没能解决,工程附件一直无法上传,您看能不能给我个邮箱,我发到您的邮箱里,麻烦您帮我看一下,是不是哪里的配置不对。

谢谢!

0 Likes