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.
0 comments :
Post a Comment