cancel
Showing results for 
Search instead for 
Did you mean: 

Combining EXTI Interrupts

srikrishnan
Associate II
Posted on August 22, 2016 at 16:54

I am not sure if this is conceptually possible but I would appreciate some inputs. I have a push button configured as EXTI0 and another push button to EXTI7. However, when both buttons are pushed together, I want to do a totally different functionality. Is this is even possible? Right now, the EXTI with the higher priority takes over and when both have same priority, both functions happen. I am using an STM32F103 processor.

#hal #gpio #exti #interrupts
2 REPLIES 2
Posted on August 22, 2016 at 19:58

Well the priority/preemption is something you can manage via the NVIC.

You can pass ALL the EXTI vectors through the SAME handler.

If you are doing things in the IRQ Handler that is doing a lot of blocking, vs exiting quickly, then perhaps that some thing you can manage better.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
mark239955_stm1
Associate II
Posted on August 25, 2016 at 11:40

I'd like to start by asking why you're not too busy hunting for hobbits to do any embedded work... Sauron would not be amused.

More usefully, I'd suggest that you don't use interrupts to read buttons.  In microcontroller world, buttons are incredibly slow; you use interrupts to look after fast things.  Polled button handlers make a lot more sense.

Better handlers (like mine ^_^) do debouncing, map ''button down'', ''button repeat'', ''button up'' events to particular button behaviour/timings, and can be used to detect simultaneous multiple-button presses as well as individual button presses.  If you look around you can probably find something similar that someone else has bothered to publish.