Q:

Can we use any function inside ISR?

0

Can we use any function inside ISR?

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Answer:

Yes, you can call a function within the ISR but it is not recommended because it can increase the interrupt latency and decrease the performance of the system. If you want to call a nested function within the ISR, you need to read the datasheet of your microcontroller because some vendors have a limit to how many calls can be nested.

One important point needs to remember that the function that is called from the ISR should be re-entrant. If the called function is not re-entrant, it could create the issues.

For example,
If the function is not reentrant and supposes that it is called by another part of the code beside the ISR. So the problem will be invoked when if the ISR calls the same function which is already invoked outside of the ISR?

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Embedded C interview questions and answers (2022)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
What is a nested interrupt?... >>
<< What are the causes of Interrupt Latency?...