2019-03-29 03:16 AM
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?
Solved! Go to Solution.
2019-03-29 03:23 AM
There's a CMSIS call to clear an IRQ "pendingness":
NVIC_ClearPendingIRQ(IRQn_Type IRQn);
2019-03-29 03:23 AM
There's a CMSIS call to clear an IRQ "pendingness":
NVIC_ClearPendingIRQ(IRQn_Type IRQn);
2019-03-29 03:37 AM
Perfect. Many thanks.