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.
Diff: qk_port.s
- Revision:
- 5:949864ba515c
- Parent:
- 0:064c79e7311a
- Child:
- 9:ca2e6010d9e2
--- a/qk_port.s Tue Feb 22 15:35:14 2011 +0000 +++ b/qk_port.s Sun Sep 25 18:10:41 2011 +0000 @@ -1,7 +1,7 @@ ;***************************************************************************** ; Product: QK port to ARM Cortex-M0/M3, mbed ARM assembler, CMSIS-compliant -; Last Updated for Version: 4.1.06 -; Date of the Last Update: Feb 07, 2011 +; Last Updated for Version: 4.2.04 +; Date of the Last Update: Sep 23, 2011 ; ; Q u a n t u m L e a P s ; --------------------------- @@ -37,8 +37,8 @@ ;***************************************************************************** ; -; The QK_init function sets the priorities of SVCall and PendSV exceptions -; to the lowest level possible (0xFF). The function internally disables +; The QK_init function sets the priorities of PendSV and SVCall exceptions +; to 0xFF and 0x00, respectively. The function internally disables ; interrupts, but restores the original interrupt lock before exit. ; ;***************************************************************************** @@ -54,7 +54,7 @@ STR r2,[r1,#8] ; write the System 12-15 Priority Register LDR r2,[r1,#4] ; load the System 8-11 Priority Register LSLS r3,r3,#8 - ORRS r2,r3 ; set PRI_11 (SVCall) to 0xFF + BICS r2,r3 ; set PRI_11 (SVCall) to 0x00 STR r2,[r1,#4] ; write the System 8-11 Priority Register MSR PRIMASK,r0 ; restore the original PRIMASK @@ -85,13 +85,17 @@ ;***************************************************************************** PendSV_Handler CPSID i ; disable interrupts at processor level + LDR r0,=0xE000ED04 ; load the NVIC-ICSR register address + MOVS r1,#0x01 + LSLS r1,r1,#27 ; make up a mask with only the PENDSVCLR bit set + STR r1,[r0] ; remove the pending status of PendSV LDR r0,=QK_readySet_ ; load the address of QK_readySet_ LDRB r0,[r0] ; load the first byte of QK_readySet_ CMP r0,#0 ; is QK_readySet_ == 0 ? BEQ.N iret ; if QK_readySet_ == 0, branch to iret - MOVS r1,#0x01 - LSLS r1,r1,#24 ; make up a task xPSR with only the T bit set + ; at this point r1 contains (1 << 27) + LSRS r1,r1,#3 ; make up a task xPSR with only the T bit set LDR r0,=schedule ; load the address of sched wrapper (new PC) PUSH {r0-r1} ; push xPSR,PC SUB sp,sp,#(6*4) ; don't care for lr,r12,r3,r2,r1,r0