由于中秋节假期,帖子审批以及工程师回复将会有所延迟,敬请谅解。

This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2530在协议栈中编程无法进入I/O口外部中断HAL_ISR_FUNCTION(ZMDPort01ISR, P0INT_VECTOR )

   

/****************************
//T1初始化与P0.1配置程序程序
***************************/
void InitialT1_P01(void)
{
//HalUARTWrite(0,uartbuf,16);

P0SEL |= 0x00; //配置成GPIO功能
P0DIR &= ~0x02; //配置成输入

P0IFG |= 0x00; //清除中断标志
PICTL = 0x00; //设置为上升沿触发中断 PICTL[1] = 0上升沿触发;PICTL[1] = 1下降沿触发

//初始化定时器1
T1CNTH = 0x00;
T1CNTL = 0x00;
T1CTL |= 0x09; //32分频;自动重装模式(0x0000->0xffff)

P0IEN |= 0x02; //使能P0_1引脚中断
IEN0 |= 0x80; //打开总中断
//EA = 1;
IEN1 |= 1<<5;
}


/******************************************************************************
P0.1端口中断服务函数
******************************************************************************/

HAL_ISR_FUNCTION(ZMDPort01ISR, P0INT_VECTOR )
{
if(P0IFG>0)
{
Port01ISR();
}
P0IFG = 0;
P0IF = 0;
osal_set_event(GenericApp_TaskID,SEND_DATA_EVENT);
}
//HAL_ISR_FUNC_PROTOTYPE(f,v);
//HAL_ISR_FUNC_PROTOTYPE(f,v);
void Port01ISR(void)
{
//uartbuf[30] = "Get in HaL_ISR !";
HalUARTWrite(0,uartbuf,16);

T1L = T1CNTL;
T1H = T1CNTH;
if(float_flag == 0)
{
t1 = T1H*256+T1L;
PICTL = 1; //设置为下降沿触发
}
else
{
t2 = T1H*256+T1L;
PICTL = 0; //设置为上升沿触发

HighTime[index] = t2 -t1;
index++;

if((t2 - t1) > 10000 && (t2 - t1 < 30000))index = 0;

if(index == 29)
{
index = 0;
flag = 1;
EA = 0;
}

}
float_flag = !float_flag;

}

您好,我写了一个单机版的I/O中断,可以实现检测外部中断信号,但是移植到协议栈中之后,就一直无法进入中断,请高手帮我看一下我的代码,哪里不对?