QP is an event-driven, RTOS-like, active object framework for microcontrollers, such as mbed. The QP framework provides thread-safe execution of active objects (concurrent state machines) and support both manual and automatic coding of UML statecharts in readable, production-quality C or C++. Automatic code generation of QP code is supported by the free QM modeling tool.

Dependents:   qp_hangman qp_dpp qp_blinky

QP/C++ (Quantum Platform in C++) is a lightweight, open source active object (actor) framework for building responsive and modular real-time embedded applications as systems of asynchronous event-driven active objects (actors). The QP/C++ framework is a member of a larger family consisting of QP/C++, QP/C, and QP-nano frameworks, which are all strictly quality controlled, thoroughly documented, and available under GPLv3 with a special Exception for mbed (see http://www.state-machine.com/licensing/QP-mbed_GPL_Exception.txt).

The behavior of active objects is specified in QP/C++ by means of hierarchical state machines (UML statecharts). The framework supports manual coding of UML state machines in C++ as well as automatic code generation by means of the free QM modeling tool (http://www.state-machine.com/qm).

Please see the "QP/C++ Reference Manual" (http://www.state-machine.com/qpcpp) for more information.

Committer:
QL
Date:
Wed Feb 09 14:46:03 2011 +0000
Revision:
0:064c79e7311a
Child:
1:379cf3202ba2
4.1.06a

Who changed what in which revision?

UserRevisionLine numberNew contents of line
QL 0:064c79e7311a 1 //////////////////////////////////////////////////////////////////////////////
QL 0:064c79e7311a 2 // Product: QP/C++ port to ARM Cortex, selectable Vanilla/QK, mbed compiler
QL 0:064c79e7311a 3 // Last Updated for QP ver: 4.1.06 (modified to fit in one file)
QL 0:064c79e7311a 4 // Date of the Last Update: Feb 08, 2011
QL 0:064c79e7311a 5 //
QL 0:064c79e7311a 6 // Q u a n t u m L e a P s
QL 0:064c79e7311a 7 // ---------------------------
QL 0:064c79e7311a 8 // innovating embedded systems
QL 0:064c79e7311a 9 //
QL 0:064c79e7311a 10 // Copyright (C) 2002-2011 Quantum Leaps, LLC. All rights reserved.
QL 0:064c79e7311a 11 //
QL 0:064c79e7311a 12 // This software may be distributed and modified under the terms of the GNU
QL 0:064c79e7311a 13 // General Public License version 2 (GPL) as published by the Free Software
QL 0:064c79e7311a 14 // Foundation and appearing in the file GPL.TXT included in the packaging of
QL 0:064c79e7311a 15 // this file. Please note that GPL Section 2[b] requires that all works based
QL 0:064c79e7311a 16 // on this software must also be made publicly available under the terms of
QL 0:064c79e7311a 17 // the GPL ("Copyleft").
QL 0:064c79e7311a 18 //
QL 0:064c79e7311a 19 // Alternatively, this software may be distributed and modified under the
QL 0:064c79e7311a 20 // terms of Quantum Leaps commercial licenses, which expressly supersede
QL 0:064c79e7311a 21 // the GPL and are specifically designed for licensees interested in
QL 0:064c79e7311a 22 // retaining the proprietary status of their code.
QL 0:064c79e7311a 23 //
QL 0:064c79e7311a 24 // Contact information:
QL 0:064c79e7311a 25 // Quantum Leaps Web site: http://www.quantum-leaps.com
QL 0:064c79e7311a 26 // e-mail: info@quantum-leaps.com
QL 0:064c79e7311a 27 //////////////////////////////////////////////////////////////////////////////
QL 0:064c79e7311a 28 #ifndef qp_port_h
QL 0:064c79e7311a 29 #define qp_port_h
QL 0:064c79e7311a 30
QL 0:064c79e7311a 31 // enable the Q-SPY software tracing instrumentation
QL 0:064c79e7311a 32 #define Q_SPY
QL 0:064c79e7311a 33
QL 0:064c79e7311a 34 // enable preemptive QK kernel
QL 0:064c79e7311a 35 #define QK_PREEMPTIVE
QL 0:064c79e7311a 36
QL 0:064c79e7311a 37 // The maximum number of active objects in the application (could be up to 63)
QL 0:064c79e7311a 38 #define QF_MAX_ACTIVE 16
QL 0:064c79e7311a 39
QL 0:064c79e7311a 40 // The signal size (1, 2, 4 bytes)
QL 0:064c79e7311a 41 #define Q_SIGNAL_SIZE 2
QL 0:064c79e7311a 42
QL 0:064c79e7311a 43 //............................................................................
QL 0:064c79e7311a 44 // QF critical section entry/exit
QL 0:064c79e7311a 45 // QF_INT_KEY_TYPE not defined
QL 0:064c79e7311a 46 #define QF_INT_LOCK(dummy) __disable_irq()
QL 0:064c79e7311a 47 #define QF_INT_UNLOCK(dummy) __enable_irq()
QL 0:064c79e7311a 48
QL 0:064c79e7311a 49 #ifdef QK_PREEMPTIVE
QL 0:064c79e7311a 50 // QK interrupt entry and exit
QL 0:064c79e7311a 51 #define QK_ISR_ENTRY() do { \
QL 0:064c79e7311a 52 __disable_irq(); \
QL 0:064c79e7311a 53 ++QK_intNest_; \
QL 0:064c79e7311a 54 QF_QS_ISR_ENTRY(QK_intNest_, QK_currPrio_); \
QL 0:064c79e7311a 55 __enable_irq(); \
QL 0:064c79e7311a 56 } while (0)
QL 0:064c79e7311a 57
QL 0:064c79e7311a 58 #define QK_ISR_EXIT() do { \
QL 0:064c79e7311a 59 __disable_irq(); \
QL 0:064c79e7311a 60 QF_QS_ISR_EXIT(QK_intNest_, QK_currPrio_); \
QL 0:064c79e7311a 61 --QK_intNest_; \
QL 0:064c79e7311a 62 *((uint32_t volatile *)0xE000ED04) = 0x10000000; \
QL 0:064c79e7311a 63 __enable_irq(); \
QL 0:064c79e7311a 64 } while (0)
QL 0:064c79e7311a 65 #else
QL 0:064c79e7311a 66 #define QK_ISR_ENTRY() ((void)0)
QL 0:064c79e7311a 67 #define QK_ISR_EXIT() ((void)0)
QL 0:064c79e7311a 68 #endif
QL 0:064c79e7311a 69
QL 0:064c79e7311a 70 #ifdef Q_SPY
QL 0:064c79e7311a 71 #define QS_TIME_SIZE 4
QL 0:064c79e7311a 72 #define QS_OBJ_PTR_SIZE 4
QL 0:064c79e7311a 73 #define QS_FUN_PTR_SIZE 4
QL 0:064c79e7311a 74 #endif
QL 0:064c79e7311a 75
QL 0:064c79e7311a 76 #include <stdint.h> // mbed compiler supports standard exact-width integers
QL 0:064c79e7311a 77
QL 0:064c79e7311a 78 #include "qp.h" // QP platform-independent interface
QL 0:064c79e7311a 79
QL 0:064c79e7311a 80 #endif // qp_port_h