自己定义的P0和P2口按钮外部中断函数,当下载按钮后无法实现中断,需要将HAL\Target\CC2530EB\Drivers\hal_key.c里的这段代码注释掉,下面已经是注释过后的代码。
/***************************************************************************************************
* INTERRUPT SERVICE ROUTINE
***************************************************************************************************/
/**************************************************************************************************
* @fn halKeyPort0Isr
*
* @brief Port0 ISR
*
* @param
*
* @return
**************************************************************************************************/
//HAL_ISR_FUNCTION( halKeyPort0Isr, P0INT_VECTOR )
//{
// if (HAL_KEY_SW_6_PXIFG & HAL_KEY_SW_6_BIT)
// {
// halProcessKeyInterrupt();
// }
//
// /*
// Clear the CPU interrupt flag for Port_0
// PxIFG has to be cleared before PxIF
// */
// HAL_KEY_SW_6_PXIFG = 0;
// HAL_KEY_CPU_PORT_0_IF = 0;
//}
//
//
///**************************************************************************************************
// * @fn halKeyPort2Isr
// *
// * @brief Port2 ISR
// *
// * @param
// *
// * @return
// **************************************************************************************************/
//HAL_ISR_FUNCTION( halKeyPort2Isr, P2INT_VECTOR )
//{
// if (HAL_KEY_JOY_MOVE_PXIFG & HAL_KEY_JOY_MOVE_BIT)
// {
// halProcessKeyInterrupt();
// }
//
// /*
// Clear the CPU interrupt flag for Port_2
// PxIFG has to be cleared before PxIF
// Notes: P2_1 and P2_2 are debug lines.
// */
// HAL_KEY_JOY_MOVE_PXIFG = 0;
// HAL_KEY_CPU_PORT_2_IF = 0;
//}
#else
void HalKeyInit(void){}
void HalKeyConfig(bool interruptEnable, halKeyCBack_t cback){}
uint8 HalKeyRead(void){ return 0;}
void HalKeyPoll(void){}
#endif /* HAL_KEY */