-
Notifications
You must be signed in to change notification settings - Fork 1k
Add clear pending interrupt feature with new clearPendingInterrupt API #1168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi Frederic, |
Hi Carlo, |
2f5bb5e
to
ef557af
Compare
Hi Frederic, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR LGTM.
As far I can see it may be necessary specially when disabling/enabling interrupt, because currently when calling stm32_interrupt_disable()
, IT is disabled at NVIC level, but not at EXTI level. Which means that while IT is disabled, EXTI can still raise IT (but blocked at nvic), and as soon as IT is re-enabled, IT is triggered by old event on GPIO.
An alternatively to this PR could be in stm32_interrupt_disable()
to disable EXTI too.
Thus more symmetric with regards to stm32_interrupt_enable()
.
But it changes the current behavior.
On the other hand, this PR give more flexibility to user (to clear IT at any time).
@cparata do you think this alternative would solve your original issue?
@fpistm hat is your opinion ?
Hi @ABOSTM , |
@cparata |
Hi @fpistm , @ABOSTM , |
Hi @cparata , |
Hi @ABOSTM , |
Hi @cparata, |
Hi @ABOSTM , |
We did use directly EXTI API, nevertheless HAL_GPIO_Init() configure some EXTI registers. so we could do the opposite, clear some registers ... and if HAL/LL API can simplify the job that is fine with me. |
Hi Frederic,
I noticed that attachInterrupt does not give the possibility to clear pending interrupts when it is called. I would like to add a new API, called clearPendingInterrupt, that gives the possibility to do that.
Best Regards,
Carlo