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

qp_config.h

Committer:
QL
Date:
2011-03-27
Revision:
0:84f3d3d7e5d9

File content as of revision 0:84f3d3d7e5d9:

#ifndef qp_config_h
#define qp_config_h

// enable the Q-SPY software tracing instrumentation
#define Q_SPY

// enable preemptive QK kernel (cooperative kernel is used when not defined)
#define QK_PREEMPTIVE

// The maximum number of active objects in the application (could be up to 63)
#define QF_MAX_ACTIVE         16

// Uncomment the following macros only if you want to change the given default 
#define Q_SIGNAL_SIZE         1
//#define QF_EVENT_SIZ_SIZE     2
//#define QF_EQUEUE_CTR_SIZE    1
//#define QF_MPOOL_SIZ_SIZE     2
//#define QF_MPOOL_CTR_SIZE     2
//#define QF_TIMEEVT_CTR_SIZE   2 

#if (Q_SIGNAL_SIZE == 1)
    #define DEV_DRIVER_SIG  (0xFF - 8)
#elif (Q_SIGNAL_SIZE == 2)
    #define DEV_DRIVER_SIG  (0xFFFF - 8)
#elif (Q_SIGNAL_SIZE == 4)
    #define DEV_DRIVER_SIG  (0xFFFFFFFF - 8)
#else
    #error "Q_SIGNAL_SIZE not defined or incorrect"
#endif

#endif                                                          // qp_config_h