cancel
Showing results for 
Search instead for 
Did you mean: 

Tell NVIC not to exeucte a pending interrupt

Vvine
Associate II

I am using STM32F070 processor. I want to know a way of instructing the NVIC not to execute Timer interrupt in certain cases. Is there a way to do this? The situaltion is as follows-

There are two interrupts- SPI and timer conifgured at same priority level. I have configured timer in auto reload mode. I process application either in SPI or timer interrupt but not both.

The situation is that when application is being executed in SPI interrupt, timer interrupt also arrives because of timeout. In my case, I do not want this timer interrupt now as the work is already being done in SPI interrupt already. So I always set the UIF bit in TImer SR regiser in the SPI interrupt, hoping the the Timer interrrupt is acknowledged, and when SPI interrupt is exited, the timer interrupt is not executed anymore (or only in next timeout). But this doesnt work. The Timer interrrupt is always executed after SPI.

I can not immediately stop the timer when I enter the SPI interrupt as I have to do some validations in front. Meanwhile the timer expires.

Any suggestions?

1 ACCEPTED SOLUTION

Accepted Solutions
David SIORPAES
ST Employee

There's a CMSIS call to clear an IRQ "pendingness":

NVIC_ClearPendingIRQ(IRQn_Type IRQn);

View solution in original post

2 REPLIES 2
David SIORPAES
ST Employee

There's a CMSIS call to clear an IRQ "pendingness":

NVIC_ClearPendingIRQ(IRQn_Type IRQn);

Perfect. Many thanks.