本帖最后由 流芷静兰 于 2018-12-26 16:39 编辑
stm32f070串口1唤醒stop模式,总是唤醒不了,到底哪里的问题
[mw_shl_code=c,true]//PA10 RX设为外部中断
void EXTI_Configuration(void)
{
NVIC_InitTypeDef NVIC_InitStructure;
EXTI_InitTypeDef EXTI_InitStructure;
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA,ENABLE); //使能GPIOA
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
EXTI_InitStructure.EXTI_Line = EXTI_Line10;
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling;
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
EXTI_Init(&EXTI_InitStructure);
SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOA , GPIO_PinSource10);//PA10连接到外部中断
NVIC_InitStructure.NVIC_IRQChannel = EXTI4_15_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
}
void EXTI10_IRQHandler(void)
{
EXTI_ClearITPendingBit(EXTI_Line10);
NVIC_SystemReset();//Ïμí3¸′λ
}
void SystemStop_Enter(void)
{
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE); //使能PWR外部时钟
Close_Gpio();
USART_Cmd(USART1 , DISABLE);
DMA_Cmd(DMA1_Channel3, DISABLE);
EXTI_Configuration();
PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI); //进入停机模式
}[/mw_shl_code]
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>