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.

CC2540 按键中断在主从机连接的情形下不能触发中断,为什么?

Other Parts Discussed in Thread: CC2540

其中主要判断代码如下:   

   if( current_adv_enabled_status == FALSE )

      {

        new_adv_enabled_status = TRUE;

       HalLedSet(HAL_LED_1|HAL_LED_2, HAL_LED_MODE_OFF );      //灭掉led1  

      }

      else

      {

        new_adv_enabled_status = FALSE;

      

        HalLedSet(HAL_LED_1|HAL_LED_2, HAL_LED_MODE_ON ); 

      }

 

 其中打开宏定义CC2540_MINIDK例子中,从机如果没有和主机连接。通过按键中断可以实现打开和关闭广播和led灯。但是当将从机和主机建立连接时候,按键中断不起作用了,不能控制灯开关和广播关闭。

ps:代码见图片!