2019-07-20 20:55发布
allenzhouyu 发表于 2016-1-21 10:00 没有发问题就发了 用原子哥的例程 移植到STM32L15系列的UCOS系统 开始一切正常 在初始化的时候加入外部 ...
numbqq 发表于 2016-1-21 15:13 开启了外部中断,有没有写中断处理函数?
allenzhouyu 发表于 2016-1-21 15:28 NVIC_PriorityGroupConfig(NVIC_PriorityGroup_0); EXTI_ClearITPendingBit(ChargingRX ...
最多设置5个标签!
GPIO_InitTypeDef GPIO_InitStructure;
NVIC_InitTypeDef NVIC_InitStructure;
EXTI_InitTypeDef EXTI_InitStructure;
GPIO_InitStructure.GPIO_Pin = Charging_GPIO_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_40MHz;
GPIO_Init(Charging_GPIO, &GPIO_InitStructure);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
SYSCFG_EXTILineConfig(ChargingEXTI_PortSource, ChargingRX1EXTI_PinSource);
EXTI_InitStructure.EXTI_Line = ChargingRX1Line;
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising_Falling;
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
EXTI_Init(&EXTI_InitStructure);
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_0);
EXTI_ClearITPendingBit(ChargingRX1Line);
NVIC_InitStructure.NVIC_IRQChannel = ChargingRX1LineIR;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 5;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
程序死在了startup_stm32f10x_md.s 文件
EXTI15_10_IRQHandler
RTC_Alarm_IRQHandler
USB_FS_WKUP_IRQHandler
TIM6_IRQHandler
TIM7_IRQHandler
B .
ENDP
ALIGN
的B这个位子
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_0);
EXTI_ClearITPendingBit(ChargingRX1Line);
NVIC_InitStructure.NVIC_IRQChannel = ChargingRX1LineIR;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 5;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
把这段屏蔽掉就行了
什么原因哦
一周热门 更多>