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.

Revision:
9:ca2e6010d9e2
Parent:
5:949864ba515c
--- a/qp_port.h	Mon Sep 26 03:27:09 2011 +0000
+++ b/qp_port.h	Tue Sep 04 22:20:52 2012 +0000
@@ -1,28 +1,35 @@
 //////////////////////////////////////////////////////////////////////////////
 // Product: QP/C++ port to ARM Cortex, selectable Vanilla/QK, mbed compiler
-// Last Updated for QP ver: 4.1.06 (modified to fit in one file)
-// Date of the Last Update: Feb 08, 2011
+// Last Updated for Version: 4.5.02
+// Date of the Last Update:  Sep 04, 2012
 //
 //                    Q u a n t u m     L e a P s
 //                    ---------------------------
 //                    innovating embedded systems
 //
-// Copyright (C) 2002-2011 Quantum Leaps, LLC. All rights reserved.
+// Copyright (C) 2002-2012 Quantum Leaps, LLC. All rights reserved.
+//
+// This program is open source software: you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as published
+// by the Free Software Foundation, either version 2 of the License, or
+// (at your option) any later version.
 //
-// This software may be distributed and modified under the terms of the GNU
-// General Public License version 2 (GPL) as published by the Free Software
-// Foundation and appearing in the file GPL.TXT included in the packaging of
-// this file. Please note that GPL Section 2[b] requires that all works based
-// on this software must also be made publicly available under the terms of
-// the GPL ("Copyleft").
+// Alternatively, this program may be distributed and modified under the
+// terms of Quantum Leaps commercial licenses, which expressly supersede
+// the GNU General Public License and are specifically designed for
+// licensees interested in retaining the proprietary status of their code.
 //
-// Alternatively, this software may be distributed and modified under the
-// terms of Quantum Leaps commercial licenses, which expressly supersede
-// the GPL and are specifically designed for licensees interested in
-// retaining the proprietary status of their code.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
 //
 // Contact information:
-// Quantum Leaps Web site:  http://www.quantum-leaps.com
+// Quantum Leaps Web sites: http://www.quantum-leaps.com
+//                          http://www.state-machine.com
 // e-mail:                  info@quantum-leaps.com
 //////////////////////////////////////////////////////////////////////////////
 #ifndef qp_port_h
@@ -31,10 +38,15 @@
 #include "qp_config.h"    // QP configuration defined at the application level
 
 //............................................................................
+
+                                                // QF interrupt disable/enable
+#define QF_INT_DISABLE()            __disable_irq()
+#define QF_INT_ENABLE()             __enable_irq()
+
                                              // QF critical section entry/exit
-// QF_INT_KEY_TYPE not defined
-#define QF_INT_LOCK(dummy)      __disable_irq()
-#define QF_INT_UNLOCK(dummy)    __enable_irq()
+// QF_CRIT_STAT_TYPE not defined: "unconditional interrupt unlocking" policy
+#define QF_CRIT_ENTRY(dummy)        __disable_irq()
+#define QF_CRIT_EXIT(dummy)         __enable_irq()
 
 #ifdef QK_PREEMPTIVE
                                                 // QK interrupt entry and exit
@@ -43,15 +55,17 @@
         ++QK_intNest_; \
         QF_QS_ISR_ENTRY(QK_intNest_, QK_currPrio_); \
         __enable_irq(); \
-    } while (0)
+    } while (false)
 
     #define QK_ISR_EXIT()  do { \
         __disable_irq(); \
         QF_QS_ISR_EXIT(QK_intNest_, QK_currPrio_); \
         --QK_intNest_; \
-        *((uint32_t volatile *)0xE000ED04) = 0x10000000; \
-        __enable_irq(); \
-    } while (0)
+          *Q_UINT2PTR_CAST(uint32_t, 0xE000ED04U) = \
+              static_cast<uint32_t>(0x10000000U); \
+          __enable_irq(); \
+      } while (false)
+
 #else
     #define QK_ISR_ENTRY() ((void)0)
     #define QK_ISR_EXIT()  ((void)0)