UCOS下 32外部中断的问题

2019-07-20 20:55发布


友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
7条回答
allenzhouyu
2019-07-20 20:59
没有发问题就发了   用原子哥的例程  移植到STM32L15系列的UCOS系统  开始一切正常 在初始化的时候加入外部中断初始化后进入不了任务了

        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);
  

一周热门 更多>