Tasks & interrupt usage
emNet can be used in an application in three different ways.
One Task Dedicated to the Stack
This is the simplest way to use the TCP/IP stack. One task is dedicated to the stack. It is called IP_Task and handles housekeeping operations, resends and handling of incoming packets. The "Read packet" operation is performed from within the ISR. Since the "Read packet" operation is called directly from the ISR, no additional task is required. The length of the interrupt latency will be extended for the time period which is required to process the "Read packet" operation.
Two Tasks Dedicated to the Stack
Two tasks are dedicated to the stack. The first is called IP_Task and handles housekeeping operations, resends and handling of incoming packets. The second one is called IP_RxTask and handles the "Read packet" operation. IP_RxTask is woken up from the interrupt service routine, if new packets are available. The interrupt latency is not extended, since the "Read packet" operation has been moved from the interrupt service routine to IP_RxTask.
Zero Tasks Dedicated to the Stack (Superloop)
emNet can also be used without any additional task for the stack, if an application task calls periodically IP_Exec(). The "Read packet" operation is performed from within the ISR. Since the "Read packet" operation is called directly from the ISR, no additional task is required. The length of the interrupt latency will be extended for the time period which is required to process the "Read packet" operation.