2016-08-22 07:54 AM
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 #interrupts2016-08-22 10:58 AM
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.2016-08-25 02:40 AM
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.