我在V003使用PA1中斷進(jìn)行待機(jī)模式喚醒時(shí)似乎會(huì)導(dǎo)致單片機(jī)復(fù)位,手冊(cè)里寫的也有些模糊,是必須AWU事件才能不復(fù)位嗎
我的代碼
NVIC_DisableIRQ(SysTicK_IRQn); Wake_EnableIRQ(); PWR_EnterSTANDBYMode(PWR_STANDBYEntry_WFI);
void?Wake_Init()?{ ????GPIO_InitTypeDef?GPIO_InitStructure?=?{0}; ????GPIO_InitStructure.GPIO_Speed?=?GPIO_Speed_2MHz; ????GPIO_InitStructure.GPIO_Mode?=?GPIO_Mode_IPD; ????GPIO_InitStructure.GPIO_Pin?=?WAKE_Pin; ????GPIO_Init(WAKE_GPIO_Port,?&GPIO_InitStructure); ????EXTI_InitTypeDef?EXTI_InitStructure?=?{0}; ????/*?GPIOA.0?---->?EXTI_Line0?*/ ????GPIO_EXTILineConfig(GPIO_PortSourceGPIOA,?GPIO_PinSource1); ????EXTI_InitStructure.EXTI_Line?=?EXTI_Line1; ????EXTI_InitStructure.EXTI_Mode?=?EXTI_Mode_Interrupt; ????EXTI_InitStructure.EXTI_Trigger?=?EXTI_Trigger_Rising; ????EXTI_InitStructure.EXTI_LineCmd?=?ENABLE; ????EXTI_Init(&EXTI_InitStructure); ????NVIC_InitTypeDef?NVIC_InitStructure?=?{0}; ????NVIC_InitStructure.NVIC_IRQChannel?=?EXTI7_0_IRQn; ????NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority?=?0; ????NVIC_InitStructure.NVIC_IRQChannelSubPriority?=?1; ????NVIC_InitStructure.NVIC_IRQChannelCmd?=?DISABLE; ????NVIC_Init(&NVIC_InitStructure); } void?Wake_EnableIRQ()?{ ????NVIC_EnableIRQ(EXTI7_0_IRQn); }
void?EXTI7_0_IRQHandler()?__attribute__((interrupt("WCH-Interrupt-fast"))); void?EXTI7_0_IRQHandler()?{ ????if?(EXTI_GetITStatus(EXTI_Line1)?!=?RESET)?{ ????????EXTI_ClearITPendingBit(EXTI_Line1); ????} }
熱門產(chǎn)品 :
CH182: 以太網(wǎng)PHY收發(fā)器芯片