Example program for the lwIP TCP/IP stack (library lwip_1_4_0_rc2) and the QP state machine framework (library qp). This program demonstrates use of lwIP in hard real-time applications, in which the TCP/IP stack is used to monitor and configure the embedded device as well as to provide remote user interface (e.g., by means of a web browser). In particular, the lwIP stack, which is not reentrant, is strictly encapsulated inside a dedicated QP state machine object (active object in QP), so interrupt locking around calls to lwIP is unnecessary. Also, the Ethernet interrupt service routine (ISR) runs very fast without performing any lengthy copy operations. All this means that hard-real-time processing can be done at the task level, especially when you use the preemptive QK kernel built into QP for executing your application. No external RTOS component is needed to achieve fully deterministic real-time response of active object tasks prioritized above the lwiP task. The lwIP-QP integration uses exclusively the event-driven lwIP API. The heavyweight Berkeley-like socket API requiring a blocking RTOS and is not used, which results in much better performance of the lwIP stack and less memory consumption. NOTE: This example compiles cleanly, but does not run just yet because the low-level Ethernet driver in the lwIP library needs to be completed. See comments in the lwip_1_4_0_rc2 library for more information.

Dependencies:   mbed

Committer:
QL
Date:
Sun Mar 27 16:50:21 2011 +0000
Revision:
0:84f3d3d7e5d9
0.9

Who changed what in which revision?

UserRevisionLine numberNew contents of line
QL 0:84f3d3d7e5d9 1 #ifndef qp_config_h
QL 0:84f3d3d7e5d9 2 #define qp_config_h
QL 0:84f3d3d7e5d9 3
QL 0:84f3d3d7e5d9 4 // enable the Q-SPY software tracing instrumentation
QL 0:84f3d3d7e5d9 5 #define Q_SPY
QL 0:84f3d3d7e5d9 6
QL 0:84f3d3d7e5d9 7 // enable preemptive QK kernel (cooperative kernel is used when not defined)
QL 0:84f3d3d7e5d9 8 #define QK_PREEMPTIVE
QL 0:84f3d3d7e5d9 9
QL 0:84f3d3d7e5d9 10 // The maximum number of active objects in the application (could be up to 63)
QL 0:84f3d3d7e5d9 11 #define QF_MAX_ACTIVE 16
QL 0:84f3d3d7e5d9 12
QL 0:84f3d3d7e5d9 13 // Uncomment the following macros only if you want to change the given default
QL 0:84f3d3d7e5d9 14 #define Q_SIGNAL_SIZE 1
QL 0:84f3d3d7e5d9 15 //#define QF_EVENT_SIZ_SIZE 2
QL 0:84f3d3d7e5d9 16 //#define QF_EQUEUE_CTR_SIZE 1
QL 0:84f3d3d7e5d9 17 //#define QF_MPOOL_SIZ_SIZE 2
QL 0:84f3d3d7e5d9 18 //#define QF_MPOOL_CTR_SIZE 2
QL 0:84f3d3d7e5d9 19 //#define QF_TIMEEVT_CTR_SIZE 2
QL 0:84f3d3d7e5d9 20
QL 0:84f3d3d7e5d9 21 #if (Q_SIGNAL_SIZE == 1)
QL 0:84f3d3d7e5d9 22 #define DEV_DRIVER_SIG (0xFF - 8)
QL 0:84f3d3d7e5d9 23 #elif (Q_SIGNAL_SIZE == 2)
QL 0:84f3d3d7e5d9 24 #define DEV_DRIVER_SIG (0xFFFF - 8)
QL 0:84f3d3d7e5d9 25 #elif (Q_SIGNAL_SIZE == 4)
QL 0:84f3d3d7e5d9 26 #define DEV_DRIVER_SIG (0xFFFFFFFF - 8)
QL 0:84f3d3d7e5d9 27 #else
QL 0:84f3d3d7e5d9 28 #error "Q_SIGNAL_SIZE not defined or incorrect"
QL 0:84f3d3d7e5d9 29 #endif
QL 0:84f3d3d7e5d9 30
QL 0:84f3d3d7e5d9 31 #endif // qp_config_h