I know that an ISR needs to be very quick and should handle an interrupt very quickly. But I do not understand the reason for the same. Why should this condition be met? Moreover, in order to do so are there any restrictions on what all can an ISR code have? Typically, what all should not be included in the code of an ISR?
Thanks
The most stringent requirement is that an
ISRcan’t block – it can’t sleep. So you can’t use semaphores for example.Each interrupt has something to do with hardware. Think of a network device. It has a really tiny memory and yet it receives frames at high speed. Your had better copy quickly stuff from it into main memory, or the frames will overwhelm the device and it will spill frames.