AnsweredAssumed Answered

EXTI interupt problem

Question asked by claude.antoine on Mar 31, 2014
Latest reply on Apr 1, 2014 by Clive One
Hi i have a problem with interuption EXTI. I want to execute my principal function with an interuption with EXTI but it dosen't work ! only one instruction does work, this is my code. plz some one help me.

       
  1. void EXTI_IRconfig(void)
  2.    
  3.    
  4.    
  5. {
  6.    
  7.      NVIC_InitTypeDef   NVIC_InitStructure;
  8.    
  9.  SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOA, EXTI_PinSource3);
  10.    
  11.      
  12.    
  13.  
  14.    
  15.   /* Configure EXTI Line3 */
  16.    
  17.   EXTI_InitStructure.EXTI_Line = EXTI_Line3;
  18.    
  19.   EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
  20.    
  21.   EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising; 
  22.    
  23.   EXTI_InitStructure.EXTI_LineCmd = ENABLE;
  24.    
  25.   EXTI_Init(&EXTI_InitStructure);
  26.    
  27.  
  28.    
  29.  NVIC_InitStructure.NVIC_IRQChannel = EXTI3_IRQn;
  30.    
  31.   NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
  32.    
  33.   NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1;
  34.    
  35.   NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
  36.    
  37.   NVIC_Init(&NVIC_InitStructure);
  38.    
  39.    
  40.    
  41. }
/*******************************************/
#include "stm32f4xx_it.h"
/*********************************************/
       
  1. extern capteurIR;
  2.    
  3. void EXTI3_IRQHandler(void)
  4.    
  5. {
  6.    
  7. if(EXTI_GetITStatus(EXTI_Line3) != RESET)
  8.    
  9.   {
  10.    
  11. capteurIR=GPIO_ReadInputDataBit(GPIOA, GPIO_Pin_3);
  12.    
  13. EXTI_ClearITPendingBit(EXTI_Line3);          
  14.    
  15.    
  16.    
  17. }
  18.    
  19. if (GPIO_ReadInputDataBit(GPIOA, GPIO_Pin_3)!=1)
  20.    
  21. {     
  22.    
  23.  GPIO_ToggleBits(GPIOD, GPIO_Pin_15);
  24.    
  25. }
  26.    
  27. else
  28.    
  29. {
  30.    
  31. GPIO_ResetBits(GPIOD, GPIO_Pin_15);     
  32.    
  33. }
  34.    
  35. }

Outcomes