大家好、
当我使用 CC1310的 NORTOS 的 pininterrupt 例程时、我进行了以下修改:
void * mainThread (void * arg0)
{
/*打开 LED 引脚*/
ledPinHandle = PIN_OPEN (&ledPinState、ledPinTable);
if (!ledPinHandle){
/*初始化板 LED 引脚时出错*/
while (1);
}
buttonPinHandle = PIN_OPEN (buttonPinState、buttonPinTable);
if (!buttonPinHandle){
/*初始化按钮针脚时出错*/
while (1);
}
/*设置按钮引脚的回调*/
if (PIN_registerIntCb (buttonPinHandle、&buttonCallbackFxn)!= 0){
/*注册按钮回调函数时出错*/
while (1);
}
/*永久循环*/
while (1){
//SLEEP (1000);
睡眠(5);// 睡眠5秒
PIN_setOutputValue (ledPinHandle、Board_PIN_LED1、!PIN_getOutputValue (Board_PIN_LED1));// DIO7电平翻转
}
}
我将原始主循环中的 SLEEP (1000)替换为{SLEEP (5)和 PIN_setOutputValue (ledPinHandle、Board_PIN_LED1、!PIN_getOutputValue (Board_PIN_LED1))}
在测试期间、我 发现在芯片的睡眠期间、在中断被触发后、DIO7电平翻转 不会立即被执行、而是会在5秒的睡眠时间结束后被执行。
是否有任何方法可以在中断触发后立即结束睡眠并 在睡眠(5)后执行命令?
此致、
凯瑟琳