Hello,
I am implementing an interrupt handler for a device which generates a multi-source interrupt. The source evaluation adds an uncomfortable amount of processing time to the ISR. I'd like to defer this work to another high level processing function so the ISR can quickly service the next interrupt. In the Netburner paradigm, is there an equivalent of a Deferred Service Routine? If not, how does one implement the functional equivalent?
-Pete-
Support for Deferred Service Routines?
-
- Posts: 513
- Joined: Sat Apr 26, 2008 7:14 am
Re: Support for Deferred Service Routines?
Take a look at the RTOS examples in C:\nburn\examples\RTOS. See also C:\nburn\docs\NetBurnerRuntimeLibrary\uCOSLibrary.pdf.
The easiest implentation is to set up a processing task for your deffered purpose. Have it pend on either a semaphore, or potentially an OSFlag. The semaphores are typically sent (posted) from one source, say an ISR, and received by a corresponding pending task, eg one running your deffered routines. This task can have a priority set up appropriately relative to other tasks. Flags do the same thing, but with the added flexibility that tasks can be configured to wait until more than one thing (flags in a larger mask) are set before it will trigger a pending task. Flags are also often set in ISRs. You can act on one of them, or wait till all are set.
Finally, check out the OSFifos which stick events and the data needed ot handle them into a Fifo. Then an ISR typically stacks up events into the fifo, while a pending task unloads them asynchronously wen prioity allows.
The easiest implentation is to set up a processing task for your deffered purpose. Have it pend on either a semaphore, or potentially an OSFlag. The semaphores are typically sent (posted) from one source, say an ISR, and received by a corresponding pending task, eg one running your deffered routines. This task can have a priority set up appropriately relative to other tasks. Flags do the same thing, but with the added flexibility that tasks can be configured to wait until more than one thing (flags in a larger mask) are set before it will trigger a pending task. Flags are also often set in ISRs. You can act on one of them, or wait till all are set.
Finally, check out the OSFifos which stick events and the data needed ot handle them into a Fifo. Then an ISR typically stacks up events into the fifo, while a pending task unloads them asynchronously wen prioity allows.