我从PM3模式唤醒后,在中断里打开了广播,但是手机还是搜不到蓝牙,请问这是为什么啊?怎么做,才可以唤醒后,打开广播。谢谢了
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.
我从PM3模式唤醒后,在中断里打开了广播,但是手机还是搜不到蓝牙,请问这是为什么啊?怎么做,才可以唤醒后,打开广播。谢谢了
#pragma vector = P2INT_VECTOR
__interrupt void P2_ISR(void)
{
P2_0_INTERRUPT_DISABLE();
P2_INTERRUPT_DISABLE();
ALL_INTERRUPT_DISABLE();
if(P2IFG & P2_0_BIT) //按键中断
{
P2_0_CLEAR_FLAG();
if(PICTL & 0x08)//如果是上升沿,则设为下降沿,
{
P2_FALLING_INTERRUPT();
PowerMode(3);
}
else
{
P2_RISING_INTERRUPT();//此时应该打开广播
uint8 new_adv_enabled_status = TRUE;
GAPRole_SetParameter( GAPROLE_ADVERT_ENABLED, sizeof( uint8 ), &new_adv_enabled_status ); //这是打开广播的代码,我仿真过,可以执行到这一句,但是广播没有打开。
}
}
P2_0_INTERRUPT_ENABLE();
P2_INTERRUPT_ENABLE();
ALL_INTERRUPT_ENABLE(); //开中断
}