8.1.1 ISR Philosophy

Keep it short. Because interrupt is disabled during the execution of an ISR, it is critical to keep an ISR short in terms of execution time. In the case of an UART, when a byte is received, we only want to do the following:

It doesn't take long to do this.

Defer complexity to threads. But what if there is a lot of complex logic to process a byte just received? For example, checksum computation, address matching and etc. I suggestion is to do all that in a regular thread at top priority.

How does the ISR communicate with the handler thread? Use semaphores.



Copyright © 2008-10-25 by Tak Auyeung