Why ISR does not return any value and does not take any argument?

If you are in embedded then you must come across this type of questions. Though it seems to be ok or interesting. But If you think logically then you can get the direct answer to this question by asking some basic questions to yourself. 

  • ISR: Interrupt service routine
  • IRH: Interrupt request handler

1) When do you call ISR?

We will not ISR from any function. When don’t know the time when it will be called. We can not predict the behavior of ISR. Then how can we decide the argument to ISR? Does that mean anything? No Definitely No. If we don’t know the calling time does that return value can be useful, can mean to us? Again Big No. Then why we need argument and return value. 

2) When we use Interrupts?

When we can not use polling method, which may be time-consuming and which can slower the response time of the system. Our ISR should be small and optimum. If we use argument, return value, global value then it may be complex or difficult to handle at the later stage of development. Generally ISR vectored address it fixed and once it is called then ISR will start. Before starting it will store all the register value and CPU state. It will disable the Interrupt bit. So again interrupt can not be trigger till it finishes the ISR. After completing ISR, it will restore the CPU and ALL register state and enable the Interrupt flag to receive next interrupt. 

Related Post:

Removing Space from Given String & Different Methods to Count Number of Ones in Given Value

Booting Sequence for Boot Process in Linux

How to count number of 1 or set bits in a given number

What is Segmentation fault ?

How to Access Private Data Members in C++ without using friend function

Process Vs Thread 

How to Add Two Numbers Without Using + Operator in C 

Overview of Function Pointer in C with Example - What is function pointer & how to use it

How to Fork child process with waitpid & execl in linux with c example code

Share on Google Plus

About Kapil Thakar

"I am Kapil Thakar, an Embedded Engineer cum Blogger wants to learn new things. I love to share my knowledge solutions to the problems. Interested in Blogging, Creative-Writing, SEO, Website Creation, Video Making, Editing, Affiliation Programs, Online Making Money."
    Blogger Comment
    Facebook Comment


Post a Comment

Related Posts Plugin for WordPress, Blogger...