This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Calling a SWI_post takes too much CPU time



Hello,

I have a hardware INT1 interrupt executed 8000 times per second. Inside the interrupt if some conditions are met I call SWI_post().

When that happens I can see that the normal interrupt execution time which is exactly 12uS gets extended to 30-65uS (random value), which takes almost half of my inter-sample time..

Can anyone answer why is calling a SWI_post()  taking so much time?

I did try a simple test and I removed all the code in the SWI routine which is associated with the SWI_Post(). In that case SWI_post() takes very little time. How is this related? 

It looks like when I do SWI_post() then SWI routine gets executed immediately and then code returns to INT1 interrupt, which should not happen since INT1 has highest priority and should not be interrupted. 

Any ideas?