AnsweredAssumed Answered

stm32f107vc - external interrupt problem

Question asked by arslan.bahadir on Oct 16, 2013
Latest reply on Oct 16, 2013 by Clive One
hello forum . I am trying to use external interrupt but I can't do it and I can't understand what is wrong.
here is my code :

#include "stm32f10x.h"
#include "stm32_eval.h"
#include <stdio.h>

GPIO_InitTypeDef gpio_initstructureled;
GPIO_InitTypeDef gpio_initstructurebutton;
EXTI_InitTypeDef exti_initstructureexternalinterrupt;
NVIC_InitTypeDef nvic_initstructure;

void EXTI9_5_IRQHandler()
     uint8_t leddurumu;
     leddurumu = GPIO_ReadInputDataBit(GPIOD,GPIO_Pin_7);
     if(leddurumu == Bit_SET)

int main(void)

          gpio_initstructureled.GPIO_Pin = GPIO_Pin_7;
          gpio_initstructureled.GPIO_Mode = GPIO_Mode_Out_PP;
          gpio_initstructureled.GPIO_Speed = GPIO_Speed_50MHz;


          gpio_initstructurebutton.GPIO_Pin = GPIO_Pin_9;
          gpio_initstructurebutton.GPIO_Mode = GPIO_Mode_IPU;
          gpio_initstructurebutton.GPIO_Speed = GPIO_Speed_50MHz;


          exti_initstructureexternalinterrupt.EXTI_Line = EXTI_Line9;
          exti_initstructureexternalinterrupt.EXTI_Mode = EXTI_Mode_Interrupt;
          exti_initstructureexternalinterrupt.EXTI_Trigger = EXTI_Trigger_Falling;
          exti_initstructureexternalinterrupt.EXTI_LineCmd = ENABLE;


          nvic_initstructure.NVIC_IRQChannel = EXTI9_5_IRQn ;
          nvic_initstructure.NVIC_IRQChannelPreemptionPriority =0x0f;
          nvic_initstructure.NVIC_IRQChannelSubPriority = 0x0f;
          nvic_initstructure.NVIC_IRQChannelCmd = ENABLE ;


  while (1)


  * @brief  Reports the name of the source file and the source line number
  *         where the assert_param error has occurred.
  * @param  file: pointer to the source file name
  * @param  line: assert_param error line source number
  * @retval None
void assert_failed(uint8_t* file, uint32_t line)

  /* User can add his own implementation to report the file name and line number,
     ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */

  /* Infinite loop */
  while (1)

so Can you see any problem ? 
thanks for your help