BLE协议栈中OnBoard_KeyCallback函数
时间:10-02
整理:3721RD
点击:
请问 OnBoard_KeyCallback函数中为什么要加入这段代码,起到什么作用啊?
/* If any key is currently pressed down and interrupt is still enabled, disable interrupt and switch to polling */ if( keys != 0 ) { if( OnboardKeyIntEnable == HAL_KEY_INTERRUPT_ENABLE ) { OnboardKeyIntEnable = HAL_KEY_INTERRUPT_DISABLE; HalKeyConfig( OnboardKeyIntEnable, OnBoard_KeyCallback); } } /* If no key is currently pressed down and interrupt is disabled, enable interrupt and turn off polling */ else { if( OnboardKeyIntEnable == HAL_KEY_INTERRUPT_DISABLE ) { OnboardKeyIntEnable = HAL_KEY_INTERRUPT_ENABLE; HalKeyConfig( OnboardKeyIntEnable, OnBoard_KeyCallback); } }
今天又看了zigbee协议栈Z-stack,OnBoard_KeyCallback回调函数中却没有这一段,不知道为什么蓝牙和zigbee中的按键处理还不一样?求解释~
这个只是在板子初始化的时候打开了KEY的interrupt的开关,如果关掉HAL_KEY_INTERRUPT_ENABLE,应该就不会有按键中断产生了