simpleBLEPeripheral_HandleKeys编译错误
时间:10-02
整理:3721RD
点击:
Error[Pe159]: declaration is incompatible with previous "simpleBLEPeripheral_HandleKeys" (declared at line 553)
代码如下,未改动:
//#if defined( CC2540_MINIDK )
case KEY_CHANGE:
simpleBLEPeripheral_HandleKeys( ((keyChange_t *)pMsg)->state, ((keyChange_t *)pMsg)->keys );
break;
//#endif // #if defined( CC2540_MINIDK )
//#if defined( CC2540_MINIDK )
static void simpleBLEPeripheral_HandleKeys( uint8 shift, uint8 keys )
{
(void)shift; // Intentionally unreferenced parameter
uint8 SK_Keys = keys;
。。。
请问大神为何会出现这种报错呀?
在调用函数之前声明 "simpleBLEPeripheral_HandleKeys"的原型,否则编译器将假设一个原型,当它遇到真正的函数定义时,就会出现这个声明和定义不匹配的报错。
无意间取消注释了声明处的预编译条件产生的错误,谢谢Viki Shi
//#if defined( CC2540_MINIDK )
不客气,解决就好:)