微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > stm32F4系列MCU,窗口看门狗 WWDG中的bug

stm32F4系列MCU,窗口看门狗 WWDG中的bug

时间:11-19 来源:互联网 点击:
引脚 */GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3;GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;GPIO_Init(GPIOD, &GPIO_InitStructure);}static void key_exti_config(void){EXTI_InitTypeDef EXTI_InitStructure;/* 连接PA0到外部中断线0 */SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOA, EXTI_PinSource0);/* 配置外部中断线0 */EXTI_InitStructure.EXTI_Line = EXTI_Line0;EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising_Falling;EXTI_InitStructure.EXTI_LineCmd = ENABLE;EXTI_Init(&EXTI_InitStructure);}static void key_nvic_config(void){NVIC_InitTypeDef NVIC_InitStructure;/* 使能外部中断0 */NVIC_InitStructure.NVIC_IRQChannel = EXTI0_IRQn;NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x3;NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x3;NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;NVIC_Init(&NVIC_InitStructure);}void key_init(void){key_gpio_init();key_exti_config();key_nvic_config();}void EXTI0_IRQHandler(void){ extern int stop_feed_dog;/* 清除中断标志 */printf("key isr\r\n");wwdg_clear_flag = 1;EXTI_ClearITPendingBit(EXTI_Line0);}/* @}*/ / (C) COPYRIGHT STMicroelectronics *END OF FILE/

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top