AnsweredAssumed Answered

STM32F103 External Switch Interrupt Problem

Question asked by Utkarash Patil on Sep 21, 2017
Latest reply on Sep 22, 2017 by Utkarash Patil

My aim is to generate interrupts on various pins of STM32F103 Nucleo-64, for that i used these steps as mentioned bellow ,

In cubeMx firstly i used 5 pins which are connected to switches and configured them as GPIO_EXTIx  also enabled their respective interrupts in NVIC in configuration tab that are External Interrupt 3, External Interrupt 9:5 and External Interrupt 15:10, also for indication i have connected 5 pins to different LEDs and configured them as Pull up and triggered when falling edge 
And then generated code with some changes as per required also for indication in code i have used an variable and assigned values from 1 to 5 to the variable  which get updated on respective interrupt  ,
I have used a switch statement and in that i have described 5 cases 
But when i am pressing any switch or activating any Interrupt   the first switch case is executed and then the respective case is executed so even if i want the case 5 to executed (Pressing switch 5) it is getting executed but before that case 1 is also getting executed so this is disturbing by functionality 
so i have attached my code below please check with it and help in this concern if i am wrong any where
BELOW ATTACHED BOTH THE FILES HAVE SAME CODE ONE IS IN NOTEPAD AND ANOTHER IS IN .C EXTENSION

Attachments

Outcomes