Quantum Leaps 12 år sedan
förälder
incheckning
eed870ce9d
100 ändrade filer med 8079 tillägg och 2671 borttagningar
  1. 2 1
      doxygen/Doxyfile
  2. 2 1
      doxygen/Doxyfile-CHM
  3. 62 0
      doxygen/make.bat
  4. 7 8
      doxygen/qpc.txt
  5. 8 0
      doxygen/qpc_footer.html
  6. 3481 0
      doxygen/qpc_metrics.txt
  7. 82 0
      doxygen/qpc_rev.txt
  8. 45 0
      doxygen/rsm.bat
  9. 637 0
      doxygen/rsm_qpc.cfg
  10. 4 4
      examples/80x86/dos/watcom/l/bomb/bomb4.c
  11. 1 1
      examples/80x86/dos/watcom/l/comp/bsp.c
  12. 1 1
      examples/80x86/dos/watcom/l/defer/bsp.c
  13. 1 1
      examples/80x86/dos/watcom/l/dpp/bsp.c
  14. 1 1
      examples/80x86/dos/watcom/l/game/bsp.c
  15. 5 5
      examples/80x86/dos/watcom/l/history/history.c
  16. 5 5
      examples/80x86/dos/watcom/l/hook/hook.c
  17. 1 1
      examples/80x86/dos/watcom/l/qhsmtst/log_pass.txt
  18. 5 6
      examples/80x86/dos/watcom/l/qhsmtst/main.c
  19. 1 1
      examples/80x86/dos/watcom/l/reminder/bsp.c
  20. 1 1
      examples/80x86/qk/watcom/l/dpp/bsp.c
  21. 1 1
      examples/80x86/qk/watcom/l/game/bsp.c
  22. 0 58
      examples/arm-cm/qk/arm_keil/dpp-qk_ek-lm3s811/.dpp
  23. 9 12
      examples/arm-cm/qk/arm_keil/dpp-qk_ek-lm3s811/bsp.c
  24. 23 8
      examples/arm-cm/qk/arm_keil/dpp-qk_ek-lm3s811/dpp-qk.uvopt
  25. 32 5
      examples/arm-cm/qk/arm_keil/dpp-qk_ek-lm3s811/dpp-qk.uvproj
  26. 57 9
      examples/arm-cm/qk/arm_keil/dpp-qk_ek-lm3s811/dpp.qm
  27. 31 51
      examples/arm-cm/qk/arm_keil/dpp-qk_ek-lm3s811/main.c
  28. 73 45
      examples/arm-cm/qk/arm_keil/dpp-qk_ek-lm3s811/philo.c
  29. 78 53
      examples/arm-cm/qk/arm_keil/dpp-qk_ek-lm3s811/table.c
  30. 0 58
      examples/arm-cm/qk/arm_keil/dpp-qk_ek-tm4c123gxl/.dpp
  31. 9 12
      examples/arm-cm/qk/arm_keil/dpp-qk_ek-tm4c123gxl/bsp.c
  32. 16 0
      examples/arm-cm/qk/arm_keil/dpp-qk_ek-tm4c123gxl/dpp-qk.sct
  33. 13 4
      examples/arm-cm/qk/arm_keil/dpp-qk_ek-tm4c123gxl/dpp-qk.uvopt
  34. 30 3
      examples/arm-cm/qk/arm_keil/dpp-qk_ek-tm4c123gxl/dpp-qk.uvproj
  35. 57 9
      examples/arm-cm/qk/arm_keil/dpp-qk_ek-tm4c123gxl/dpp.qm
  36. 31 51
      examples/arm-cm/qk/arm_keil/dpp-qk_ek-tm4c123gxl/main.c
  37. 73 45
      examples/arm-cm/qk/arm_keil/dpp-qk_ek-tm4c123gxl/philo.c
  38. 1 1
      examples/arm-cm/qk/arm_keil/dpp-qk_ek-tm4c123gxl/startup-qk_tm4c.s
  39. 78 53
      examples/arm-cm/qk/arm_keil/dpp-qk_ek-tm4c123gxl/table.c
  40. 0 58
      examples/arm-cm/qk/arm_keil/game-qk_ek-lm3s811/.game
  41. 9 13
      examples/arm-cm/qk/arm_keil/game-qk_ek-lm3s811/bsp.c
  42. 8 8
      examples/arm-cm/qk/arm_keil/game-qk_ek-lm3s811/game.h
  43. 54 57
      examples/arm-cm/qk/arm_keil/game-qk_ek-lm3s811/game.qm
  44. 3 3
      examples/arm-cm/qk/arm_keil/game-qk_ek-lm3s811/main.c
  45. 77 39
      examples/arm-cm/qk/arm_keil/game-qk_ek-lm3s811/mine1.c
  46. 77 39
      examples/arm-cm/qk/arm_keil/game-qk_ek-lm3s811/mine2.c
  47. 41 23
      examples/arm-cm/qk/arm_keil/game-qk_ek-lm3s811/missile.c
  48. 75 42
      examples/arm-cm/qk/arm_keil/game-qk_ek-lm3s811/ship.c
  49. 276 199
      examples/arm-cm/qk/arm_keil/game-qk_ek-lm3s811/tunnel.c
  50. 0 54
      examples/arm-cm/qk/gnu/dpp-qk_ek-lm3s811-lint/.dpp
  51. 35 30
      examples/arm-cm/qk/gnu/dpp-qk_ek-lm3s811-lint/Makefile
  52. 9 12
      examples/arm-cm/qk/gnu/dpp-qk_ek-lm3s811-lint/bsp.c
  53. 20 37
      examples/arm-cm/qk/gnu/dpp-qk_ek-lm3s811-lint/dpp-qk.ld
  54. 12 3
      examples/arm-cm/qk/gnu/dpp-qk_ek-lm3s811-lint/dpp.h
  55. 57 9
      examples/arm-cm/qk/gnu/dpp-qk_ek-lm3s811-lint/dpp.qm
  56. 31 51
      examples/arm-cm/qk/gnu/dpp-qk_ek-lm3s811-lint/main.c
  57. 83 48
      examples/arm-cm/qk/gnu/dpp-qk_ek-lm3s811-lint/philo.c
  58. 181 148
      examples/arm-cm/qk/gnu/dpp-qk_ek-lm3s811-lint/startup_lm3s.c
  59. 88 56
      examples/arm-cm/qk/gnu/dpp-qk_ek-lm3s811-lint/table.c
  60. 34 28
      examples/arm-cm/qk/gnu/dpp-qk_ek-tm4c123gxl/Makefile
  61. 9 11
      examples/arm-cm/qk/gnu/dpp-qk_ek-tm4c123gxl/bsp.c
  62. 14 16
      examples/arm-cm/qk/gnu/dpp-qk_ek-tm4c123gxl/dpp-qk.ld
  63. 13 3
      examples/arm-cm/qk/gnu/dpp-qk_ek-tm4c123gxl/dpp.h
  64. 57 9
      examples/arm-cm/qk/gnu/dpp-qk_ek-tm4c123gxl/dpp.qm
  65. 31 51
      examples/arm-cm/qk/gnu/dpp-qk_ek-tm4c123gxl/main.c
  66. 90 54
      examples/arm-cm/qk/gnu/dpp-qk_ek-tm4c123gxl/philo.c
  67. 412 138
      examples/arm-cm/qk/gnu/dpp-qk_ek-tm4c123gxl/startup_tm4c.c
  68. 95 62
      examples/arm-cm/qk/gnu/dpp-qk_ek-tm4c123gxl/table.c
  69. 5 1
      examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1114/Makefile
  70. 1 1
      examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1114/bsp.c
  71. 13 3
      examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1114/dpp.h
  72. 57 9
      examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1114/dpp.qm
  73. 31 51
      examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1114/main.c
  74. 90 54
      examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1114/philo.c
  75. 95 62
      examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1114/table.c
  76. 5 1
      examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1343/Makefile
  77. 3 4
      examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1343/bsp.c
  78. 13 3
      examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1343/dpp.h
  79. 57 9
      examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1343/dpp.qm
  80. 31 51
      examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1343/main.c
  81. 90 54
      examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1343/philo.c
  82. 95 62
      examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1343/table.c
  83. 5 1
      examples/arm-cm/qk/gnu/dpp-qk_stm3210c-eval/Makefile
  84. 3 3
      examples/arm-cm/qk/gnu/dpp-qk_stm3210c-eval/bsp.c
  85. 16 4
      examples/arm-cm/qk/gnu/dpp-qk_stm3210c-eval/dpp.h
  86. 57 9
      examples/arm-cm/qk/gnu/dpp-qk_stm3210c-eval/dpp.qm
  87. 31 51
      examples/arm-cm/qk/gnu/dpp-qk_stm3210c-eval/main.c
  88. 91 55
      examples/arm-cm/qk/gnu/dpp-qk_stm3210c-eval/philo.c
  89. 96 63
      examples/arm-cm/qk/gnu/dpp-qk_stm3210c-eval/table.c
  90. 0 58
      examples/arm-cm/qk/gnu/game-qk_ek-lm3s811/.game
  91. 0 5
      examples/arm-cm/qk/gnu/game-qk_ek-lm3s811/.project
  92. 36 32
      examples/arm-cm/qk/gnu/game-qk_ek-lm3s811/Makefile
  93. 9 13
      examples/arm-cm/qk/gnu/game-qk_ek-lm3s811/bsp.c
  94. 34 27
      examples/arm-cm/qk/gnu/game-qk_ek-lm3s811/game-qk.ld
  95. 8 8
      examples/arm-cm/qk/gnu/game-qk_ek-lm3s811/game.h
  96. 54 57
      examples/arm-cm/qk/gnu/game-qk_ek-lm3s811/game.qm
  97. 3 3
      examples/arm-cm/qk/gnu/game-qk_ek-lm3s811/main.c
  98. 77 39
      examples/arm-cm/qk/gnu/game-qk_ek-lm3s811/mine1.c
  99. 77 39
      examples/arm-cm/qk/gnu/game-qk_ek-lm3s811/mine2.c
  100. 41 23
      examples/arm-cm/qk/gnu/game-qk_ek-lm3s811/missile.c

+ 2 - 1
doxygen/Doxyfile

@@ -735,6 +735,7 @@ WARN_LOGFILE           =
 
 INPUT                  = ./qpc.txt \
                          ./qpc_rev.txt \
+                         ./qpc_metrics.txt \
                          ./qp_macros.h \
                          ../include \
                          ../qep/source \
@@ -1066,7 +1067,7 @@ HTML_HEADER            =
 # that doxygen normally uses.
 # This tag requires that the tag GENERATE_HTML is set to YES.
 
-HTML_FOOTER            =
+HTML_FOOTER            = ./qpc_footer.html
 
 # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
 # sheet that is used by each HTML page. It can be used to fine-tune the look of

+ 2 - 1
doxygen/Doxyfile-CHM

@@ -736,6 +736,7 @@ WARN_LOGFILE           =
 INPUT                  = ./qpc.txt \
                          ./qpc_rev.txt \
                          ./qp_macros.h \
+                         ./qpc_metrics.txt \
                          ../include \
                          ../qep/source \
                          ../qf/source \
@@ -1066,7 +1067,7 @@ HTML_HEADER            =
 # that doxygen normally uses.
 # This tag requires that the tag GENERATE_HTML is set to YES.
 
-HTML_FOOTER            =
+HTML_FOOTER            = ./qpc_footer.html
 
 # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
 # sheet that is used by each HTML page. It can be used to fine-tune the look of

+ 62 - 0
doxygen/make.bat

@@ -0,0 +1,62 @@
+@echo off
+:: ==========================================================================
+:: Product: QP/C script for generating Doxygen documentation
+:: Last Updated for Version: 5.2.0
+:: Date of the Last Update:  Dec 20, 2013
+::
+::                    Q u a n t u m     L e a P s
+::                    ---------------------------
+::                    innovating embedded systems
+::
+:: Copyright (C) 2002-2013 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 3 of the License, or
+:: (at your option) any later version.
+::
+:: 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.
+::
+:: 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 sites: http://www.quantum-leaps.com
+::                          http://www.state-machine.com
+:: e-mail:                  info@quantum-leaps.com
+:: ==========================================================================
+setlocal
+
+echo usage:
+echo make
+echo make -CHM
+
+set VERSION=5.2.0
+
+set DOXHOME="C:\tools\Doxygen\bin\Release64"
+set RCMHOME="C:\tools\MSquared\M2 RSM"
+
+set RSM_OUTPUT=qpc_metrics.txt
+set RSM_INPUT=..\include\*.h ..\qep\source\*.h ..\qep\source\*.c ..\qf\source\*.h ..\qf\source\*.c ..\qk\source\*.h ..\qk\source\*.c ..\qs\source\*.h ..\qs\source\*.c
+
+echo /** \page metrics Code Metrics > %RSM_OUTPUT%
+echo.>> %RSM_OUTPUT%
+echo \code >> %RSM_OUTPUT%
+echo                    Standard Code Metrics for QP/C %VERSION% >> %RSM_OUTPUT%
+
+%RCMHOME%\rsm.exe -fd -xNOCOMMAND -xNOCONFIG -u"File cfg rsm_qpc.cfg" %RSM_INPUT% >> %RSM_OUTPUT%
+
+echo \endcode >> %RSM_OUTPUT%
+echo */ >> %RSM_OUTPUT%
+
+%DOXHOME%\doxygen.exe Doxyfile%1
+
+endlocal

+ 7 - 8
doxygen/qpc.txt

@@ -8,7 +8,7 @@
 
 \image html qp_components.jpg
 
-All QP&trade; frameworks can run on "bare-metal" single-chip microcontrollers, completely replacing a traditional Real-Time Operating System (RTOS). Ports and ready-to-use examples are provided for most major <a href="http://www.state-machine.com/downloads/index.php#QDK">CPU families</a>. QP/C and QP/C++ can also work with a traditional OS/RTOS, such as: <a href="http://www.state-machine.com/linux/">POSIX (Linux, QNX)</a>, <a href="http://www.state-machine.com/win32/">Windows</a>, <a href="http://www.state-machine.com/android/">Android-NDK</a>, <a href="http://www.state-machine.com/threadx/">ThreadX</a>, <a href="http://www.state-machine.com/ucos2/">MicroC/OS</a>, <a href="http://www.state-machine.com/freertos/">FreeRTOS</a>, etc.
+All QP&trade; frameworks can run on "bare-metal" single-chip microcontrollers, completely replacing a traditional Real-Time Operating System (RTOS). Ports and ready-to-use examples are provided for most major <a href="http://www.state-machine.com/downloads/index.php#QDK">CPU families</a>. QP/C and QP/C++ can also work with a traditional OS/RTOS, such as: <a href="http://www.state-machine.com/linux/">POSIX (Linux, embedded Linux, QNX, INTEGRITY)</a>, <a href="http://www.state-machine.com/win32/">Windows (Windows embedded, Windows CE)</a>, <a href="http://www.state-machine.com/android/">Android-NDK</a>, <a href="http://www.state-machine.com/threadx/">ThreadX</a>, <a href="http://www.state-machine.com/ucos2/">MicroC/OS</a>, etc.
 
 The behavior of active objects is specified in QP by means of <a href="http://en.wikipedia.org/wiki/UML_state_machine">hierarchical state machines (UML statecharts)</a>. The frameworks support manual coding of UML state machines in C or C++ as well as fully automatic code generation by means of the free graphical <a href="http://www.state-machine.com/qm/">QM&trade; modeling tool</a>.
 
@@ -22,8 +22,7 @@ For more information about QP, please visit:
 <a href="http://www.state-machine.com/qp"><strong>state-machine.com/qp</strong></a>
 
 <HR>
-QP/C Licensing
-==============
+\section licensing QP/C Licensing
 
 QP/C is licensed under the increasingly popular dual licensing model, in which both the open source software distribution mechanism and traditional closed source software distribution models are combined.
 
@@ -38,8 +37,8 @@ Closed Source Projects:
 If you are developing and distributing traditional closed source applications, you can purchase one of Quantum Leaps commercial licenses, which are specifically designed for users interested in retaining the proprietary status of their code. All Quantum Leaps commercial licenses expressly supersede the GPL open source license. This means that when you license Quantum Leaps software under a commercial license, you specifically do not use the software under the open source license and therefore you are not subject to any of its terms. 
 
 <HR>
-Contact Information
-===================
+\section contact Contact Information
+
 - Quantum Leaps Web site:   http://www.state-machine.com
 - Quantum Leaps licensing:  http://www.state-machine.com/licensing
 - QP/QM on SourceForge.net: http://sourceforge.net/projects/qpc
@@ -161,9 +160,9 @@ qpc\                 - QP/C root directory
   | | | | | +-rel\   - Release build
   | | | | | +-spy\   - Spy build (with software instrumentation)
   | | | | | +-make_cortex-m3_cs.bat - batch script for building QP libraries
-  | | | | | +-qep_port.h - QEP platform-dependent include file
-  | | | | | +-qf_port.h  - QF  platform-dependent include file
-  | | | | | +-qs_port.h  - QS  platform-dependent include file
+  | | | | | +-qep_port.h - QEP platform-independent include file
+  | | | | | +-qf_port.h  - QF  platform-independent include file
+  | | | | | +-qs_port.h  - QS  platform-independent include file
   | | | | | +-qp_port.h  - QP  platform-dependent include file
   | | | . . .
   | | +-qk\          - Ports to the preemptive QK kernel

+ 8 - 0
doxygen/qpc_footer.html

@@ -0,0 +1,8 @@
+<!-- start footer part -->
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
+  <ul>
+    <li class="footer"><a href="http://www.state-machine.com">&copy; Quantum Leaps</a>&nbsp;&nbsp;&nbsp;
+      QP/C 5.2.0
+    </li>
+  </ul>
+</div>

+ 3481 - 0
doxygen/qpc_metrics.txt

@@ -0,0 +1,3481 @@
+
+           Resource Standard Metrics (TM) for C, C++, C# and Java
+                   Version 7.75 - mSquaredTechnologies.com
+
+  License Type: Windows Single User License
+  Licensed To : Quantum Leaps, LLC
+  License No. : WS2975                          License Date: Dec 15, 2013
+  Build Date  : Sep  2 2009                         Run Date: Dec 26, 2013
+  (C)1996-2009 M Squared Technologies LLC
+  ________________________________________________________________________
+
+                           ~~ Function Metrics ~~
+                      ~~ Complexity Detail Analysis ~~
+                           ~~ Quality Analysis ~~
+
+  File: ..\include\qassert.h
+  ________________________________________________________________________
+
+                          ~~ Total File Summary ~~
+
+  LOC 43       eLOC 42       lLOC 3        Comment 147      Lines      209
+  ________________________________________________________________________
+  End of File: ..\include\qassert.h
+
+
+  File: ..\include\qep.h
+  ________________________________________________________________________
+
+                          ~~ Total File Summary ~~
+
+  LOC 88       eLOC 85       lLOC 35       Comment 297      Lines      419
+  ________________________________________________________________________
+  End of File: ..\include\qep.h
+
+
+  File: ..\include\qequeue.h
+  ________________________________________________________________________
+
+                          ~~ Total File Summary ~~
+
+  LOC 34       eLOC 34       lLOC 15       Comment 203      Lines      259
+  ________________________________________________________________________
+  End of File: ..\include\qequeue.h
+
+
+  File: ..\include\qevt.h
+  ________________________________________________________________________
+
+                          ~~ Total File Summary ~~
+
+  LOC 41       eLOC 41       lLOC 14       Comment 143      Lines      201
+  ________________________________________________________________________
+  End of File: ..\include\qevt.h
+
+
+  File: ..\include\qf.h
+  ________________________________________________________________________
+
+
+    Notice #3: Line 1031, '...' ellipsis found for a variable argument list.
+           The compiler will not check the types of these parameters.
+
+    Notice #3: Line 1035, '...' ellipsis found for a variable argument list.
+           The compiler will not check the types of these parameters.
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 188      eLOC 188      lLOC 74       Comment 902      Lines     1193
+  ________________________________________________________________________
+  End of File: ..\include\qf.h
+
+
+  File: ..\include\qk.h
+  ________________________________________________________________________
+
+                          ~~ Total File Summary ~~
+
+  LOC 64       eLOC 64       lLOC 18       Comment 133      Lines      215
+  ________________________________________________________________________
+  End of File: ..\include\qk.h
+
+
+  File: ..\include\qmpool.h
+  ________________________________________________________________________
+
+                          ~~ Total File Summary ~~
+
+  LOC 42       eLOC 42       lLOC 18       Comment 153      Lines      216
+  ________________________________________________________________________
+  End of File: ..\include\qmpool.h
+
+
+  File: ..\include\qp_port.h
+  ________________________________________________________________________
+
+                          ~~ Total File Summary ~~
+
+  LOC 44       eLOC 44       lLOC 5        Comment 80       Lines      143
+  ________________________________________________________________________
+  End of File: ..\include\qp_port.h
+
+
+  File: ..\include\qpset.h
+  ________________________________________________________________________
+
+                          ~~ Total File Summary ~~
+
+  LOC 45       eLOC 45       lLOC 13       Comment 116      Lines      179
+  ________________________________________________________________________
+  End of File: ..\include\qpset.h
+
+
+  File: ..\include\qs.h
+  ________________________________________________________________________
+
+
+    NOTICE: The end of the source file has been reached where the
+            open brace count { 18 != 16 } close brace count 
+            This is an indication of non-compilable code within the source
+            file.  RSM processes all source code including code wrapped
+            with preprocessor directives.  Accurate metrics requires that
+            all code present in this file must be compilable.
+                          ~~ Total File Summary ~~
+
+  LOC 410      eLOC 406      lLOC 91       Comment 739      Lines     1189
+  ________________________________________________________________________
+  End of File: ..\include\qs.h
+
+
+  File: ..\include\qs_dummy.h
+  ________________________________________________________________________
+
+                          ~~ Total File Summary ~~
+
+  LOC 71       eLOC 71       lLOC 0        Comment 42       Lines      122
+  ________________________________________________________________________
+  End of File: ..\include\qs_dummy.h
+
+
+  File: ..\include\qvanilla.h
+  ________________________________________________________________________
+
+                          ~~ Total File Summary ~~
+
+  LOC 33       eLOC 33       lLOC 2        Comment 59       Lines       93
+  ________________________________________________________________________
+  End of File: ..\include\qvanilla.h
+
+
+  File: ..\qep\source\qep_pkg.h
+  ________________________________________________________________________
+
+                          ~~ Total File Summary ~~
+
+  LOC 33       eLOC 32       lLOC 6        Comment 61       Lines       98
+  ________________________________________________________________________
+  End of File: ..\qep\source\qep_pkg.h
+
+
+  File: ..\qf\source\qf_pkg.h
+  ________________________________________________________________________
+
+                          ~~ Total File Summary ~~
+
+  LOC 66       eLOC 66       lLOC 8        Comment 108      Lines      197
+  ________________________________________________________________________
+  End of File: ..\qf\source\qf_pkg.h
+
+
+  File: ..\qk\source\qk_pkg.h
+  ________________________________________________________________________
+
+                          ~~ Total File Summary ~~
+
+  LOC 21       eLOC 21       lLOC 2        Comment 78       Lines      101
+  ________________________________________________________________________
+  End of File: ..\qk\source\qk_pkg.h
+
+
+  File: ..\qs\source\qs_pkg.h
+  ________________________________________________________________________
+
+                          ~~ Total File Summary ~~
+
+  LOC 28       eLOC 26       lLOC 5        Comment 80       Lines      119
+  ________________________________________________________________________
+  End of File: ..\qs\source\qs_pkg.h
+
+
+  File: ..\qep\source\qep.c
+  ________________________________________________________________________
+
+                          ~~ Total File Summary ~~
+
+  LOC 7        eLOC 6        lLOC 1        Comment 40       Lines       49
+  ________________________________________________________________________
+  End of File: ..\qep\source\qep.c
+
+
+  File: ..\qep\source\qfsm_dis.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 47 -----------------------
+  Function: QFsm_dispatch_
+  Parameters: (QFsm * const me, QEvt const * const e)
+
+  Function: QFsm_dispatch_
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Conditional if / else if: 3     
+  Complexity   Param 2       Return 1      Cyclo Vg 4       Total        7
+  LOC 51       eLOC 45       lLOC 26       Comment 28       Lines       62
+  ------------------------ Function End Line: 108 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 54       eLOC 48       lLOC 26       Comment 67       Lines      108
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         51  Total Function Pts LOC :        0.4
+  Total Function eLOC....:         45  Total Function Pts eLOC:        0.4
+  Total Function lLOC....:         26  Total Function Pts lLOC:        0.2
+  Total Function Params .:          2  Total Function Return .:          1
+  Total Cyclo Complexity :          4  Total Function Complex.:          7
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         51  Average Function LOC ..:      51.00
+  Max Function eLOC .....:         45  Average Function eLOC .:      45.00
+  Max Function lLOC .....:         26  Average Function lLOC .:      26.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          2  Avg Function Parameters:       2.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          3  Avg Interface Complex. :       3.00
+  Max Cyclomatic Complex.:          4  Avg Cyclomatic Complex.:       4.00
+  Max Total Complexity ..:          7  Avg Total Complexity ..:       7.00
+  ________________________________________________________________________
+  End of File: ..\qep\source\qfsm_dis.c
+
+
+  File: ..\qep\source\qfsm_ini.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 47 -----------------------
+  Function: QFsm_ctor
+  Parameters: (QFsm * const me, QStateHandler initial)
+
+  Function: QFsm_ctor
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 9        eLOC 7        lLOC 4        Comment 4        Lines       10
+  ------------------------- Function End Line: 56 ------------------------
+
+  ------------------------ Function Begin Line: 58 -----------------------
+  Function: QFsm_init_
+  Parameters: (QFsm * const me, QEvt const * const e)
+
+  Function: QFsm_init_
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Logical and ( && )      : 2     
+  Complexity   Param 2       Return 1      Cyclo Vg 3       Total        6
+  LOC 19       eLOC 18       lLOC 10       Comment 14       Lines       25
+  ------------------------- Function End Line: 82 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 31       eLOC 28       lLOC 14       Comment 67       Lines       93
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          2
+  Total Function LOC.....:         28  Total Function Pts LOC :        0.2
+  Total Function eLOC....:         25  Total Function Pts eLOC:        0.2
+  Total Function lLOC....:         14  Total Function Pts lLOC:        0.1
+  Total Function Params .:          4  Total Function Return .:          2
+  Total Cyclo Complexity :          4  Total Function Complex.:         10
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         19  Average Function LOC ..:      14.00
+  Max Function eLOC .....:         18  Average Function eLOC .:      12.50
+  Max Function lLOC .....:         10  Average Function lLOC .:       7.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          2  Avg Function Parameters:       2.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          3  Avg Interface Complex. :       3.00
+  Max Cyclomatic Complex.:          3  Avg Cyclomatic Complex.:       2.00
+  Max Total Complexity ..:          6  Avg Total Complexity ..:       5.00
+  ________________________________________________________________________
+  End of File: ..\qep\source\qfsm_ini.c
+
+
+  File: ..\qep\source\qhsm_dis.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 51 -----------------------
+  Function: QHsm_dispatch_
+  Parameters: (QHsm * const me, QEvt const * const e)
+
+    Notice #28: Line 178: The function cyclomatic complexity of
+           11 exceeds the specified limit of 10.
+
+  Function: QHsm_dispatch_
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops while / do        : 5     
+      Loops for / foreach     : 1     
+      Conditional if / else if: 4     
+  Complexity   Param 2       Return 1      Cyclo Vg 11      Total       14
+  LOC 99       eLOC 88       lLOC 59       Comment 49       Lines      128
+  ------------------------ Function End Line: 178 ------------------------
+
+  ----------------------- Function Begin Line: 183 -----------------------
+  Function: QHsm_tran_
+  Parameters: (QHsm * const me, QStateHandler path[QEP_MAX_NEST_DEPTH_])
+
+    Notice #55: Line 227
+           The depth of scope '7' exceeds the notice limit of 6.
+
+    Notice #55: Line 234
+           The depth of scope '7' exceeds the notice limit of 6.
+
+    Notice #55: Line 250
+           The depth of scope '7' exceeds the notice limit of 6.
+
+    Notice #55: Line 251
+           The depth of scope '8' exceeds the notice limit of 6.
+
+    Notice #55: Line 257
+           The depth of scope '8' exceeds the notice limit of 6.
+
+    Notice #55: Line 262
+           The depth of scope '7' exceeds the notice limit of 6.
+
+    Notice #55: Line 267
+           The depth of scope '8' exceeds the notice limit of 6.
+
+    Notice #55: Line 271
+           The depth of scope '9' exceeds the notice limit of 6.
+
+    Notice #55: Line 282
+           The depth of scope '9' exceeds the notice limit of 6.
+
+    Notice #55: Line 283
+           The depth of scope '10' exceeds the notice limit of 6.
+
+    Notice #55: Line 289
+           The depth of scope '10' exceeds the notice limit of 6.
+
+    Notice #28: Line 301: The function cyclomatic complexity of
+           15 exceeds the specified limit of 10.
+
+  Function: QHsm_tran_
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops while / do        : 4     
+      Conditional if / else if: 10    
+  Complexity   Param 2       Return 1      Cyclo Vg 15      Total       18
+  LOC 95       eLOC 74       lLOC 48       Comment 52       Lines      119
+  ------------------------ Function End Line: 301 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 201      eLOC 169      lLOC 108      Comment 140      Lines      301
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          2
+  Total Function LOC.....:        194  Total Function Pts LOC :        1.6
+  Total Function eLOC....:        162  Total Function Pts eLOC:        1.3
+  Total Function lLOC....:        107  Total Function Pts lLOC:        0.8
+  Total Function Params .:          4  Total Function Return .:          2
+  Total Cyclo Complexity :         26  Total Function Complex.:         32
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         99  Average Function LOC ..:      97.00
+  Max Function eLOC .....:         88  Average Function eLOC .:      81.00
+  Max Function lLOC .....:         59  Average Function lLOC .:      53.50
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          2  Avg Function Parameters:       2.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          3  Avg Interface Complex. :       3.00
+  Max Cyclomatic Complex.:         15  Avg Cyclomatic Complex.:      13.00
+  Max Total Complexity ..:         18  Avg Total Complexity ..:      16.00
+  ________________________________________________________________________
+  End of File: ..\qep\source\qhsm_dis.c
+
+
+  File: ..\qep\source\qhsm_in.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 47 -----------------------
+  Function: QHsm_isIn
+  Parameters: (QHsm * const me, QStateHandler const state)
+
+  Function: QHsm_isIn
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops while / do        : 1     
+      Conditional if / else if: 1     
+  Complexity   Param 2       Return 1      Cyclo Vg 3       Total        6
+  LOC 16       eLOC 13       lLOC 9        Comment 9        Lines       19
+  ------------------------- Function End Line: 65 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 19       eLOC 16       lLOC 9        Comment 48       Lines       65
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         16  Total Function Pts LOC :        0.1
+  Total Function eLOC....:         13  Total Function Pts eLOC:        0.1
+  Total Function lLOC....:          9  Total Function Pts lLOC:        0.1
+  Total Function Params .:          2  Total Function Return .:          1
+  Total Cyclo Complexity :          3  Total Function Complex.:          6
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         16  Average Function LOC ..:      16.00
+  Max Function eLOC .....:         13  Average Function eLOC .:      13.00
+  Max Function lLOC .....:          9  Average Function lLOC .:       9.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          2  Avg Function Parameters:       2.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          3  Avg Interface Complex. :       3.00
+  Max Cyclomatic Complex.:          3  Avg Cyclomatic Complex.:       3.00
+  Max Total Complexity ..:          6  Avg Total Complexity ..:       6.00
+  ________________________________________________________________________
+  End of File: ..\qep\source\qhsm_in.c
+
+
+  File: ..\qep\source\qhsm_ini.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 47 -----------------------
+  Function: QHsm_ctor
+  Parameters: (QHsm * const me, QStateHandler initial)
+
+  Function: QHsm_ctor
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 9        eLOC 7        lLOC 4        Comment 3        Lines       10
+  ------------------------- Function End Line: 56 ------------------------
+
+  ------------------------ Function Begin Line: 58 -----------------------
+  Function: QHsm_init_
+  Parameters: (QHsm * const me, QEvt const * const e)
+
+  Function: QHsm_init_
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops while / do        : 3     
+      Logical and ( && )      : 2     
+  Complexity   Param 2       Return 1      Cyclo Vg 6       Total        9
+  LOC 38       eLOC 36       lLOC 25       Comment 19       Lines       49
+  ------------------------ Function End Line: 106 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 50       eLOC 46       lLOC 29       Comment 71       Lines      119
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          2
+  Total Function LOC.....:         47  Total Function Pts LOC :        0.4
+  Total Function eLOC....:         43  Total Function Pts eLOC:        0.4
+  Total Function lLOC....:         29  Total Function Pts lLOC:        0.2
+  Total Function Params .:          4  Total Function Return .:          2
+  Total Cyclo Complexity :          7  Total Function Complex.:         13
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         38  Average Function LOC ..:      23.50
+  Max Function eLOC .....:         36  Average Function eLOC .:      21.50
+  Max Function lLOC .....:         25  Average Function lLOC .:      14.50
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          2  Avg Function Parameters:       2.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          3  Avg Interface Complex. :       3.00
+  Max Cyclomatic Complex.:          6  Avg Cyclomatic Complex.:       3.50
+  Max Total Complexity ..:          9  Avg Total Complexity ..:       6.50
+  ________________________________________________________________________
+  End of File: ..\qep\source\qhsm_ini.c
+
+
+  File: ..\qep\source\qhsm_top.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 44 -----------------------
+  Function: QHsm_top
+  Parameters: (void const * const me, QEvt const * const e)
+
+  Function: QHsm_top
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 5        eLOC 4        lLOC 3        Comment 4        Lines        5
+  ------------------------- Function End Line: 48 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 6        eLOC 5        lLOC 3        Comment 43       Lines       48
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:          5  Total Function Pts LOC :        0.0
+  Total Function eLOC....:          4  Total Function Pts eLOC:        0.0
+  Total Function lLOC....:          3  Total Function Pts lLOC:        0.0
+  Total Function Params .:          2  Total Function Return .:          1
+  Total Cyclo Complexity :          1  Total Function Complex.:          4
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:          5  Average Function LOC ..:       5.00
+  Max Function eLOC .....:          4  Average Function eLOC .:       4.00
+  Max Function lLOC .....:          3  Average Function lLOC .:       3.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          2  Avg Function Parameters:       2.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          3  Avg Interface Complex. :       3.00
+  Max Cyclomatic Complex.:          1  Avg Cyclomatic Complex.:       1.00
+  Max Total Complexity ..:          4  Avg Total Complexity ..:       4.00
+  ________________________________________________________________________
+  End of File: ..\qep\source\qhsm_top.c
+
+
+  File: ..\qep\source\qmsm_dis.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 49 -----------------------
+  Function: QMsm_dispatch_
+  Parameters: (QMsm * const me, QEvt const * const e)
+
+    Notice #44: Line 75, The keyword 'break' has been identified
+           outside a 'switch' logic control structure.  The use
+           of 'break' interrupts the linear logic flow and can create
+           source code which is difficult to maintain.
+
+  Function: QMsm_dispatch_
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops for / foreach     : 2     
+      Conditional if / else if: 6     
+  Complexity   Param 2       Return 1      Cyclo Vg 9       Total       12
+  LOC 71       eLOC 59       lLOC 34       Comment 38       Lines       86
+  ------------------------ Function End Line: 134 ------------------------
+
+  ----------------------- Function Begin Line: 137 -----------------------
+  Function: QMsm_tran_
+  Parameters: (QHsm * const me)
+
+  Function: QMsm_tran_
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops while / do        : 1     
+      Loops for / foreach     : 2     
+      Conditional if / else if: 3     
+  Complexity   Param 1       Return 1      Cyclo Vg 7       Total        9
+  LOC 52       eLOC 43       lLOC 18       Comment 14       Lines       57
+  ------------------------ Function End Line: 193 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 127      eLOC 106      lLOC 53       Comment 92       Lines      193
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          2
+  Total Function LOC.....:        123  Total Function Pts LOC :        1.0
+  Total Function eLOC....:        102  Total Function Pts eLOC:        0.8
+  Total Function lLOC....:         52  Total Function Pts lLOC:        0.4
+  Total Function Params .:          3  Total Function Return .:          2
+  Total Cyclo Complexity :         16  Total Function Complex.:         21
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         71  Average Function LOC ..:      61.50
+  Max Function eLOC .....:         59  Average Function eLOC .:      51.00
+  Max Function lLOC .....:         34  Average Function lLOC .:      26.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          2  Avg Function Parameters:       1.50
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          3  Avg Interface Complex. :       2.50
+  Max Cyclomatic Complex.:          9  Avg Cyclomatic Complex.:       8.00
+  Max Total Complexity ..:         12  Avg Total Complexity ..:      10.50
+  ________________________________________________________________________
+  End of File: ..\qep\source\qmsm_dis.c
+
+
+  File: ..\qep\source\qmsm_ini.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 52 -----------------------
+  Function: QMsm_ctor
+  Parameters: (QMsm * const me, QStateHandler initial)
+
+  Function: QMsm_ctor
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 9        eLOC 7        lLOC 4        Comment 2        Lines        9
+  ------------------------- Function End Line: 60 ------------------------
+
+  ------------------------ Function Begin Line: 62 -----------------------
+  Function: QMsm_init_
+  Parameters: (QMsm * const me, QEvt const * const e)
+
+    Notice #23: Line 82, The '?' operator was identified.  This implied
+           if-else construct can reduce code readability.
+
+  Function: QMsm_init_
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops while / do        : 1     
+      Loops for / foreach     : 1     
+      Conditional if / else if: 1     
+      Inlined if-else ( ? : ) : 1     
+      Logical and ( && )      : 2     
+  Complexity   Param 2       Return 1      Cyclo Vg 7       Total       10
+  LOC 42       eLOC 38       lLOC 18       Comment 17       Lines       48
+  ------------------------ Function End Line: 109 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 57       eLOC 50       lLOC 23       Comment 59       Lines      109
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          2
+  Total Function LOC.....:         51  Total Function Pts LOC :        0.4
+  Total Function eLOC....:         45  Total Function Pts eLOC:        0.4
+  Total Function lLOC....:         22  Total Function Pts lLOC:        0.2
+  Total Function Params .:          4  Total Function Return .:          2
+  Total Cyclo Complexity :          8  Total Function Complex.:         14
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         42  Average Function LOC ..:      25.50
+  Max Function eLOC .....:         38  Average Function eLOC .:      22.50
+  Max Function lLOC .....:         18  Average Function lLOC .:      11.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          2  Avg Function Parameters:       2.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          3  Avg Interface Complex. :       3.00
+  Max Cyclomatic Complex.:          7  Avg Cyclomatic Complex.:       4.00
+  Max Total Complexity ..:         10  Avg Total Complexity ..:       7.00
+  ________________________________________________________________________
+  End of File: ..\qep\source\qmsm_ini.c
+
+
+  File: ..\qf\source\qa_ctor.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 47 -----------------------
+  Function: QActive_ctor
+  Parameters: (QActive * const me, QStateHandler initial)
+
+  Function: QActive_ctor
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 11       eLOC 9        lLOC 3        Comment 3        Lines       11
+  ------------------------- Function End Line: 57 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 12       eLOC 10       lLOC 3        Comment 44       Lines       57
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         11  Total Function Pts LOC :        0.1
+  Total Function eLOC....:          9  Total Function Pts eLOC:        0.1
+  Total Function lLOC....:          3  Total Function Pts lLOC:        0.0
+  Total Function Params .:          2  Total Function Return .:          1
+  Total Cyclo Complexity :          1  Total Function Complex.:          4
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         11  Average Function LOC ..:      11.00
+  Max Function eLOC .....:          9  Average Function eLOC .:       9.00
+  Max Function lLOC .....:          3  Average Function lLOC .:       3.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          2  Avg Function Parameters:       2.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          3  Avg Interface Complex. :       3.00
+  Max Cyclomatic Complex.:          1  Avg Cyclomatic Complex.:       1.00
+  Max Total Complexity ..:          4  Avg Total Complexity ..:       4.00
+  ________________________________________________________________________
+  End of File: ..\qf\source\qa_ctor.c
+
+
+  File: ..\qf\source\qa_defer.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 49 -----------------------
+  Function: QActive_defer
+  Parameters: (QActive * const me, QEQueue * const eq, QEvt const * const 
+              e)
+
+  Function: QActive_defer
+  Complexity   Param 3       Return 1      Cyclo Vg 1       Total        5
+  LOC 4        eLOC 2        lLOC 2        Comment 2        Lines        4
+  ------------------------- Function End Line: 52 ------------------------
+
+  ------------------------ Function Begin Line: 54 -----------------------
+  Function: QActive_recall
+  Parameters: (QActive * const me, QEQueue * const eq)
+
+  Function: QActive_recall
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Conditional if / else if: 2     
+  Complexity   Param 2       Return 1      Cyclo Vg 3       Total        6
+  LOC 19       eLOC 15       lLOC 10       Comment 14       Lines       33
+  ------------------------- Function End Line: 86 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 28       eLOC 22       lLOC 12       Comment 55       Lines       86
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          2
+  Total Function LOC.....:         23  Total Function Pts LOC :        0.2
+  Total Function eLOC....:         17  Total Function Pts eLOC:        0.2
+  Total Function lLOC....:         12  Total Function Pts lLOC:        0.1
+  Total Function Params .:          5  Total Function Return .:          2
+  Total Cyclo Complexity :          4  Total Function Complex.:         11
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         19  Average Function LOC ..:      11.50
+  Max Function eLOC .....:         15  Average Function eLOC .:       8.50
+  Max Function lLOC .....:         10  Average Function lLOC .:       6.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          3  Avg Function Parameters:       2.50
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          4  Avg Interface Complex. :       3.50
+  Max Cyclomatic Complex.:          3  Avg Cyclomatic Complex.:       2.00
+  Max Total Complexity ..:          6  Avg Total Complexity ..:       5.50
+  ________________________________________________________________________
+  End of File: ..\qf\source\qa_defer.c
+
+
+  File: ..\qf\source\qa_fifo.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 57 -----------------------
+  Function: QActive_post_
+  Parameters: (QActive * const me, QEvt const * const e, uint_t const marg
+              in)
+
+  Function: QActive_post_
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Conditional if / else if: 5     
+  Complexity   Param 3       Return 1      Cyclo Vg 6       Total       10
+  LOC 55       eLOC 46       lLOC 34       Comment 36       Lines       65
+  ------------------------ Function End Line: 121 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 65       eLOC 56       lLOC 34       Comment 84       Lines      128
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         55  Total Function Pts LOC :        0.5
+  Total Function eLOC....:         46  Total Function Pts eLOC:        0.4
+  Total Function lLOC....:         34  Total Function Pts lLOC:        0.3
+  Total Function Params .:          3  Total Function Return .:          1
+  Total Cyclo Complexity :          6  Total Function Complex.:         10
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         55  Average Function LOC ..:      55.00
+  Max Function eLOC .....:         46  Average Function eLOC .:      46.00
+  Max Function lLOC .....:         34  Average Function lLOC .:      34.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          3  Avg Function Parameters:       3.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          4  Avg Interface Complex. :       4.00
+  Max Cyclomatic Complex.:          6  Avg Cyclomatic Complex.:       6.00
+  Max Total Complexity ..:         10  Avg Total Complexity ..:      10.00
+  ________________________________________________________________________
+  End of File: ..\qf\source\qa_fifo.c
+
+
+  File: ..\qf\source\qa_get_.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 50 -----------------------
+  Function: QActive_get_
+  Parameters: (QActive * const me)
+
+  Function: QActive_get_
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Conditional if / else if: 2     
+  Complexity   Param 1       Return 1      Cyclo Vg 3       Total        5
+  LOC 37       eLOC 33       lLOC 24       Comment 20       Lines       46
+  ------------------------- Function End Line: 95 ------------------------
+
+  ------------------------ Function Begin Line: 97 -----------------------
+  Function: QF_getQueueMin
+  Parameters: (uint8_t const prio)
+
+  Function: QF_getQueueMin
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Logical and ( && )      : 1     
+  Complexity   Param 1       Return 1      Cyclo Vg 2       Total        4
+  LOC 10       eLOC 9        lLOC 6        Comment 1        Lines       13
+  ------------------------ Function End Line: 109 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 50       eLOC 45       lLOC 30       Comment 63       Lines      109
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          2
+  Total Function LOC.....:         47  Total Function Pts LOC :        0.4
+  Total Function eLOC....:         42  Total Function Pts eLOC:        0.4
+  Total Function lLOC....:         30  Total Function Pts lLOC:        0.2
+  Total Function Params .:          2  Total Function Return .:          2
+  Total Cyclo Complexity :          5  Total Function Complex.:          9
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         37  Average Function LOC ..:      23.50
+  Max Function eLOC .....:         33  Average Function eLOC .:      21.00
+  Max Function lLOC .....:         24  Average Function lLOC .:      15.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          1  Avg Function Parameters:       1.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          2  Avg Interface Complex. :       2.00
+  Max Cyclomatic Complex.:          3  Avg Cyclomatic Complex.:       2.50
+  Max Total Complexity ..:          5  Avg Total Complexity ..:       4.50
+  ________________________________________________________________________
+  End of File: ..\qf\source\qa_get_.c
+
+
+  File: ..\qf\source\qa_lifo.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 50 -----------------------
+  Function: QActive_postLIFO_
+  Parameters: (QActive * const me, QEvt const * const e)
+
+  Function: QActive_postLIFO_
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Conditional if / else if: 4     
+  Complexity   Param 2       Return 1      Cyclo Vg 5       Total        8
+  LOC 37       eLOC 31       lLOC 22       Comment 23       Lines       45
+  ------------------------- Function End Line: 94 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 40       eLOC 34       lLOC 22       Comment 65       Lines       95
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         37  Total Function Pts LOC :        0.3
+  Total Function eLOC....:         31  Total Function Pts eLOC:        0.3
+  Total Function lLOC....:         22  Total Function Pts lLOC:        0.2
+  Total Function Params .:          2  Total Function Return .:          1
+  Total Cyclo Complexity :          5  Total Function Complex.:          8
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         37  Average Function LOC ..:      37.00
+  Max Function eLOC .....:         31  Average Function eLOC .:      31.00
+  Max Function lLOC .....:         22  Average Function lLOC .:      22.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          2  Avg Function Parameters:       2.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          3  Avg Interface Complex. :       3.00
+  Max Cyclomatic Complex.:          5  Avg Cyclomatic Complex.:       5.00
+  Max Total Complexity ..:          8  Avg Total Complexity ..:       8.00
+  ________________________________________________________________________
+  End of File: ..\qf\source\qa_lifo.c
+
+
+  File: ..\qf\source\qa_sub.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 47 -----------------------
+  Function: QActive_subscribe
+  Parameters: (QActive const * const me, enum_t const sig)
+
+  Function: QActive_subscribe
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Logical and ( && )      : 4     
+  Complexity   Param 2       Return 1      Cyclo Vg 5       Total        8
+  LOC 17       eLOC 16       lLOC 9        Comment 5        Lines       21
+  ------------------------- Function End Line: 67 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 20       eLOC 19       lLOC 9        Comment 44       Lines       67
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         17  Total Function Pts LOC :        0.2
+  Total Function eLOC....:         16  Total Function Pts eLOC:        0.1
+  Total Function lLOC....:          9  Total Function Pts lLOC:        0.1
+  Total Function Params .:          2  Total Function Return .:          1
+  Total Cyclo Complexity :          5  Total Function Complex.:          8
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         17  Average Function LOC ..:      17.00
+  Max Function eLOC .....:         16  Average Function eLOC .:      16.00
+  Max Function lLOC .....:          9  Average Function lLOC .:       9.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          2  Avg Function Parameters:       2.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          3  Avg Interface Complex. :       3.00
+  Max Cyclomatic Complex.:          5  Avg Cyclomatic Complex.:       5.00
+  Max Total Complexity ..:          8  Avg Total Complexity ..:       8.00
+  ________________________________________________________________________
+  End of File: ..\qf\source\qa_sub.c
+
+
+  File: ..\qf\source\qa_usub.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 47 -----------------------
+  Function: QActive_unsubscribe
+  Parameters: (QActive const * const me, enum_t const sig)
+
+  Function: QActive_unsubscribe
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Logical and ( && )      : 4     
+  Complexity   Param 2       Return 1      Cyclo Vg 5       Total        8
+  LOC 17       eLOC 16       lLOC 9        Comment 5        Lines       21
+  ------------------------- Function End Line: 67 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 20       eLOC 19       lLOC 9        Comment 44       Lines       67
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         17  Total Function Pts LOC :        0.2
+  Total Function eLOC....:         16  Total Function Pts eLOC:        0.1
+  Total Function lLOC....:          9  Total Function Pts lLOC:        0.1
+  Total Function Params .:          2  Total Function Return .:          1
+  Total Cyclo Complexity :          5  Total Function Complex.:          8
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         17  Average Function LOC ..:      17.00
+  Max Function eLOC .....:         16  Average Function eLOC .:      16.00
+  Max Function lLOC .....:          9  Average Function lLOC .:       9.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          2  Avg Function Parameters:       2.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          3  Avg Interface Complex. :       3.00
+  Max Cyclomatic Complex.:          5  Avg Cyclomatic Complex.:       5.00
+  Max Total Complexity ..:          8  Avg Total Complexity ..:       8.00
+  ________________________________________________________________________
+  End of File: ..\qf\source\qa_usub.c
+
+
+  File: ..\qf\source\qa_usuba.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 47 -----------------------
+  Function: QActive_unsubscribeAll
+  Parameters: (QActive const * const me)
+
+  Function: QActive_unsubscribeAll
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops for / foreach     : 1     
+      Conditional if / else if: 1     
+      Logical and ( && )      : 2     
+  Complexity   Param 1       Return 1      Cyclo Vg 5       Total        7
+  LOC 25       eLOC 21       lLOC 12       Comment 5        Lines       29
+  ------------------------- Function End Line: 75 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 28       eLOC 24       lLOC 12       Comment 44       Lines       75
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         25  Total Function Pts LOC :        0.2
+  Total Function eLOC....:         21  Total Function Pts eLOC:        0.2
+  Total Function lLOC....:         12  Total Function Pts lLOC:        0.1
+  Total Function Params .:          1  Total Function Return .:          1
+  Total Cyclo Complexity :          5  Total Function Complex.:          7
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         25  Average Function LOC ..:      25.00
+  Max Function eLOC .....:         21  Average Function eLOC .:      21.00
+  Max Function lLOC .....:         12  Average Function lLOC .:      12.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          1  Avg Function Parameters:       1.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          2  Avg Interface Complex. :       2.00
+  Max Cyclomatic Complex.:          5  Avg Cyclomatic Complex.:       5.00
+  Max Total Complexity ..:          7  Avg Total Complexity ..:       7.00
+  ________________________________________________________________________
+  End of File: ..\qf\source\qa_usuba.c
+
+
+  File: ..\qf\source\qeq_fifo.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 52 -----------------------
+  Function: QEQueue_post
+  Parameters: (QEQueue * const me, QEvt const * const e, uint_t const marg
+              in)
+
+  Function: QEQueue_post
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Conditional if / else if: 5     
+  Complexity   Param 3       Return 1      Cyclo Vg 6       Total       10
+  LOC 51       eLOC 42       lLOC 30       Comment 31       Lines       62
+  ------------------------ Function End Line: 113 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 56       eLOC 47       lLOC 30       Comment 79       Lines      120
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         51  Total Function Pts LOC :        0.4
+  Total Function eLOC....:         42  Total Function Pts eLOC:        0.4
+  Total Function lLOC....:         30  Total Function Pts lLOC:        0.2
+  Total Function Params .:          3  Total Function Return .:          1
+  Total Cyclo Complexity :          6  Total Function Complex.:         10
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         51  Average Function LOC ..:      51.00
+  Max Function eLOC .....:         42  Average Function eLOC .:      42.00
+  Max Function lLOC .....:         30  Average Function lLOC .:      30.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          3  Avg Function Parameters:       3.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          4  Avg Interface Complex. :       4.00
+  Max Cyclomatic Complex.:          6  Avg Cyclomatic Complex.:       6.00
+  Max Total Complexity ..:         10  Avg Total Complexity ..:      10.00
+  ________________________________________________________________________
+  End of File: ..\qf\source\qeq_fifo.c
+
+
+  File: ..\qf\source\qeq_get.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 48 -----------------------
+  Function: QEQueue_get
+  Parameters: (QEQueue * const me)
+
+  Function: QEQueue_get
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Conditional if / else if: 3     
+  Complexity   Param 1       Return 1      Cyclo Vg 4       Total        6
+  LOC 36       eLOC 31       lLOC 21       Comment 20       Lines       43
+  ------------------------- Function End Line: 90 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 39       eLOC 34       lLOC 21       Comment 60       Lines       90
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         36  Total Function Pts LOC :        0.3
+  Total Function eLOC....:         31  Total Function Pts eLOC:        0.3
+  Total Function lLOC....:         21  Total Function Pts lLOC:        0.2
+  Total Function Params .:          1  Total Function Return .:          1
+  Total Cyclo Complexity :          4  Total Function Complex.:          6
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         36  Average Function LOC ..:      36.00
+  Max Function eLOC .....:         31  Average Function eLOC .:      31.00
+  Max Function lLOC .....:         21  Average Function lLOC .:      21.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          1  Avg Function Parameters:       1.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          2  Avg Interface Complex. :       2.00
+  Max Cyclomatic Complex.:          4  Avg Cyclomatic Complex.:       4.00
+  Max Total Complexity ..:          6  Avg Total Complexity ..:       6.00
+  ________________________________________________________________________
+  End of File: ..\qf\source\qeq_get.c
+
+
+  File: ..\qf\source\qeq_init.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 47 -----------------------
+  Function: QEQueue_init
+  Parameters: (QEQueue * const me, QEvt const *qSto[], uint_t const qLen)
+
+  Function: QEQueue_init
+  Complexity   Param 3       Return 1      Cyclo Vg 1       Total        5
+  LOC 14       eLOC 12       lLOC 9        Comment 6        Lines       16
+  ------------------------- Function End Line: 62 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 17       eLOC 15       lLOC 9        Comment 46       Lines       62
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         14  Total Function Pts LOC :        0.1
+  Total Function eLOC....:         12  Total Function Pts eLOC:        0.1
+  Total Function lLOC....:          9  Total Function Pts lLOC:        0.1
+  Total Function Params .:          3  Total Function Return .:          1
+  Total Cyclo Complexity :          1  Total Function Complex.:          5
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         14  Average Function LOC ..:      14.00
+  Max Function eLOC .....:         12  Average Function eLOC .:      12.00
+  Max Function lLOC .....:          9  Average Function lLOC .:       9.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          3  Avg Function Parameters:       3.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          4  Avg Interface Complex. :       4.00
+  Max Cyclomatic Complex.:          1  Avg Cyclomatic Complex.:       1.00
+  Max Total Complexity ..:          5  Avg Total Complexity ..:       5.00
+  ________________________________________________________________________
+  End of File: ..\qf\source\qeq_init.c
+
+
+  File: ..\qf\source\qeq_lifo.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 48 -----------------------
+  Function: QEQueue_postLIFO
+  Parameters: (QEQueue * const me, QEvt const * const e)
+
+  Function: QEQueue_postLIFO
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Conditional if / else if: 4     
+  Complexity   Param 2       Return 1      Cyclo Vg 5       Total        8
+  LOC 34       eLOC 29       lLOC 21       Comment 22       Lines       41
+  ------------------------- Function End Line: 88 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 37       eLOC 32       lLOC 21       Comment 62       Lines       88
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         34  Total Function Pts LOC :        0.3
+  Total Function eLOC....:         29  Total Function Pts eLOC:        0.3
+  Total Function lLOC....:         21  Total Function Pts lLOC:        0.2
+  Total Function Params .:          2  Total Function Return .:          1
+  Total Cyclo Complexity :          5  Total Function Complex.:          8
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         34  Average Function LOC ..:      34.00
+  Max Function eLOC .....:         29  Average Function eLOC .:      29.00
+  Max Function lLOC .....:         21  Average Function lLOC .:      21.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          2  Avg Function Parameters:       2.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          3  Avg Interface Complex. :       3.00
+  Max Cyclomatic Complex.:          5  Avg Cyclomatic Complex.:       5.00
+  Max Total Complexity ..:          8  Avg Total Complexity ..:       8.00
+  ________________________________________________________________________
+  End of File: ..\qf\source\qeq_lifo.c
+
+
+  File: ..\qf\source\qf_act.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 50 -----------------------
+  Function: QF_add_
+  Parameters: (QActive * const a)
+
+  Function: QF_add_
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Logical and ( && )      : 2     
+  Complexity   Param 1       Return 1      Cyclo Vg 3       Total        5
+  LOC 14       eLOC 13       lLOC 8        Comment 5        Lines       19
+  ------------------------- Function End Line: 68 ------------------------
+
+  ------------------------ Function Begin Line: 70 -----------------------
+  Function: QF_remove_
+  Parameters: (QActive const * const a)
+
+  Function: QF_remove_
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Logical and ( && )      : 2     
+  Complexity   Param 1       Return 1      Cyclo Vg 3       Total        5
+  LOC 14       eLOC 13       lLOC 8        Comment 5        Lines       19
+  ------------------------- Function End Line: 88 ------------------------
+
+  ------------------------ Function Begin Line: 96 -----------------------
+  Function: QF_bzero
+  Parameters: (void * const start, uint_t len)
+
+  Function: QF_bzero
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops while / do        : 1     
+  Complexity   Param 2       Return 1      Cyclo Vg 2       Total        5
+  LOC 8        eLOC 6        lLOC 4        Comment 1        Lines        8
+  ------------------------ Function End Line: 103 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 41       eLOC 37       lLOC 21       Comment 55       Lines      104
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          3
+  Total Function LOC.....:         36  Total Function Pts LOC :        0.3
+  Total Function eLOC....:         32  Total Function Pts eLOC:        0.3
+  Total Function lLOC....:         20  Total Function Pts lLOC:        0.2
+  Total Function Params .:          4  Total Function Return .:          3
+  Total Cyclo Complexity :          8  Total Function Complex.:         15
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         14  Average Function LOC ..:      12.00
+  Max Function eLOC .....:         13  Average Function eLOC .:      10.67
+  Max Function lLOC .....:          8  Average Function lLOC .:       6.67
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          2  Avg Function Parameters:       1.33
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          3  Avg Interface Complex. :       2.33
+  Max Cyclomatic Complex.:          3  Avg Cyclomatic Complex.:       2.67
+  Max Total Complexity ..:          5  Avg Total Complexity ..:       5.00
+  ________________________________________________________________________
+  End of File: ..\qf\source\qf_act.c
+
+
+  File: ..\qf\source\qf_gc.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 47 -----------------------
+  Function: QF_gc
+  Parameters: (QEvt const * const e)
+
+  Function: QF_gc
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Conditional if / else if: 2     
+  Complexity   Param 1       Return 1      Cyclo Vg 3       Total        5
+  LOC 26       eLOC 22       lLOC 13       Comment 14       Lines       35
+  ------------------------- Function End Line: 81 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 29       eLOC 25       lLOC 13       Comment 53       Lines       81
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         26  Total Function Pts LOC :        0.2
+  Total Function eLOC....:         22  Total Function Pts eLOC:        0.2
+  Total Function lLOC....:         13  Total Function Pts lLOC:        0.1
+  Total Function Params .:          1  Total Function Return .:          1
+  Total Cyclo Complexity :          3  Total Function Complex.:          5
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         26  Average Function LOC ..:      26.00
+  Max Function eLOC .....:         22  Average Function eLOC .:      22.00
+  Max Function lLOC .....:         13  Average Function lLOC .:      13.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          1  Avg Function Parameters:       1.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          2  Avg Interface Complex. :       2.00
+  Max Cyclomatic Complex.:          3  Avg Cyclomatic Complex.:       3.00
+  Max Total Complexity ..:          5  Avg Total Complexity ..:       5.00
+  ________________________________________________________________________
+  End of File: ..\qf\source\qf_gc.c
+
+
+  File: ..\qf\source\qf_log2.c
+  ________________________________________________________________________
+
+                          ~~ Total File Summary ~~
+
+  LOC 69       eLOC 68       lLOC 1        Comment 41       Lines      114
+  ________________________________________________________________________
+  End of File: ..\qf\source\qf_log2.c
+
+
+  File: ..\qf\source\qf_new.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 49 -----------------------
+  Function: QEvt_ctor
+  Parameters: (QEvt * const me, enum_t const sig)
+
+  Function: QEvt_ctor
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 5        eLOC 4        lLOC 3        Comment 2        Lines        5
+  ------------------------- Function End Line: 53 ------------------------
+
+  ------------------------ Function Begin Line: 60 -----------------------
+  Function: QF_newX_
+  Parameters: (uint_t const evtSize, uint_t const margin, enum_t const sig
+              )
+
+    Notice #44: Line 68, The keyword 'break' has been identified
+           outside a 'switch' logic control structure.  The use
+           of 'break' interrupts the linear logic flow and can create
+           source code which is difficult to maintain.
+
+  Function: QF_newX_
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops for / foreach     : 1     
+      Conditional if / else if: 2     
+  Complexity   Param 3       Return 1      Cyclo Vg 4       Total        8
+  LOC 26       eLOC 20       lLOC 14       Comment 14       Lines       31
+  ------------------------- Function End Line: 90 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 38       eLOC 31       lLOC 17       Comment 56       Lines       90
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          2
+  Total Function LOC.....:         31  Total Function Pts LOC :        0.3
+  Total Function eLOC....:         24  Total Function Pts eLOC:        0.2
+  Total Function lLOC....:         17  Total Function Pts lLOC:        0.1
+  Total Function Params .:          5  Total Function Return .:          2
+  Total Cyclo Complexity :          5  Total Function Complex.:         12
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         26  Average Function LOC ..:      15.50
+  Max Function eLOC .....:         20  Average Function eLOC .:      12.00
+  Max Function lLOC .....:         14  Average Function lLOC .:       8.50
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          3  Avg Function Parameters:       2.50
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          4  Avg Interface Complex. :       3.50
+  Max Cyclomatic Complex.:          4  Avg Cyclomatic Complex.:       2.50
+  Max Total Complexity ..:          8  Avg Total Complexity ..:       6.00
+  ________________________________________________________________________
+  End of File: ..\qf\source\qf_new.c
+
+
+  File: ..\qf\source\qf_pool.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 53 -----------------------
+  Function: QF_poolInit
+  Parameters: (void * const poolSto, uint_t const poolSize, uint_t const e
+              vtSize)
+
+  Function: QF_poolInit
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Logical or ( || )       : 1     
+  Complexity   Param 3       Return 1      Cyclo Vg 2       Total        6
+  LOC 9        eLOC 7        lLOC 4        Comment 5        Lines       12
+  ------------------------- Function End Line: 64 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 16       eLOC 14       lLOC 6        Comment 47       Lines       64
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:          9  Total Function Pts LOC :        0.1
+  Total Function eLOC....:          7  Total Function Pts eLOC:        0.1
+  Total Function lLOC....:          4  Total Function Pts lLOC:        0.0
+  Total Function Params .:          3  Total Function Return .:          1
+  Total Cyclo Complexity :          2  Total Function Complex.:          6
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:          9  Average Function LOC ..:       9.00
+  Max Function eLOC .....:          7  Average Function eLOC .:       7.00
+  Max Function lLOC .....:          4  Average Function lLOC .:       4.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          3  Avg Function Parameters:       3.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          4  Avg Interface Complex. :       4.00
+  Max Cyclomatic Complex.:          2  Avg Cyclomatic Complex.:       2.00
+  Max Total Complexity ..:          6  Avg Total Complexity ..:       6.00
+  ________________________________________________________________________
+  End of File: ..\qf\source\qf_pool.c
+
+
+  File: ..\qf\source\qf_psini.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 49 -----------------------
+  Function: QF_psInit
+  Parameters: (QSubscrList * const subscrSto, enum_t const maxSignal)
+
+  Function: QF_psInit
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 6        eLOC 5        lLOC 3        Comment 2        Lines        7
+  ------------------------- Function End Line: 55 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 9        eLOC 8        lLOC 5        Comment 49       Lines       63
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:          6  Total Function Pts LOC :        0.1
+  Total Function eLOC....:          5  Total Function Pts eLOC:        0.1
+  Total Function lLOC....:          3  Total Function Pts lLOC:        0.0
+  Total Function Params .:          2  Total Function Return .:          1
+  Total Cyclo Complexity :          1  Total Function Complex.:          4
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:          6  Average Function LOC ..:       6.00
+  Max Function eLOC .....:          5  Average Function eLOC .:       5.00
+  Max Function lLOC .....:          3  Average Function lLOC .:       3.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          2  Avg Function Parameters:       2.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          3  Avg Interface Complex. :       3.00
+  Max Cyclomatic Complex.:          1  Avg Cyclomatic Complex.:       1.00
+  Max Total Complexity ..:          4  Avg Total Complexity ..:       4.00
+  ________________________________________________________________________
+  End of File: ..\qf\source\qf_psini.c
+
+
+  File: ..\qf\source\qf_pspub.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 52 -----------------------
+  Function: QF_publish_
+  Parameters: (QEvt const * const e)
+
+  Function: QF_publish_
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops while / do        : 3     
+      Conditional if / else if: 1     
+  Complexity   Param 1       Return 1      Cyclo Vg 5       Total        7
+  LOC 43       eLOC 34       lLOC 24       Comment 17       Lines       54
+  ------------------------ Function End Line: 105 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 51       eLOC 42       lLOC 24       Comment 64       Lines      114
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         43  Total Function Pts LOC :        0.4
+  Total Function eLOC....:         34  Total Function Pts eLOC:        0.3
+  Total Function lLOC....:         24  Total Function Pts lLOC:        0.2
+  Total Function Params .:          1  Total Function Return .:          1
+  Total Cyclo Complexity :          5  Total Function Complex.:          7
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         43  Average Function LOC ..:      43.00
+  Max Function eLOC .....:         34  Average Function eLOC .:      34.00
+  Max Function lLOC .....:         24  Average Function lLOC .:      24.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          1  Avg Function Parameters:       1.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          2  Avg Interface Complex. :       2.00
+  Max Cyclomatic Complex.:          5  Avg Cyclomatic Complex.:       5.00
+  Max Total Complexity ..:          7  Avg Total Complexity ..:       7.00
+  ________________________________________________________________________
+  End of File: ..\qf\source\qf_pspub.c
+
+
+  File: ..\qf\source\qf_pwr2.c
+  ________________________________________________________________________
+
+                          ~~ Total File Summary ~~
+
+  LOC 58       eLOC 55       lLOC 3        Comment 43       Lines      102
+  ________________________________________________________________________
+  End of File: ..\qf\source\qf_pwr2.c
+
+
+  File: ..\qf\source\qf_tick.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 55 -----------------------
+  Function: QF_tickX_
+  Parameters: (uint8_t const tickRate)
+
+    Notice #107: Line: 66 A double ;; has been identified
+
+    Notice #44: Line 76, The keyword 'break' has been identified
+           outside a 'switch' logic control structure.  The use
+           of 'break' interrupts the linear logic flow and can create
+           source code which is difficult to maintain.
+
+  Function: QF_tickX_
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops for / foreach     : 1     
+      Conditional if / else if: 5     
+  Complexity   Param 1       Return 1      Cyclo Vg 7       Total        9
+  LOC 65       eLOC 53       lLOC 36       Comment 37       Lines       76
+  ------------------------ Function End Line: 130 ------------------------
+
+  ----------------------- Function Begin Line: 132 -----------------------
+  Function: QF_noTimeEvtsActiveX
+  Parameters: (uint8_t const tickRate)
+
+  Function: QF_noTimeEvtsActiveX
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Conditional if / else if: 2     
+  Complexity   Param 1       Return 1      Cyclo Vg 3       Total        5
+  LOC 14       eLOC 10       lLOC 6        Comment 3        Lines       16
+  ------------------------ Function End Line: 147 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 88       eLOC 72       lLOC 43       Comment 99       Lines      166
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          2
+  Total Function LOC.....:         79  Total Function Pts LOC :        0.7
+  Total Function eLOC....:         63  Total Function Pts eLOC:        0.6
+  Total Function lLOC....:         42  Total Function Pts lLOC:        0.3
+  Total Function Params .:          2  Total Function Return .:          2
+  Total Cyclo Complexity :         10  Total Function Complex.:         14
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         65  Average Function LOC ..:      39.50
+  Max Function eLOC .....:         53  Average Function eLOC .:      31.50
+  Max Function lLOC .....:         36  Average Function lLOC .:      21.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          1  Avg Function Parameters:       1.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          2  Avg Interface Complex. :       2.00
+  Max Cyclomatic Complex.:          7  Avg Cyclomatic Complex.:       5.00
+  Max Total Complexity ..:          9  Avg Total Complexity ..:       7.00
+  ________________________________________________________________________
+  End of File: ..\qf\source\qf_tick.c
+
+
+  File: ..\qf\source\qma_ctor.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 47 -----------------------
+  Function: QMActive_ctor
+  Parameters: (QMActive * const me, QStateHandler initial)
+
+  Function: QMActive_ctor
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 11       eLOC 9        lLOC 3        Comment 4        Lines       12
+  ------------------------- Function End Line: 58 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 12       eLOC 10       lLOC 3        Comment 55       Lines       70
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         11  Total Function Pts LOC :        0.1
+  Total Function eLOC....:          9  Total Function Pts eLOC:        0.1
+  Total Function lLOC....:          3  Total Function Pts lLOC:        0.0
+  Total Function Params .:          2  Total Function Return .:          1
+  Total Cyclo Complexity :          1  Total Function Complex.:          4
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         11  Average Function LOC ..:      11.00
+  Max Function eLOC .....:          9  Average Function eLOC .:       9.00
+  Max Function lLOC .....:          3  Average Function lLOC .:       3.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          2  Avg Function Parameters:       2.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          3  Avg Interface Complex. :       3.00
+  Max Cyclomatic Complex.:          1  Avg Cyclomatic Complex.:       1.00
+  Max Total Complexity ..:          4  Avg Total Complexity ..:       4.00
+  ________________________________________________________________________
+  End of File: ..\qf\source\qma_ctor.c
+
+
+  File: ..\qf\source\qmp_get.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 47 -----------------------
+  Function: QMPool_get
+  Parameters: (QMPool * const me, uint_t const margin)
+
+  Function: QMPool_get
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Conditional if / else if: 2     
+  Complexity   Param 2       Return 1      Cyclo Vg 3       Total        6
+  LOC 32       eLOC 28       lLOC 18       Comment 18       Lines       37
+  ------------------------- Function End Line: 83 ------------------------
+
+  ------------------------ Function Begin Line: 85 -----------------------
+  Function: QF_getPoolMin
+  Parameters: (uint_t const poolId)
+
+  Function: QF_getPoolMin
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Logical and ( && )      : 1     
+  Complexity   Param 1       Return 1      Cyclo Vg 2       Total        4
+  LOC 9        eLOC 8        lLOC 6        Comment 1        Lines       12
+  ------------------------- Function End Line: 96 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 44       eLOC 39       lLOC 24       Comment 58       Lines       96
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          2
+  Total Function LOC.....:         41  Total Function Pts LOC :        0.3
+  Total Function eLOC....:         36  Total Function Pts eLOC:        0.3
+  Total Function lLOC....:         24  Total Function Pts lLOC:        0.2
+  Total Function Params .:          3  Total Function Return .:          2
+  Total Cyclo Complexity :          5  Total Function Complex.:         10
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         32  Average Function LOC ..:      20.50
+  Max Function eLOC .....:         28  Average Function eLOC .:      18.00
+  Max Function lLOC .....:         18  Average Function lLOC .:      12.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          2  Avg Function Parameters:       1.50
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          3  Avg Interface Complex. :       2.50
+  Max Cyclomatic Complex.:          3  Avg Cyclomatic Complex.:       2.50
+  Max Total Complexity ..:          6  Avg Total Complexity ..:       5.00
+  ________________________________________________________________________
+  End of File: ..\qf\source\qmp_get.c
+
+
+  File: ..\qf\source\qmp_init.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 49 -----------------------
+  Function: QMPool_init
+  Parameters: (QMPool * const me, void * const poolSto, uint_t poolSize, u
+              int_t blockSize)
+
+  Function: QMPool_init
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops while / do        : 2     
+      Logical and ( && )      : 2     
+  Complexity   Param 4       Return 1      Cyclo Vg 5       Total       10
+  LOC 36       eLOC 32       lLOC 24       Comment 25       Lines       50
+  ------------------------- Function End Line: 98 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 41       eLOC 37       lLOC 24       Comment 64       Lines       99
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         36  Total Function Pts LOC :        0.3
+  Total Function eLOC....:         32  Total Function Pts eLOC:        0.3
+  Total Function lLOC....:         24  Total Function Pts lLOC:        0.2
+  Total Function Params .:          4  Total Function Return .:          1
+  Total Cyclo Complexity :          5  Total Function Complex.:         10
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         36  Average Function LOC ..:      36.00
+  Max Function eLOC .....:         32  Average Function eLOC .:      32.00
+  Max Function lLOC .....:         24  Average Function lLOC .:      24.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          4  Avg Function Parameters:       4.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          5  Avg Interface Complex. :       5.00
+  Max Cyclomatic Complex.:          5  Avg Cyclomatic Complex.:       5.00
+  Max Total Complexity ..:         10  Avg Total Complexity ..:      10.00
+  ________________________________________________________________________
+  End of File: ..\qf\source\qmp_init.c
+
+
+  File: ..\qf\source\qmp_put.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 55 -----------------------
+  Function: QMPool_put
+  Parameters: (QMPool * const me, void *b)
+
+  Function: QMPool_put
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 15       eLOC 14       lLOC 10       Comment 9        Lines       19
+  ------------------------- Function End Line: 73 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 19       eLOC 18       lLOC 10       Comment 54       Lines       73
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         15  Total Function Pts LOC :        0.1
+  Total Function eLOC....:         14  Total Function Pts eLOC:        0.1
+  Total Function lLOC....:         10  Total Function Pts lLOC:        0.1
+  Total Function Params .:          2  Total Function Return .:          1
+  Total Cyclo Complexity :          1  Total Function Complex.:          4
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         15  Average Function LOC ..:      15.00
+  Max Function eLOC .....:         14  Average Function eLOC .:      14.00
+  Max Function lLOC .....:         10  Average Function lLOC .:      10.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          2  Avg Function Parameters:       2.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          3  Avg Interface Complex. :       3.00
+  Max Cyclomatic Complex.:          1  Avg Cyclomatic Complex.:       1.00
+  Max Total Complexity ..:          4  Avg Total Complexity ..:       4.00
+  ________________________________________________________________________
+  End of File: ..\qf\source\qmp_put.c
+
+
+  File: ..\qf\source\qte_arm.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 50 -----------------------
+  Function: QTimeEvt_armX
+  Parameters: (QTimeEvt * const me, QTimeEvtCtr const nTicks, QTimeEvtCtr 
+              const interval)
+
+  Function: QTimeEvt_armX
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Conditional if / else if: 1     
+      Logical and ( && )      : 4     
+  Complexity   Param 3       Return 1      Cyclo Vg 6       Total       10
+  LOC 27       eLOC 24       lLOC 16       Comment 15       Lines       32
+  ------------------------- Function End Line: 81 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 32       eLOC 29       lLOC 16       Comment 69       Lines       96
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         27  Total Function Pts LOC :        0.3
+  Total Function eLOC....:         24  Total Function Pts eLOC:        0.2
+  Total Function lLOC....:         16  Total Function Pts lLOC:        0.1
+  Total Function Params .:          3  Total Function Return .:          1
+  Total Cyclo Complexity :          6  Total Function Complex.:         10
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         27  Average Function LOC ..:      27.00
+  Max Function eLOC .....:         24  Average Function eLOC .:      24.00
+  Max Function lLOC .....:         16  Average Function lLOC .:      16.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          3  Avg Function Parameters:       3.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          4  Avg Interface Complex. :       4.00
+  Max Cyclomatic Complex.:          6  Avg Cyclomatic Complex.:       6.00
+  Max Total Complexity ..:         10  Avg Total Complexity ..:      10.00
+  ________________________________________________________________________
+  End of File: ..\qf\source\qte_arm.c
+
+
+  File: ..\qf\source\qte_ctor.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 49 -----------------------
+  Function: QTimeEvt_ctorX
+  Parameters: (QTimeEvt * const me, QActive * const act, enum_t const sig,
+               uint8_t tickRate)
+
+  Function: QTimeEvt_ctorX
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Logical and ( && )      : 1     
+  Complexity   Param 4       Return 1      Cyclo Vg 2       Total        7
+  LOC 11       eLOC 9        lLOC 8        Comment 7        Lines       13
+  ------------------------- Function End Line: 61 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 16       eLOC 14       lLOC 8        Comment 63       Lines       79
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         11  Total Function Pts LOC :        0.1
+  Total Function eLOC....:          9  Total Function Pts eLOC:        0.1
+  Total Function lLOC....:          8  Total Function Pts lLOC:        0.1
+  Total Function Params .:          4  Total Function Return .:          1
+  Total Cyclo Complexity :          2  Total Function Complex.:          7
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         11  Average Function LOC ..:      11.00
+  Max Function eLOC .....:          9  Average Function eLOC .:       9.00
+  Max Function lLOC .....:          8  Average Function lLOC .:       8.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          4  Avg Function Parameters:       4.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          5  Avg Interface Complex. :       5.00
+  Max Cyclomatic Complex.:          2  Avg Cyclomatic Complex.:       2.00
+  Max Total Complexity ..:          7  Avg Total Complexity ..:       7.00
+  ________________________________________________________________________
+  End of File: ..\qf\source\qte_ctor.c
+
+
+  File: ..\qf\source\qte_ctr.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 45 -----------------------
+  Function: QTimeEvt_ctr
+  Parameters: (QTimeEvt const * const me)
+
+  Function: QTimeEvt_ctr
+  Complexity   Param 1       Return 1      Cyclo Vg 1       Total        3
+  LOC 16       eLOC 15       lLOC 11       Comment 7        Lines       19
+  ------------------------- Function End Line: 63 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 17       eLOC 16       lLOC 11       Comment 46       Lines       63
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         16  Total Function Pts LOC :        0.1
+  Total Function eLOC....:         15  Total Function Pts eLOC:        0.1
+  Total Function lLOC....:         11  Total Function Pts lLOC:        0.1
+  Total Function Params .:          1  Total Function Return .:          1
+  Total Cyclo Complexity :          1  Total Function Complex.:          3
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         16  Average Function LOC ..:      16.00
+  Max Function eLOC .....:         15  Average Function eLOC .:      15.00
+  Max Function lLOC .....:         11  Average Function lLOC .:      11.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          1  Avg Function Parameters:       1.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          2  Avg Interface Complex. :       2.00
+  Max Cyclomatic Complex.:          1  Avg Cyclomatic Complex.:       1.00
+  Max Total Complexity ..:          3  Avg Total Complexity ..:       3.00
+  ________________________________________________________________________
+  End of File: ..\qf\source\qte_ctr.c
+
+
+  File: ..\qf\source\qte_darm.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 45 -----------------------
+  Function: QTimeEvt_disarm
+  Parameters: (QTimeEvt * const me)
+
+  Function: QTimeEvt_disarm
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Conditional if / else if: 1     
+  Complexity   Param 1       Return 1      Cyclo Vg 2       Total        4
+  LOC 29       eLOC 26       lLOC 17       Comment 15       Lines       33
+  ------------------------- Function End Line: 77 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 30       eLOC 27       lLOC 17       Comment 54       Lines       77
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         29  Total Function Pts LOC :        0.2
+  Total Function eLOC....:         26  Total Function Pts eLOC:        0.2
+  Total Function lLOC....:         17  Total Function Pts lLOC:        0.1
+  Total Function Params .:          1  Total Function Return .:          1
+  Total Cyclo Complexity :          2  Total Function Complex.:          4
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         29  Average Function LOC ..:      29.00
+  Max Function eLOC .....:         26  Average Function eLOC .:      26.00
+  Max Function lLOC .....:         17  Average Function lLOC .:      17.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          1  Avg Function Parameters:       1.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          2  Avg Interface Complex. :       2.00
+  Max Cyclomatic Complex.:          2  Avg Cyclomatic Complex.:       2.00
+  Max Total Complexity ..:          4  Avg Total Complexity ..:       4.00
+  ________________________________________________________________________
+  End of File: ..\qf\source\qte_darm.c
+
+
+  File: ..\qf\source\qte_rarm.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 47 -----------------------
+  Function: QTimeEvt_rearm
+  Parameters: (QTimeEvt * const me, QTimeEvtCtr const nTicks)
+
+  Function: QTimeEvt_rearm
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Conditional if / else if: 2     
+      Logical and ( && )      : 3     
+  Complexity   Param 2       Return 1      Cyclo Vg 6       Total        9
+  LOC 32       eLOC 28       lLOC 18       Comment 17       Lines       37
+  ------------------------- Function End Line: 83 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 35       eLOC 31       lLOC 18       Comment 70       Lines       98
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         32  Total Function Pts LOC :        0.3
+  Total Function eLOC....:         28  Total Function Pts eLOC:        0.2
+  Total Function lLOC....:         18  Total Function Pts lLOC:        0.1
+  Total Function Params .:          2  Total Function Return .:          1
+  Total Cyclo Complexity :          6  Total Function Complex.:          9
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         32  Average Function LOC ..:      32.00
+  Max Function eLOC .....:         28  Average Function eLOC .:      28.00
+  Max Function lLOC .....:         18  Average Function lLOC .:      18.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          2  Avg Function Parameters:       2.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          3  Avg Interface Complex. :       3.00
+  Max Cyclomatic Complex.:          6  Avg Cyclomatic Complex.:       6.00
+  Max Total Complexity ..:          9  Avg Total Complexity ..:       9.00
+  ________________________________________________________________________
+  End of File: ..\qf\source\qte_rarm.c
+
+
+  File: ..\qf\source\qvanilla.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 55 -----------------------
+  Function: QF_init
+  Parameters: (void)
+
+  Function: QF_init
+  Complexity   Param 0       Return 1      Cyclo Vg 1       Total        2
+  LOC 6        eLOC 5        lLOC 4        Comment 2        Lines        6
+  ------------------------- Function End Line: 60 ------------------------
+
+  ------------------------ Function Begin Line: 62 -----------------------
+  Function: QF_stop
+  Parameters: (void)
+
+  Function: QF_stop
+  Complexity   Param 0       Return 1      Cyclo Vg 1       Total        2
+  LOC 3        eLOC 2        lLOC 1        Comment 3        Lines        4
+  ------------------------- Function End Line: 65 ------------------------
+
+  ------------------------ Function Begin Line: 67 -----------------------
+  Function: QF_run
+  Parameters: (void)
+
+    Notice #107: Line: 71 A double ;; has been identified
+
+    NOTICE: The end of the source file has been reached where the
+            open brace count { 9 != 8 } close brace count 
+            This is an indication of non-compilable code within the source
+            file.  RSM processes all source code including code wrapped
+            with preprocessor directives.  Accurate metrics requires that
+            all code present in this file must be compilable.
+
+    NOTICE: The end of the source file has been reached where the
+            local function scope remains open.  The last known function
+            will be emitted but metrics cannot be generated in this
+            condition.
+  Function: QF_run
+  Parameters: (void)
+
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 62       eLOC 53       lLOC 30       Comment 78       Lines      134
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          3
+  Total Function LOC.....:          9  Total Function Pts LOC :        0.5
+  Total Function eLOC....:          7  Total Function Pts eLOC:        0.4
+  Total Function lLOC....:          5  Total Function Pts lLOC:        0.2
+  Total Function Params .:          0  Total Function Return .:          2
+  Total Cyclo Complexity :          2  Total Function Complex.:          4
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:          6  Average Function LOC ..:       3.00
+  Max Function eLOC .....:          5  Average Function eLOC .:       2.33
+  Max Function lLOC .....:          4  Average Function lLOC .:       1.67
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          0  Avg Function Parameters:       0.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       0.67
+  Max Interface Complex. :          1  Avg Interface Complex. :       0.67
+  Max Cyclomatic Complex.:          1  Avg Cyclomatic Complex.:       0.67
+  Max Total Complexity ..:          2  Avg Total Complexity ..:       1.33
+  ________________________________________________________________________
+  End of File: ..\qf\source\qvanilla.c
+
+
+  File: ..\qk\source\qk.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 62 -----------------------
+  Function: QF_init
+  Parameters: (void)
+
+  Function: QF_init
+  Complexity   Param 0       Return 1      Cyclo Vg 1       Total        2
+  LOC 14       eLOC 13       lLOC 10       Comment 5        Lines       16
+  ------------------------- Function End Line: 77 ------------------------
+
+  ------------------------ Function Begin Line: 79 -----------------------
+  Function: QF_stop
+  Parameters: (void)
+
+  Function: QF_stop
+  Complexity   Param 0       Return 1      Cyclo Vg 1       Total        2
+  LOC 3        eLOC 2        lLOC 1        Comment 3        Lines        4
+  ------------------------- Function End Line: 82 ------------------------
+
+  ------------------------ Function Begin Line: 84 -----------------------
+  Function: initialize
+  Parameters: (void)
+
+  Function: initialize
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Conditional if / else if: 1     
+  Complexity   Param 0       Return 1      Cyclo Vg 2       Total        3
+  LOC 8        eLOC 6        lLOC 4        Comment 3        Lines        9
+  ------------------------- Function End Line: 92 ------------------------
+
+  ------------------------ Function Begin Line: 94 -----------------------
+  Function: QF_run
+  Parameters: (void)
+
+    Notice #107: Line: 100 A double ;; has been identified
+
+  Function: QF_run
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops for / foreach     : 1     
+  Complexity   Param 0       Return 1      Cyclo Vg 2       Total        3
+  LOC 12       eLOC 10       lLOC 7        Comment 5        Lines       14
+  ------------------------ Function End Line: 107 ------------------------
+
+  ----------------------- Function Begin Line: 113 -----------------------
+  Function: QActive_start_
+  Parameters: (QActive *me, uint_t prio, QEvt const *qSto[], uint_t qLen, 
+              void *stkSto, uint_t stkSize, QEvt const *ie)
+
+    Notice #29: Line 130: The number of function input parameters,
+           7 exceeds the specified limit of 6.
+
+  Function: QActive_start_
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Logical or ( || )       : 1     
+      Logical and ( && )      : 2     
+  Complexity   Param 7       Return 1      Cyclo Vg 4       Total       12
+  LOC 14       eLOC 12       lLOC 9        Comment 7        Lines       18
+  ------------------------ Function End Line: 130 ------------------------
+
+  ----------------------- Function Begin Line: 132 -----------------------
+  Function: QActive_stop
+  Parameters: (QActive *me)
+
+  Function: QActive_stop
+  Complexity   Param 1       Return 1      Cyclo Vg 1       Total        3
+  LOC 3        eLOC 2        lLOC 1        Comment 2        Lines        3
+  ------------------------ Function End Line: 134 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 69       eLOC 60       lLOC 37       Comment 76       Lines      141
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          6
+  Total Function LOC.....:         54  Total Function Pts LOC :        0.5
+  Total Function eLOC....:         45  Total Function Pts eLOC:        0.5
+  Total Function lLOC....:         32  Total Function Pts lLOC:        0.3
+  Total Function Params .:          8  Total Function Return .:          6
+  Total Cyclo Complexity :         11  Total Function Complex.:         25
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         14  Average Function LOC ..:       9.00
+  Max Function eLOC .....:         13  Average Function eLOC .:       7.50
+  Max Function lLOC .....:         10  Average Function lLOC .:       5.33
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          7  Avg Function Parameters:       1.33
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          8  Avg Interface Complex. :       2.33
+  Max Cyclomatic Complex.:          4  Avg Cyclomatic Complex.:       1.83
+  Max Total Complexity ..:         12  Avg Total Complexity ..:       4.17
+  ________________________________________________________________________
+  End of File: ..\qk\source\qk.c
+
+
+  File: ..\qk\source\qk_ext.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 48 -----------------------
+  Function: QK_schedExt_
+  Parameters: (uint8_t p)
+
+  Function: QK_schedExt_
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops while / do        : 1     
+      Conditional if / else if: 5     
+      Logical or ( || )       : 1     
+  Complexity   Param 1       Return 1      Cyclo Vg 8       Total       10
+  LOC 61       eLOC 54       lLOC 27       Comment 32       Lines       72
+  ------------------------ Function End Line: 119 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 62       eLOC 55       lLOC 27       Comment 73       Lines      119
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         61  Total Function Pts LOC :        0.5
+  Total Function eLOC....:         54  Total Function Pts eLOC:        0.4
+  Total Function lLOC....:         27  Total Function Pts lLOC:        0.2
+  Total Function Params .:          1  Total Function Return .:          1
+  Total Cyclo Complexity :          8  Total Function Complex.:         10
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         61  Average Function LOC ..:      61.00
+  Max Function eLOC .....:         54  Average Function eLOC .:      54.00
+  Max Function lLOC .....:         27  Average Function lLOC .:      27.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          1  Avg Function Parameters:       1.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          2  Avg Interface Complex. :       2.00
+  Max Cyclomatic Complex.:          8  Avg Cyclomatic Complex.:       8.00
+  Max Total Complexity ..:         10  Avg Total Complexity ..:      10.00
+  ________________________________________________________________________
+  End of File: ..\qk\source\qk_ext.c
+
+
+  File: ..\qk\source\qk_mutex.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 54 -----------------------
+  Function: QK_mutexLock
+  Parameters: (uint8_t prioCeiling)
+
+  Function: QK_mutexLock
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Conditional if / else if: 1     
+  Complexity   Param 1       Return 1      Cyclo Vg 2       Total        4
+  LOC 16       eLOC 14       lLOC 9        Comment 6        Lines       18
+  ------------------------- Function End Line: 71 ------------------------
+
+  ------------------------ Function Begin Line: 73 -----------------------
+  Function: QK_mutexUnlock
+  Parameters: (QMutex mutex)
+
+  Function: QK_mutexUnlock
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Conditional if / else if: 2     
+  Complexity   Param 1       Return 1      Cyclo Vg 3       Total        5
+  LOC 17       eLOC 14       lLOC 8        Comment 6        Lines       19
+  ------------------------- Function End Line: 91 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 38       eLOC 33       lLOC 18       Comment 55       Lines       91
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          2
+  Total Function LOC.....:         33  Total Function Pts LOC :        0.3
+  Total Function eLOC....:         28  Total Function Pts eLOC:        0.3
+  Total Function lLOC....:         17  Total Function Pts lLOC:        0.1
+  Total Function Params .:          2  Total Function Return .:          2
+  Total Cyclo Complexity :          5  Total Function Complex.:          9
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         17  Average Function LOC ..:      16.50
+  Max Function eLOC .....:         14  Average Function eLOC .:      14.00
+  Max Function lLOC .....:          9  Average Function lLOC .:       8.50
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          1  Avg Function Parameters:       1.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          2  Avg Interface Complex. :       2.00
+  Max Cyclomatic Complex.:          3  Avg Cyclomatic Complex.:       2.50
+  Max Total Complexity ..:          5  Avg Total Complexity ..:       4.50
+  ________________________________________________________________________
+  End of File: ..\qk\source\qk_mutex.c
+
+
+  File: ..\qk\source\qk_sched.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 48 -----------------------
+  Function: QK_schedPrio_
+  Parameters: (void)
+
+  Function: QK_schedPrio_
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Conditional if / else if: 2     
+  Complexity   Param 0       Return 1      Cyclo Vg 3       Total        4
+  LOC 19       eLOC 15       lLOC 6        Comment 7        Lines       22
+  ------------------------- Function End Line: 69 ------------------------
+
+  ------------------------ Function Begin Line: 72 -----------------------
+  Function: QK_sched_
+  Parameters: (uint8_t p)
+
+  Function: QK_sched_
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops while / do        : 1     
+      Conditional if / else if: 4     
+  Complexity   Param 1       Return 1      Cyclo Vg 6       Total        8
+  LOC 50       eLOC 44       lLOC 24       Comment 26       Lines       60
+  ------------------------ Function End Line: 131 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 70       eLOC 60       lLOC 30       Comment 74       Lines      131
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          2
+  Total Function LOC.....:         69  Total Function Pts LOC :        0.5
+  Total Function eLOC....:         59  Total Function Pts eLOC:        0.5
+  Total Function lLOC....:         30  Total Function Pts lLOC:        0.2
+  Total Function Params .:          1  Total Function Return .:          2
+  Total Cyclo Complexity :          9  Total Function Complex.:         12
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         50  Average Function LOC ..:      34.50
+  Max Function eLOC .....:         44  Average Function eLOC .:      29.50
+  Max Function lLOC .....:         24  Average Function lLOC .:      15.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          1  Avg Function Parameters:       0.50
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          2  Avg Interface Complex. :       1.50
+  Max Cyclomatic Complex.:          6  Avg Cyclomatic Complex.:       4.50
+  Max Total Complexity ..:          8  Avg Total Complexity ..:       6.00
+  ________________________________________________________________________
+  End of File: ..\qk\source\qk_sched.c
+
+
+  File: ..\qs\source\qs.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 51 -----------------------
+  Function: QS_initBuf
+  Parameters: (uint8_t sto[], uint_t stoSize)
+
+  Function: QS_initBuf
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 11       eLOC 10       lLOC 9        Comment 3        Lines       14
+  ------------------------- Function End Line: 64 ------------------------
+
+  ------------------------ Function Begin Line: 66 -----------------------
+  Function: QS_filterOn
+  Parameters: (uint8_t rec)
+
+  Function: QS_filterOn
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops for / foreach     : 1     
+      Conditional if / else if: 1     
+  Complexity   Param 1       Return 1      Cyclo Vg 3       Total        5
+  LOC 17       eLOC 12       lLOC 6        Comment 3        Lines       18
+  ------------------------- Function End Line: 83 ------------------------
+
+  ------------------------ Function Begin Line: 85 -----------------------
+  Function: QS_filterOff
+  Parameters: (uint8_t rec)
+
+  Function: QS_filterOff
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Conditional if / else if: 1     
+  Complexity   Param 1       Return 1      Cyclo Vg 2       Total        4
+  LOC 27       eLOC 24       lLOC 35       Comment 6        Lines       35
+  ------------------------ Function End Line: 119 ------------------------
+
+  ----------------------- Function Begin Line: 121 -----------------------
+  Function: QS_beginRec
+  Parameters: (uint8_t rec)
+
+  Function: QS_beginRec
+  Complexity   Param 1       Return 1      Cyclo Vg 1       Total        3
+  LOC 14       eLOC 13       lLOC 10       Comment 11       Lines       18
+  ------------------------ Function End Line: 138 ------------------------
+
+  ----------------------- Function Begin Line: 140 -----------------------
+  Function: QS_endRec
+  Parameters: (void)
+
+  Function: QS_endRec
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Conditional if / else if: 2     
+      Logical and ( && )      : 1     
+  Complexity   Param 0       Return 1      Cyclo Vg 4       Total        5
+  LOC 21       eLOC 17       lLOC 9        Comment 9        Lines       25
+  ------------------------ Function End Line: 164 ------------------------
+
+  ----------------------- Function Begin Line: 166 -----------------------
+  Function: QS_u8
+  Parameters: (uint8_t format, uint8_t d)
+
+  Function: QS_u8
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 11       eLOC 10       lLOC 7        Comment 8        Lines       14
+  ------------------------ Function End Line: 179 ------------------------
+
+  ----------------------- Function Begin Line: 181 -----------------------
+  Function: QS_u16
+  Parameters: (uint8_t format, uint16_t d)
+
+  Function: QS_u16
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 15       eLOC 14       lLOC 10       Comment 8        Lines       20
+  ------------------------ Function End Line: 200 ------------------------
+
+  ----------------------- Function Begin Line: 202 -----------------------
+  Function: QS_u32
+  Parameters: (uint8_t format, uint32_t d)
+
+  Function: QS_u32
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops for / foreach     : 1     
+  Complexity   Param 2       Return 1      Cyclo Vg 2       Total        5
+  LOC 16       eLOC 14       lLOC 11       Comment 10       Lines       19
+  ------------------------ Function End Line: 220 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 136      eLOC 118      lLOC 98       Comment 106      Lines      229
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          8
+  Total Function LOC.....:        132  Total Function Pts LOC :        1.1
+  Total Function eLOC....:        114  Total Function Pts eLOC:        0.9
+  Total Function lLOC....:         97  Total Function Pts lLOC:        0.8
+  Total Function Params .:         11  Total Function Return .:          8
+  Total Cyclo Complexity :         15  Total Function Complex.:         34
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         27  Average Function LOC ..:      16.50
+  Max Function eLOC .....:         24  Average Function eLOC .:      14.25
+  Max Function lLOC .....:         35  Average Function lLOC .:      12.13
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          2  Avg Function Parameters:       1.38
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          3  Avg Interface Complex. :       2.38
+  Max Cyclomatic Complex.:          4  Avg Cyclomatic Complex.:       1.88
+  Max Total Complexity ..:          5  Avg Total Complexity ..:       4.25
+  ________________________________________________________________________
+  End of File: ..\qs\source\qs.c
+
+
+  File: ..\qs\source\qs_.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 44 -----------------------
+  Function: QS_u8_
+  Parameters: (uint8_t d)
+
+  Function: QS_u8_
+  Complexity   Param 1       Return 1      Cyclo Vg 1       Total        3
+  LOC 10       eLOC 9        lLOC 7        Comment 8        Lines       12
+  ------------------------- Function End Line: 55 ------------------------
+
+  ------------------------ Function Begin Line: 57 -----------------------
+  Function: QS_u8u8_
+  Parameters: (uint8_t d1, uint8_t d2)
+
+  Function: QS_u8u8_
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 11       eLOC 10       lLOC 7        Comment 8        Lines       13
+  ------------------------- Function End Line: 69 ------------------------
+
+  ------------------------ Function Begin Line: 71 -----------------------
+  Function: QS_u16_
+  Parameters: (uint16_t d)
+
+  Function: QS_u16_
+  Complexity   Param 1       Return 1      Cyclo Vg 1       Total        3
+  LOC 14       eLOC 13       lLOC 10       Comment 8        Lines       18
+  ------------------------- Function End Line: 88 ------------------------
+
+  ------------------------ Function Begin Line: 90 -----------------------
+  Function: QS_u32_
+  Parameters: (uint32_t d)
+
+  Function: QS_u32_
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops for / foreach     : 1     
+  Complexity   Param 1       Return 1      Cyclo Vg 2       Total        4
+  LOC 15       eLOC 13       lLOC 11       Comment 8        Lines       17
+  ------------------------ Function End Line: 106 ------------------------
+
+  ----------------------- Function Begin Line: 108 -----------------------
+  Function: QS_str_
+  Parameters: (char_t const *s)
+
+  Function: QS_str_
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops while / do        : 1     
+  Complexity   Param 1       Return 1      Cyclo Vg 2       Total        4
+  LOC 20       eLOC 18       lLOC 14       Comment 12       Lines       22
+  ------------------------ Function End Line: 129 ------------------------
+
+  ----------------------- Function Begin Line: 131 -----------------------
+  Function: QS_str_ROM_
+  Parameters: (char_t const Q_ROM *s)
+
+  Function: QS_str_ROM_
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops while / do        : 1     
+  Complexity   Param 1       Return 1      Cyclo Vg 2       Total        4
+  LOC 20       eLOC 18       lLOC 14       Comment 12       Lines       22
+  ------------------------ Function End Line: 152 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 91       eLOC 82       lLOC 63       Comment 95       Lines      152
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          6
+  Total Function LOC.....:         90  Total Function Pts LOC :        0.7
+  Total Function eLOC....:         81  Total Function Pts eLOC:        0.6
+  Total Function lLOC....:         63  Total Function Pts lLOC:        0.5
+  Total Function Params .:          7  Total Function Return .:          6
+  Total Cyclo Complexity :          9  Total Function Complex.:         22
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         20  Average Function LOC ..:      15.00
+  Max Function eLOC .....:         18  Average Function eLOC .:      13.50
+  Max Function lLOC .....:         14  Average Function lLOC .:      10.50
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          2  Avg Function Parameters:       1.17
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          3  Avg Interface Complex. :       2.17
+  Max Cyclomatic Complex.:          2  Avg Cyclomatic Complex.:       1.50
+  Max Total Complexity ..:          4  Avg Total Complexity ..:       3.67
+  ________________________________________________________________________
+  End of File: ..\qs\source\qs_.c
+
+
+  File: ..\qs\source\qs_blk.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 45 -----------------------
+  Function: QS_getBlock
+  Parameters: (uint16_t *pNbytes)
+
+  Function: QS_getBlock
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Conditional if / else if: 4     
+  Complexity   Param 1       Return 1      Cyclo Vg 5       Total        7
+  LOC 29       eLOC 23       lLOC 17       Comment 9        Lines       30
+  ------------------------- Function End Line: 74 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 30       eLOC 24       lLOC 17       Comment 48       Lines       74
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         29  Total Function Pts LOC :        0.2
+  Total Function eLOC....:         23  Total Function Pts eLOC:        0.2
+  Total Function lLOC....:         17  Total Function Pts lLOC:        0.1
+  Total Function Params .:          1  Total Function Return .:          1
+  Total Cyclo Complexity :          5  Total Function Complex.:          7
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         29  Average Function LOC ..:      29.00
+  Max Function eLOC .....:         23  Average Function eLOC .:      23.00
+  Max Function lLOC .....:         17  Average Function lLOC .:      17.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          1  Avg Function Parameters:       1.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          2  Avg Interface Complex. :       2.00
+  Max Cyclomatic Complex.:          5  Avg Cyclomatic Complex.:       5.00
+  Max Total Complexity ..:          7  Avg Total Complexity ..:       7.00
+  ________________________________________________________________________
+  End of File: ..\qs\source\qs_blk.c
+
+
+  File: ..\qs\source\qs_byte.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 44 -----------------------
+  Function: QS_getByte
+  Parameters: (void)
+
+  Function: QS_getByte
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Conditional if / else if: 2     
+  Complexity   Param 0       Return 1      Cyclo Vg 3       Total        4
+  LOC 18       eLOC 14       lLOC 10       Comment 10       Lines       18
+  ------------------------- Function End Line: 61 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 19       eLOC 15       lLOC 10       Comment 49       Lines       61
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         18  Total Function Pts LOC :        0.1
+  Total Function eLOC....:         14  Total Function Pts eLOC:        0.1
+  Total Function lLOC....:         10  Total Function Pts lLOC:        0.1
+  Total Function Params .:          0  Total Function Return .:          1
+  Total Cyclo Complexity :          3  Total Function Complex.:          4
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         18  Average Function LOC ..:      18.00
+  Max Function eLOC .....:         14  Average Function eLOC .:      14.00
+  Max Function lLOC .....:         10  Average Function lLOC .:      10.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          0  Avg Function Parameters:       0.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          1  Avg Interface Complex. :       1.00
+  Max Cyclomatic Complex.:          3  Avg Cyclomatic Complex.:       3.00
+  Max Total Complexity ..:          4  Avg Total Complexity ..:       4.00
+  ________________________________________________________________________
+  End of File: ..\qs\source\qs_byte.c
+
+
+  File: ..\qs\source\qs_dict.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 47 -----------------------
+  Function: QS_sig_dict
+  Parameters: (enum_t const sig, void const * const obj, char_t const Q_RO
+              M * const name)
+
+  Function: QS_sig_dict
+  Complexity   Param 3       Return 1      Cyclo Vg 1       Total        5
+  LOC 11       eLOC 9        lLOC 8        Comment 1        Lines       11
+  ------------------------- Function End Line: 57 ------------------------
+
+  ------------------------ Function Begin Line: 61 -----------------------
+  Function: QS_obj_dict
+  Parameters: (void const * const obj, char_t const Q_ROM * const name)
+
+  Function: QS_obj_dict
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 10       eLOC 8        lLOC 7        Comment 1        Lines       10
+  ------------------------- Function End Line: 70 ------------------------
+
+  ------------------------ Function Begin Line: 74 -----------------------
+  Function: QS_fun_dict
+  Parameters: (void (* const fun)(void), char_t const Q_ROM * const name)
+
+  Function: QS_fun_dict
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 10       eLOC 8        lLOC 7        Comment 1        Lines       10
+  ------------------------- Function End Line: 83 ------------------------
+
+  ------------------------ Function Begin Line: 87 -----------------------
+  Function: QS_usr_dict
+  Parameters: (enum_t const rec, char_t const Q_ROM * const name)
+
+  Function: QS_usr_dict
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 10       eLOC 8        lLOC 7        Comment 1        Lines       10
+  ------------------------- Function End Line: 96 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 50       eLOC 42       lLOC 29       Comment 44       Lines       96
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          4
+  Total Function LOC.....:         41  Total Function Pts LOC :        0.4
+  Total Function eLOC....:         33  Total Function Pts eLOC:        0.3
+  Total Function lLOC....:         29  Total Function Pts lLOC:        0.2
+  Total Function Params .:          9  Total Function Return .:          4
+  Total Cyclo Complexity :          4  Total Function Complex.:         17
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         11  Average Function LOC ..:      10.25
+  Max Function eLOC .....:          9  Average Function eLOC .:       8.25
+  Max Function lLOC .....:          8  Average Function lLOC .:       7.25
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          3  Avg Function Parameters:       2.25
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          4  Avg Interface Complex. :       3.25
+  Max Cyclomatic Complex.:          1  Avg Cyclomatic Complex.:       1.00
+  Max Total Complexity ..:          5  Avg Total Complexity ..:       4.25
+  ________________________________________________________________________
+  End of File: ..\qs\source\qs_dict.c
+
+
+  File: ..\qs\source\qs_f32.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 44 -----------------------
+  Function: QS_f32
+  Parameters: (uint8_t format, float32_t f)
+
+  Function: QS_f32
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops for / foreach     : 1     
+  Complexity   Param 2       Return 1      Cyclo Vg 2       Total        5
+  LOC 21       eLOC 19       lLOC 15       Comment 12       Lines       25
+  ------------------------- Function End Line: 68 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 22       eLOC 20       lLOC 15       Comment 51       Lines       68
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         21  Total Function Pts LOC :        0.2
+  Total Function eLOC....:         19  Total Function Pts eLOC:        0.2
+  Total Function lLOC....:         15  Total Function Pts lLOC:        0.1
+  Total Function Params .:          2  Total Function Return .:          1
+  Total Cyclo Complexity :          2  Total Function Complex.:          5
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         21  Average Function LOC ..:      21.00
+  Max Function eLOC .....:         19  Average Function eLOC .:      19.00
+  Max Function lLOC .....:         15  Average Function lLOC .:      15.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          2  Avg Function Parameters:       2.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          3  Avg Interface Complex. :       3.00
+  Max Cyclomatic Complex.:          2  Avg Cyclomatic Complex.:       2.00
+  Max Total Complexity ..:          5  Avg Total Complexity ..:       5.00
+  ________________________________________________________________________
+  End of File: ..\qs\source\qs_f32.c
+
+
+  File: ..\qs\source\qs_f64.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 44 -----------------------
+  Function: QS_f64
+  Parameters: (uint8_t format, float64_t d)
+
+  Function: QS_f64
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops for / foreach     : 2     
+  Complexity   Param 2       Return 1      Cyclo Vg 3       Total        6
+  LOC 29       eLOC 26       lLOC 20       Comment 9        Lines       33
+  ------------------------- Function End Line: 76 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 30       eLOC 27       lLOC 20       Comment 48       Lines       76
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         29  Total Function Pts LOC :        0.2
+  Total Function eLOC....:         26  Total Function Pts eLOC:        0.2
+  Total Function lLOC....:         20  Total Function Pts lLOC:        0.2
+  Total Function Params .:          2  Total Function Return .:          1
+  Total Cyclo Complexity :          3  Total Function Complex.:          6
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         29  Average Function LOC ..:      29.00
+  Max Function eLOC .....:         26  Average Function eLOC .:      26.00
+  Max Function lLOC .....:         20  Average Function lLOC .:      20.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          2  Avg Function Parameters:       2.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          3  Avg Interface Complex. :       3.00
+  Max Cyclomatic Complex.:          3  Avg Cyclomatic Complex.:       3.00
+  Max Total Complexity ..:          6  Avg Total Complexity ..:       6.00
+  ________________________________________________________________________
+  End of File: ..\qs\source\qs_f64.c
+
+
+  File: ..\qs\source\qs_mem.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 44 -----------------------
+  Function: QS_mem
+  Parameters: (uint8_t const *blk, uint8_t size)
+
+  Function: QS_mem
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops while / do        : 1     
+  Complexity   Param 2       Return 1      Cyclo Vg 2       Total        5
+  LOC 18       eLOC 16       lLOC 11       Comment 7        Lines       21
+  ------------------------- Function End Line: 64 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 19       eLOC 17       lLOC 11       Comment 46       Lines       64
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          1
+  Total Function LOC.....:         18  Total Function Pts LOC :        0.1
+  Total Function eLOC....:         16  Total Function Pts eLOC:        0.1
+  Total Function lLOC....:         11  Total Function Pts lLOC:        0.1
+  Total Function Params .:          2  Total Function Return .:          1
+  Total Cyclo Complexity :          2  Total Function Complex.:          5
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         18  Average Function LOC ..:      18.00
+  Max Function eLOC .....:         16  Average Function eLOC .:      16.00
+  Max Function lLOC .....:         11  Average Function lLOC .:      11.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          2  Avg Function Parameters:       2.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          3  Avg Interface Complex. :       3.00
+  Max Cyclomatic Complex.:          2  Avg Cyclomatic Complex.:       2.00
+  Max Total Complexity ..:          5  Avg Total Complexity ..:       5.00
+  ________________________________________________________________________
+  End of File: ..\qs\source\qs_mem.c
+
+
+  File: ..\qs\source\qs_str.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 44 -----------------------
+  Function: QS_str
+  Parameters: (char_t const *s)
+
+  Function: QS_str
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops while / do        : 1     
+  Complexity   Param 1       Return 1      Cyclo Vg 2       Total        4
+  LOC 21       eLOC 19       lLOC 14       Comment 12       Lines       24
+  ------------------------- Function End Line: 67 ------------------------
+
+  ------------------------ Function Begin Line: 69 -----------------------
+  Function: QS_str_ROM
+  Parameters: (char_t const Q_ROM *s)
+
+  Function: QS_str_ROM
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops while / do        : 1     
+  Complexity   Param 1       Return 1      Cyclo Vg 2       Total        4
+  LOC 21       eLOC 19       lLOC 14       Comment 12       Lines       25
+  ------------------------- Function End Line: 93 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 43       eLOC 39       lLOC 28       Comment 63       Lines       93
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          2
+  Total Function LOC.....:         42  Total Function Pts LOC :        0.3
+  Total Function eLOC....:         38  Total Function Pts eLOC:        0.3
+  Total Function lLOC....:         28  Total Function Pts lLOC:        0.2
+  Total Function Params .:          2  Total Function Return .:          2
+  Total Cyclo Complexity :          4  Total Function Complex.:          8
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         21  Average Function LOC ..:      21.00
+  Max Function eLOC .....:         19  Average Function eLOC .:      19.00
+  Max Function lLOC .....:         14  Average Function lLOC .:      14.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          1  Avg Function Parameters:       1.00
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          2  Avg Interface Complex. :       2.00
+  Max Cyclomatic Complex.:          2  Avg Cyclomatic Complex.:       2.00
+  Max Total Complexity ..:          4  Avg Total Complexity ..:       4.00
+  ________________________________________________________________________
+  End of File: ..\qs\source\qs_str.c
+
+
+  File: ..\qs\source\qs_u64.c
+  ________________________________________________________________________
+
+
+  ------------------------ Function Begin Line: 46 -----------------------
+  Function: QS_u64_
+  Parameters: (uint64_t d)
+
+  Function: QS_u64_
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops for / foreach     : 1     
+  Complexity   Param 1       Return 1      Cyclo Vg 2       Total        4
+  LOC 15       eLOC 13       lLOC 11       Comment 4        Lines       17
+  ------------------------- Function End Line: 62 ------------------------
+
+  ------------------------ Function Begin Line: 64 -----------------------
+  Function: QS_u64
+  Parameters: (uint8_t format, uint64_t d)
+
+  Function: QS_u64
+    Cyclomatic Complexity Vg Detail
+      Function Base           : 1
+      Loops for / foreach     : 1     
+  Complexity   Param 2       Return 1      Cyclo Vg 2       Total        5
+  LOC 16       eLOC 14       lLOC 11       Comment 6        Lines       19
+  ------------------------- Function End Line: 82 ------------------------
+  ------------------------------------------------------------------------
+
+                          ~~ Total File Summary ~~
+
+  LOC 34       eLOC 30       lLOC 22       Comment 49       Lines       84
+  ------------------------------------------------------------------------
+
+                        ~~ File Functional Summary ~~
+
+  File Function Count....:          2
+  Total Function LOC.....:         31  Total Function Pts LOC :        0.3
+  Total Function eLOC....:         27  Total Function Pts eLOC:        0.2
+  Total Function lLOC....:         22  Total Function Pts lLOC:        0.2
+  Total Function Params .:          3  Total Function Return .:          2
+  Total Cyclo Complexity :          4  Total Function Complex.:          9
+         ------     -----     -----     ------     ------     -----       
+  Max Function LOC ......:         16  Average Function LOC ..:      15.50
+  Max Function eLOC .....:         14  Average Function eLOC .:      13.50
+  Max Function lLOC .....:         11  Average Function lLOC .:      11.00
+         ------     -----     -----     ------     ------     -----       
+  Max Function Parameters:          2  Avg Function Parameters:       1.50
+  Max Function Returns ..:          1  Avg Function Returns ..:       1.00
+  Max Interface Complex. :          3  Avg Interface Complex. :       2.50
+  Max Cyclomatic Complex.:          2  Avg Cyclomatic Complex.:       2.00
+  Max Total Complexity ..:          5  Avg Total Complexity ..:       4.50
+  ________________________________________________________________________
+  End of File: ..\qs\source\qs_u64.c
+
+
+  ------------------------------------------------------------------------
+
+                     ~~ Project Analysis For 70 Files ~~
+
+  ------------------------------------------------------------------------
+
+                         ~~ Total Project Summary ~~
+
+  LOC 3635     eLOC 3319     lLOC 1506     Comment 6653     Lines    10344
+  Average per File, metric/70 files
+  LOC 51       eLOC 47       lLOC 21       Comment 95       Lines      147
+
+  ------------------------------------------------------------------------
+
+                      ~~ Project Functional Metrics ~~
+
+  Function: QFsm_dispatch_
+  Parameters: (QFsm * const me, QEvt const * const e)
+  Complexity   Param 2       Return 1      Cyclo Vg 4       Total        7
+  LOC 51       eLOC 45       lLOC 26       Comment 28       Lines       62
+
+  Function: QFsm_ctor
+  Parameters: (QFsm * const me, QStateHandler initial)
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 9        eLOC 7        lLOC 4        Comment 4        Lines       10
+
+  Function: QFsm_init_
+  Parameters: (QFsm * const me, QEvt const * const e)
+  Complexity   Param 2       Return 1      Cyclo Vg 3       Total        6
+  LOC 19       eLOC 18       lLOC 10       Comment 14       Lines       25
+
+  Function: QHsm_dispatch_
+  Parameters: (QHsm * const me, QEvt const * const e)
+  Complexity   Param 2       Return 1      Cyclo Vg 11      Total       14
+  LOC 99       eLOC 88       lLOC 59       Comment 49       Lines      128
+
+  Function: QHsm_tran_
+  Parameters: (QHsm * const me, QStateHandler path[QEP_MAX_NEST_DEPTH_])
+  Complexity   Param 2       Return 1      Cyclo Vg 15      Total       18
+  LOC 95       eLOC 74       lLOC 48       Comment 52       Lines      119
+
+  Function: QHsm_isIn
+  Parameters: (QHsm * const me, QStateHandler const state)
+  Complexity   Param 2       Return 1      Cyclo Vg 3       Total        6
+  LOC 16       eLOC 13       lLOC 9        Comment 9        Lines       19
+
+  Function: QHsm_ctor
+  Parameters: (QHsm * const me, QStateHandler initial)
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 9        eLOC 7        lLOC 4        Comment 3        Lines       10
+
+  Function: QHsm_init_
+  Parameters: (QHsm * const me, QEvt const * const e)
+  Complexity   Param 2       Return 1      Cyclo Vg 6       Total        9
+  LOC 38       eLOC 36       lLOC 25       Comment 19       Lines       49
+
+  Function: QHsm_top
+  Parameters: (void const * const me, QEvt const * const e)
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 5        eLOC 4        lLOC 3        Comment 4        Lines        5
+
+  Function: QMsm_dispatch_
+  Parameters: (QMsm * const me, QEvt const * const e)
+  Complexity   Param 2       Return 1      Cyclo Vg 9       Total       12
+  LOC 71       eLOC 59       lLOC 34       Comment 38       Lines       86
+
+  Function: QMsm_tran_
+  Parameters: (QHsm * const me)
+  Complexity   Param 1       Return 1      Cyclo Vg 7       Total        9
+  LOC 52       eLOC 43       lLOC 18       Comment 14       Lines       57
+
+  Function: QMsm_ctor
+  Parameters: (QMsm * const me, QStateHandler initial)
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 9        eLOC 7        lLOC 4        Comment 2        Lines        9
+
+  Function: QMsm_init_
+  Parameters: (QMsm * const me, QEvt const * const e)
+  Complexity   Param 2       Return 1      Cyclo Vg 7       Total       10
+  LOC 42       eLOC 38       lLOC 18       Comment 17       Lines       48
+
+  Function: QActive_ctor
+  Parameters: (QActive * const me, QStateHandler initial)
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 11       eLOC 9        lLOC 3        Comment 3        Lines       11
+
+  Function: QActive_defer
+  Parameters: (QActive * const me, QEQueue * const eq, QEvt const * const 
+              e)
+  Complexity   Param 3       Return 1      Cyclo Vg 1       Total        5
+  LOC 4        eLOC 2        lLOC 2        Comment 2        Lines        4
+
+  Function: QActive_recall
+  Parameters: (QActive * const me, QEQueue * const eq)
+  Complexity   Param 2       Return 1      Cyclo Vg 3       Total        6
+  LOC 19       eLOC 15       lLOC 10       Comment 14       Lines       33
+
+  Function: QActive_post_
+  Parameters: (QActive * const me, QEvt const * const e, uint_t const marg
+              in)
+  Complexity   Param 3       Return 1      Cyclo Vg 6       Total       10
+  LOC 55       eLOC 46       lLOC 34       Comment 36       Lines       65
+
+  Function: QActive_get_
+  Parameters: (QActive * const me)
+  Complexity   Param 1       Return 1      Cyclo Vg 3       Total        5
+  LOC 37       eLOC 33       lLOC 24       Comment 20       Lines       46
+
+  Function: QF_getQueueMin
+  Parameters: (uint8_t const prio)
+  Complexity   Param 1       Return 1      Cyclo Vg 2       Total        4
+  LOC 10       eLOC 9        lLOC 6        Comment 1        Lines       13
+
+  Function: QActive_postLIFO_
+  Parameters: (QActive * const me, QEvt const * const e)
+  Complexity   Param 2       Return 1      Cyclo Vg 5       Total        8
+  LOC 37       eLOC 31       lLOC 22       Comment 23       Lines       45
+
+  Function: QActive_subscribe
+  Parameters: (QActive const * const me, enum_t const sig)
+  Complexity   Param 2       Return 1      Cyclo Vg 5       Total        8
+  LOC 17       eLOC 16       lLOC 9        Comment 5        Lines       21
+
+  Function: QActive_unsubscribe
+  Parameters: (QActive const * const me, enum_t const sig)
+  Complexity   Param 2       Return 1      Cyclo Vg 5       Total        8
+  LOC 17       eLOC 16       lLOC 9        Comment 5        Lines       21
+
+  Function: QActive_unsubscribeAll
+  Parameters: (QActive const * const me)
+  Complexity   Param 1       Return 1      Cyclo Vg 5       Total        7
+  LOC 25       eLOC 21       lLOC 12       Comment 5        Lines       29
+
+  Function: QEQueue_post
+  Parameters: (QEQueue * const me, QEvt const * const e, uint_t const marg
+              in)
+  Complexity   Param 3       Return 1      Cyclo Vg 6       Total       10
+  LOC 51       eLOC 42       lLOC 30       Comment 31       Lines       62
+
+  Function: QEQueue_get
+  Parameters: (QEQueue * const me)
+  Complexity   Param 1       Return 1      Cyclo Vg 4       Total        6
+  LOC 36       eLOC 31       lLOC 21       Comment 20       Lines       43
+
+  Function: QEQueue_init
+  Parameters: (QEQueue * const me, QEvt const *qSto[], uint_t const qLen)
+  Complexity   Param 3       Return 1      Cyclo Vg 1       Total        5
+  LOC 14       eLOC 12       lLOC 9        Comment 6        Lines       16
+
+  Function: QEQueue_postLIFO
+  Parameters: (QEQueue * const me, QEvt const * const e)
+  Complexity   Param 2       Return 1      Cyclo Vg 5       Total        8
+  LOC 34       eLOC 29       lLOC 21       Comment 22       Lines       41
+
+  Function: QF_add_
+  Parameters: (QActive * const a)
+  Complexity   Param 1       Return 1      Cyclo Vg 3       Total        5
+  LOC 14       eLOC 13       lLOC 8        Comment 5        Lines       19
+
+  Function: QF_remove_
+  Parameters: (QActive const * const a)
+  Complexity   Param 1       Return 1      Cyclo Vg 3       Total        5
+  LOC 14       eLOC 13       lLOC 8        Comment 5        Lines       19
+
+  Function: QF_bzero
+  Parameters: (void * const start, uint_t len)
+  Complexity   Param 2       Return 1      Cyclo Vg 2       Total        5
+  LOC 8        eLOC 6        lLOC 4        Comment 1        Lines        8
+
+  Function: QF_gc
+  Parameters: (QEvt const * const e)
+  Complexity   Param 1       Return 1      Cyclo Vg 3       Total        5
+  LOC 26       eLOC 22       lLOC 13       Comment 14       Lines       35
+
+  Function: QEvt_ctor
+  Parameters: (QEvt * const me, enum_t const sig)
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 5        eLOC 4        lLOC 3        Comment 2        Lines        5
+
+  Function: QF_newX_
+  Parameters: (uint_t const evtSize, uint_t const margin, enum_t const sig
+              )
+  Complexity   Param 3       Return 1      Cyclo Vg 4       Total        8
+  LOC 26       eLOC 20       lLOC 14       Comment 14       Lines       31
+
+  Function: QF_poolInit
+  Parameters: (void * const poolSto, uint_t const poolSize, uint_t const e
+              vtSize)
+  Complexity   Param 3       Return 1      Cyclo Vg 2       Total        6
+  LOC 9        eLOC 7        lLOC 4        Comment 5        Lines       12
+
+  Function: QF_psInit
+  Parameters: (QSubscrList * const subscrSto, enum_t const maxSignal)
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 6        eLOC 5        lLOC 3        Comment 2        Lines        7
+
+  Function: QF_publish_
+  Parameters: (QEvt const * const e)
+  Complexity   Param 1       Return 1      Cyclo Vg 5       Total        7
+  LOC 43       eLOC 34       lLOC 24       Comment 17       Lines       54
+
+  Function: QF_tickX_
+  Parameters: (uint8_t const tickRate)
+  Complexity   Param 1       Return 1      Cyclo Vg 7       Total        9
+  LOC 65       eLOC 53       lLOC 36       Comment 37       Lines       76
+
+  Function: QF_noTimeEvtsActiveX
+  Parameters: (uint8_t const tickRate)
+  Complexity   Param 1       Return 1      Cyclo Vg 3       Total        5
+  LOC 14       eLOC 10       lLOC 6        Comment 3        Lines       16
+
+  Function: QMActive_ctor
+  Parameters: (QMActive * const me, QStateHandler initial)
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 11       eLOC 9        lLOC 3        Comment 4        Lines       12
+
+  Function: QMPool_get
+  Parameters: (QMPool * const me, uint_t const margin)
+  Complexity   Param 2       Return 1      Cyclo Vg 3       Total        6
+  LOC 32       eLOC 28       lLOC 18       Comment 18       Lines       37
+
+  Function: QF_getPoolMin
+  Parameters: (uint_t const poolId)
+  Complexity   Param 1       Return 1      Cyclo Vg 2       Total        4
+  LOC 9        eLOC 8        lLOC 6        Comment 1        Lines       12
+
+  Function: QMPool_init
+  Parameters: (QMPool * const me, void * const poolSto, uint_t poolSize, u
+              int_t blockSize)
+  Complexity   Param 4       Return 1      Cyclo Vg 5       Total       10
+  LOC 36       eLOC 32       lLOC 24       Comment 25       Lines       50
+
+  Function: QMPool_put
+  Parameters: (QMPool * const me, void *b)
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 15       eLOC 14       lLOC 10       Comment 9        Lines       19
+
+  Function: QTimeEvt_armX
+  Parameters: (QTimeEvt * const me, QTimeEvtCtr const nTicks, QTimeEvtCtr 
+              const interval)
+  Complexity   Param 3       Return 1      Cyclo Vg 6       Total       10
+  LOC 27       eLOC 24       lLOC 16       Comment 15       Lines       32
+
+  Function: QTimeEvt_ctorX
+  Parameters: (QTimeEvt * const me, QActive * const act, enum_t const sig,
+               uint8_t tickRate)
+  Complexity   Param 4       Return 1      Cyclo Vg 2       Total        7
+  LOC 11       eLOC 9        lLOC 8        Comment 7        Lines       13
+
+  Function: QTimeEvt_ctr
+  Parameters: (QTimeEvt const * const me)
+  Complexity   Param 1       Return 1      Cyclo Vg 1       Total        3
+  LOC 16       eLOC 15       lLOC 11       Comment 7        Lines       19
+
+  Function: QTimeEvt_disarm
+  Parameters: (QTimeEvt * const me)
+  Complexity   Param 1       Return 1      Cyclo Vg 2       Total        4
+  LOC 29       eLOC 26       lLOC 17       Comment 15       Lines       33
+
+  Function: QTimeEvt_rearm
+  Parameters: (QTimeEvt * const me, QTimeEvtCtr const nTicks)
+  Complexity   Param 2       Return 1      Cyclo Vg 6       Total        9
+  LOC 32       eLOC 28       lLOC 18       Comment 17       Lines       37
+
+  Function: QF_init
+  Parameters: (void)
+  Complexity   Param 0       Return 1      Cyclo Vg 1       Total        2
+  LOC 6        eLOC 5        lLOC 4        Comment 2        Lines        6
+
+  Function: QF_stop
+  Parameters: (void)
+  Complexity   Param 0       Return 1      Cyclo Vg 1       Total        2
+  LOC 3        eLOC 2        lLOC 1        Comment 3        Lines        4
+
+  Function: QF_init
+  Parameters: (void)
+  Complexity   Param 0       Return 1      Cyclo Vg 1       Total        2
+  LOC 14       eLOC 13       lLOC 10       Comment 5        Lines       16
+
+  Function: QF_stop
+  Parameters: (void)
+  Complexity   Param 0       Return 1      Cyclo Vg 1       Total        2
+  LOC 3        eLOC 2        lLOC 1        Comment 3        Lines        4
+
+  Function: initialize
+  Parameters: (void)
+  Complexity   Param 0       Return 1      Cyclo Vg 2       Total        3
+  LOC 8        eLOC 6        lLOC 4        Comment 3        Lines        9
+
+  Function: QF_run
+  Parameters: (void)
+  Complexity   Param 0       Return 1      Cyclo Vg 2       Total        3
+  LOC 12       eLOC 10       lLOC 7        Comment 5        Lines       14
+
+  Function: QActive_start_
+  Parameters: (QActive *me, uint_t prio, QEvt const *qSto[], uint_t qLen, 
+              void *stkSto, uint_t stkSize, QEvt const *ie)
+  Complexity   Param 7       Return 1      Cyclo Vg 4       Total       12
+  LOC 14       eLOC 12       lLOC 9        Comment 7        Lines       18
+
+  Function: QActive_stop
+  Parameters: (QActive *me)
+  Complexity   Param 1       Return 1      Cyclo Vg 1       Total        3
+  LOC 3        eLOC 2        lLOC 1        Comment 2        Lines        3
+
+  Function: QK_schedExt_
+  Parameters: (uint8_t p)
+  Complexity   Param 1       Return 1      Cyclo Vg 8       Total       10
+  LOC 61       eLOC 54       lLOC 27       Comment 32       Lines       72
+
+  Function: QK_mutexLock
+  Parameters: (uint8_t prioCeiling)
+  Complexity   Param 1       Return 1      Cyclo Vg 2       Total        4
+  LOC 16       eLOC 14       lLOC 9        Comment 6        Lines       18
+
+  Function: QK_mutexUnlock
+  Parameters: (QMutex mutex)
+  Complexity   Param 1       Return 1      Cyclo Vg 3       Total        5
+  LOC 17       eLOC 14       lLOC 8        Comment 6        Lines       19
+
+  Function: QK_schedPrio_
+  Parameters: (void)
+  Complexity   Param 0       Return 1      Cyclo Vg 3       Total        4
+  LOC 19       eLOC 15       lLOC 6        Comment 7        Lines       22
+
+  Function: QK_sched_
+  Parameters: (uint8_t p)
+  Complexity   Param 1       Return 1      Cyclo Vg 6       Total        8
+  LOC 50       eLOC 44       lLOC 24       Comment 26       Lines       60
+
+  Function: QS_initBuf
+  Parameters: (uint8_t sto[], uint_t stoSize)
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 11       eLOC 10       lLOC 9        Comment 3        Lines       14
+
+  Function: QS_filterOn
+  Parameters: (uint8_t rec)
+  Complexity   Param 1       Return 1      Cyclo Vg 3       Total        5
+  LOC 17       eLOC 12       lLOC 6        Comment 3        Lines       18
+
+  Function: QS_filterOff
+  Parameters: (uint8_t rec)
+  Complexity   Param 1       Return 1      Cyclo Vg 2       Total        4
+  LOC 27       eLOC 24       lLOC 35       Comment 6        Lines       35
+
+  Function: QS_beginRec
+  Parameters: (uint8_t rec)
+  Complexity   Param 1       Return 1      Cyclo Vg 1       Total        3
+  LOC 14       eLOC 13       lLOC 10       Comment 11       Lines       18
+
+  Function: QS_endRec
+  Parameters: (void)
+  Complexity   Param 0       Return 1      Cyclo Vg 4       Total        5
+  LOC 21       eLOC 17       lLOC 9        Comment 9        Lines       25
+
+  Function: QS_u8
+  Parameters: (uint8_t format, uint8_t d)
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 11       eLOC 10       lLOC 7        Comment 8        Lines       14
+
+  Function: QS_u16
+  Parameters: (uint8_t format, uint16_t d)
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 15       eLOC 14       lLOC 10       Comment 8        Lines       20
+
+  Function: QS_u32
+  Parameters: (uint8_t format, uint32_t d)
+  Complexity   Param 2       Return 1      Cyclo Vg 2       Total        5
+  LOC 16       eLOC 14       lLOC 11       Comment 10       Lines       19
+
+  Function: QS_u8_
+  Parameters: (uint8_t d)
+  Complexity   Param 1       Return 1      Cyclo Vg 1       Total        3
+  LOC 10       eLOC 9        lLOC 7        Comment 8        Lines       12
+
+  Function: QS_u8u8_
+  Parameters: (uint8_t d1, uint8_t d2)
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 11       eLOC 10       lLOC 7        Comment 8        Lines       13
+
+  Function: QS_u16_
+  Parameters: (uint16_t d)
+  Complexity   Param 1       Return 1      Cyclo Vg 1       Total        3
+  LOC 14       eLOC 13       lLOC 10       Comment 8        Lines       18
+
+  Function: QS_u32_
+  Parameters: (uint32_t d)
+  Complexity   Param 1       Return 1      Cyclo Vg 2       Total        4
+  LOC 15       eLOC 13       lLOC 11       Comment 8        Lines       17
+
+  Function: QS_str_
+  Parameters: (char_t const *s)
+  Complexity   Param 1       Return 1      Cyclo Vg 2       Total        4
+  LOC 20       eLOC 18       lLOC 14       Comment 12       Lines       22
+
+  Function: QS_str_ROM_
+  Parameters: (char_t const Q_ROM *s)
+  Complexity   Param 1       Return 1      Cyclo Vg 2       Total        4
+  LOC 20       eLOC 18       lLOC 14       Comment 12       Lines       22
+
+  Function: QS_getBlock
+  Parameters: (uint16_t *pNbytes)
+  Complexity   Param 1       Return 1      Cyclo Vg 5       Total        7
+  LOC 29       eLOC 23       lLOC 17       Comment 9        Lines       30
+
+  Function: QS_getByte
+  Parameters: (void)
+  Complexity   Param 0       Return 1      Cyclo Vg 3       Total        4
+  LOC 18       eLOC 14       lLOC 10       Comment 10       Lines       18
+
+  Function: QS_sig_dict
+  Parameters: (enum_t const sig, void const * const obj, char_t const Q_RO
+              M * const name)
+  Complexity   Param 3       Return 1      Cyclo Vg 1       Total        5
+  LOC 11       eLOC 9        lLOC 8        Comment 1        Lines       11
+
+  Function: QS_obj_dict
+  Parameters: (void const * const obj, char_t const Q_ROM * const name)
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 10       eLOC 8        lLOC 7        Comment 1        Lines       10
+
+  Function: QS_fun_dict
+  Parameters: (void (* const fun)(void), char_t const Q_ROM * const name)
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 10       eLOC 8        lLOC 7        Comment 1        Lines       10
+
+  Function: QS_usr_dict
+  Parameters: (enum_t const rec, char_t const Q_ROM * const name)
+  Complexity   Param 2       Return 1      Cyclo Vg 1       Total        4
+  LOC 10       eLOC 8        lLOC 7        Comment 1        Lines       10
+
+  Function: QS_f32
+  Parameters: (uint8_t format, float32_t f)
+  Complexity   Param 2       Return 1      Cyclo Vg 2       Total        5
+  LOC 21       eLOC 19       lLOC 15       Comment 12       Lines       25
+
+  Function: QS_f64
+  Parameters: (uint8_t format, float64_t d)
+  Complexity   Param 2       Return 1      Cyclo Vg 3       Total        6
+  LOC 29       eLOC 26       lLOC 20       Comment 9        Lines       33
+
+  Function: QS_mem
+  Parameters: (uint8_t const *blk, uint8_t size)
+  Complexity   Param 2       Return 1      Cyclo Vg 2       Total        5
+  LOC 18       eLOC 16       lLOC 11       Comment 7        Lines       21
+
+  Function: QS_str
+  Parameters: (char_t const *s)
+  Complexity   Param 1       Return 1      Cyclo Vg 2       Total        4
+  LOC 21       eLOC 19       lLOC 14       Comment 12       Lines       24
+
+  Function: QS_str_ROM
+  Parameters: (char_t const Q_ROM *s)
+  Complexity   Param 1       Return 1      Cyclo Vg 2       Total        4
+  LOC 21       eLOC 19       lLOC 14       Comment 12       Lines       25
+
+  Function: QS_u64_
+  Parameters: (uint64_t d)
+  Complexity   Param 1       Return 1      Cyclo Vg 2       Total        4
+  LOC 15       eLOC 13       lLOC 11       Comment 4        Lines       17
+
+  Function: QS_u64
+  Parameters: (uint8_t format, uint64_t d)
+  Complexity   Param 2       Return 1      Cyclo Vg 2       Total        5
+  LOC 16       eLOC 14       lLOC 11       Comment 6        Lines       19
+
+  Total: Functions  
+  LOC 2007     eLOC 1715     lLOC 1151     InCmp 232      CycloCmp     270
+  Function Points         FP(LOC) 15.7    FP(eLOC) 13.4   FP(lLOC)     9.0
+
+  ------------------------------------------------------------------------
+
+                      ~~ Project Functional Analysis ~~
+
+  Total Functions .......:         88  Total Physical Lines ..:       2408
+  Total LOC .............:       2007  Total Function Pts LOC :       15.7
+  Total eLOC ............:       1715  Total Function Pts eLOC:       13.4
+  Total lLOC.............:       1151  Total Function Pts lLOC:        9.0
+  Total Cyclomatic Comp. :        270  Total Interface Comp. .:        232
+  Total Parameters ......:        144  Total Return Points ...:         88
+  Total Comment Lines ...:        975  Total Blank Lines .....:        321
+         ------     -----     -----     ------     ------     -----       
+  Avg Physical Lines ....:      27.36
+  Avg LOC ...............:      22.81  Avg eLOC ..............:      19.49
+  Avg lLOC ..............:      13.08  Avg Cyclomatic Comp. ..:       3.07
+  Avg Interface Comp. ...:       2.64  Avg Parameters ........:       1.64
+  Avg Return Points .....:       1.00  Avg Comment Lines .....:      11.08
+         ------     -----     -----     ------     ------     -----       
+  Max LOC ...............:         99
+  Max eLOC ..............:         88  Max lLOC ..............:         59
+  Max Cyclomatic Comp. ..:         15  Max Interface Comp. ...:          8
+  Max Parameters ........:          7  Max Return Points .....:          1
+  Max Comment Lines .....:         52  Max Total Lines .......:        128
+         ------     -----     -----     ------     ------     -----       
+  Min LOC ...............:          3
+  Min eLOC ..............:          2  Min lLOC ..............:          1
+  Min Cyclomatic Comp. ..:          1  Min Interface Comp. ...:          1
+  Min Parameters ........:          0  Min Return Points .....:          1
+  Min Comment Lines .....:          1  Min Total Lines .......:          3
+
+  ------------------------------------------------------------------------
+
+                        ~~ Project Quality Profile ~~
+
+  Type  Count Percent  Quality Notice
+  ________________________________________________________________________
+
+  3         2    8.70  Ellipsis '...' are identified as function parameters
+  23        1    4.35  '?' ternary operator identified
+  28        2    8.70  Cyclomatic complexity > 10
+  29        1    4.35  Number of function parameters > 6
+  44        3   13.04  Keyword 'break' identified outside a 'switch' structure
+  55       11   47.83  Scope level exceeds the defined limit of 6
+  107       3   13.04  A double ;; has been identified
+  ________________________________________________________________________
+
+           23  100.00  Total Quality Notices
+
+                        ~~ Quality Notice Density ~~
+
+  Basis: 1000 (K)
+
+  Quality Notices/K LOC   =        6.3 (  0.63%)
+  Quality Notices/K eLOC  =        6.9 (  0.69%)
+  Quality Notices/K lLOC  =       15.3 (  1.53%)
+
+  ------------------------------------------------------------------------
+
+                             ~~ File Summary ~~
+
+  C Source Files *.c ....:         54  C/C++ Include Files *.h:         16
+  C++ Source Files *.c* .:          0  C++ Include Files *.h* :          0
+  C# Source Files *.cs ..:          0  Java Source File *.jav*:          0
+  Other File Count ......:          0  Total File Count ......:         70
+  ________________________________________________________________________
+

+ 82 - 0
doxygen/qpc_rev.txt

@@ -1,6 +1,88 @@
 /**
 \page rev_page Revision History
 
+\section qpc_5_2_0 Version 5.2.0, Release date: Dec 26, 2013
+
+This release matches the new QM 3.0.0, for which it provides model
+examples based on the new QMsm/QMActive classes. This, in turn
+demonstrates the new state machine code generation that QM3 was
+specifically designed to do.
+
+This release also provides consistent API for late-binding ("virtual"
+functions) introduced in QP 5.0.0, as opposed to using regular linking
+(early-binding) for direct function calls, such as QHsm_dispatch(). A
+clearly separated API compatibility layer is provided, whereas you can
+configure a level of backwards compatibility by means of the
+#QP_API_VERSION macro. This facilitates migrating existing QP
+applications to the newer API.
+
+An cyclomatic complexity (McCabe V(G)) analysis of this version has been
+performed and the maximum V(G) complexity per function has been reduced
+to 15 by breaking up the QHsm_dispatch_() function. The code metrics
+report, including cyclomatic complexity by function as well as other
+standard code metrics (e.g., lines of code), is now included in the
+"QP/C Reference Manual", see
+http://www.state-machine.com/qp/qpc/metrics.html
+
+Finally, this release demonstrates safer stack allocation and safer
+exception handlers in all ARM Cortex-M examples. The techniques are
+described in the Embedded.com article "Are We Shooting Ourselves in the
+Foot with Stack Overflow?".
+
+Changes in detail:
+
+1. In file qep.h renamed the implementation functions, such as
+QHsm_init() and QHsm_dispatch() to QHsm_init_() and QHsm_dispatch_()
+(note the underscore, which means that the functions should not be
+called directly by the application code). The only correct way of
+calling the functions is through the macros QMSM_INIT() and
+QMSM_DISPATCH(), respectively. The latter macros implement late-binding
+("virtual" functions in C).
+
+2. In file qf.h renamed the implementation functions, such as
+QActive_start(), QActive_post() and QActive_postLIFO() to
+QActive_start_(), QActive_post_(), and QActive_postLIFO_, respectively
+(note the underscore, which means that the functions should not be
+called directly by the application code). The only correct way of
+calling the functions is through the macros QACTIVE_START(),
+QACTIVE_POST(), and QACTIVE_POST_LIFO(), respectively. The latter macros
+implement late-binding ("virtual" functions in C).
+
+3. for backwards compatibility, in file qp_port.h defined "API
+Compatibility Layer", which is controlled by the macro #QP_API_VERSION.
+For example, specifying QP_API_VERSION=500 chooses API compatible with
+QP version 5.0.0 or newer, but excludes APIs that became deprecated in
+the earlier versions. If the macro #QP_API_VERSION is not defined by the
+user (typically on the command line for the compiler), the default value
+of 0 is assumed. This default means maximum backwards compatibility
+(from version 0.0.0). On the other hand, higher values of
+#QP_API_VERSION mean less backwards compatibility. For example
+QP_API_VERSION=9999 will specify compatibility only with the latest
+version of QP.
+
+The API Compatibility Layer for QP_API_VERSION < 500 provides macros:
+QHsm_init(), QHsm_dispatch(), QActive_start(), QActive_post() and
+QActive_postLIFO(). These macros resolve to QMSM_INIT() and
+QMSM_DISPATCH(), QACTIVE_START(), QACTIVE_POST() and QACTIVE_POST_LIFO()
+respectively, so that calls based on the older API also use late-binging.
+
+4. In file qhsm_dis.c, broken up the function QHsm_dispatch() into two
+functions QHsm_dispatch_() and QHsm_tran_(). This has reduced the
+cyclomatic complexity from 25 for the original function, to 11 and 15
+for QHsm_dispatch_() and QHsm_tran_(), respectively.
+
+5. In file qmsm_dis.c, broken up the function QMsm_dispatch() into two
+functions QMsm_dispatch_() and QMsm_tran_(). This has reduced the
+cyclomatic complexity from 15 for the original function, to 9 and 7 for
+QMsm_dispatch_() and QMsm_tran_(), respectively.
+
+6. Updated all examples for ARM Cortex-M to use safer stack allocation
+and safer exception handlers in all ARM Cortex-M examples, as described
+in the Embedded.com article "Are We Shooting Ourselves in the Foot with
+Stack Overflow?".
+
+
+<HR>
 \section qpc_5_1_1 Version 5.1.1, Release date: Oct 10, 2013
 
 This release fixes reversal of logic in the QF_noTimeEvtsActiveX()

+ 45 - 0
doxygen/rsm.bat

@@ -0,0 +1,45 @@
+@echo off
+::  ==========================================================================
+::  Product: QP/C script for running MSquared Resource Standard Metrics (RSM)
+::  Last Updated for Version: 5.2.0
+::  Date of the Last Update:  Dec 20, 2013
+::
+::                    Q u a n t u m     L e a P s
+::                    ---------------------------
+::                    innovating embedded systems
+::
+:: Copyright (C) 2002-2013 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 3 of the License, or
+:: (at your option) any later version.
+::
+:: 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.
+::
+:: 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 sites: http://www.quantum-leaps.com
+::                          http://www.state-machine.com
+:: e-mail:                  info@quantum-leaps.com
+::  ==========================================================================
+setlocal
+
+set RCMHOME="C:\tools\MSquared\M2 RSM"
+
+set RSM_OUTPUT=qpc_metrics.txt
+set RSM_INPUT=..\include\*.h ..\qep\source\*.h ..\qep\source\*.c ..\qf\source\*.h ..\qf\source\*.c ..\qk\source\*.h ..\qk\source\*.c ..\qs\source\*.h ..\qs\source\*.c
+
+%RCMHOME%\rsm.exe -fd -n -xNOCOMMAND -xNOCONFIG -u"File cfg rsm_qpc.cfg" %RSM_INPUT% > %RSM_OUTPUT%
+
+endlocal

+ 637 - 0
doxygen/rsm_qpc.cfg

@@ -0,0 +1,637 @@
+# ==========================================================================
+# Product: Configuration file for MSquared Resource Standard Metrics (RSM)
+# Last Updated for Version: 5.2.0
+# Date of the Last Update:  Dec 20, 2013
+#
+#                    Q u a n t u m     L e a P s
+#                    ---------------------------
+#                    innovating embedded systems
+#
+# Copyright (C) 2002-2013 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 3 of the License, or
+# (at your option) any later version.
+#
+# 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.
+#
+# 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 sites: http://www.quantum-leaps.com
+#                          http://www.state-machine.com
+# e-mail:                  info@quantum-leaps.com
+# ==========================================================================
+
+####################################################################
+# RSM Operational Configuration ####################################
+
+# Company Specific Header
+# This line will appear at the top of all reports
+# Typical uses include copyrights, security and project markings
+# You must specify both a text version for text and csv reports
+# and an HTML version.
+Report Header Active                    : No
+Report Header Text Line                 : Standard Metrics Report
+Report Header HTML Line                 : <font color="RED" size="+2"><B><I>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Standard Metrics Report</I></B></font>
+
+# Enable user defined configuration files.
+# The file rsm.cfg is read from the location of the rsm.lic file.
+# This file can enable this option to allow users to override the
+# operational configuration of RSM.  This option is enabled by the
+# end user with the -u "File cfg path\file" option
+Enable user defined configuration files : Yes
+
+# Windows 9x and DOS are case insensitive file systems.
+# Files like foo.c and foo.C are seen as C source files.
+# If *.C files are C++ files under these operating systems
+# or you are operating on NT or UNIX set this option to
+# case sensitivity equal to Yes.
+Source file names are case sensitive    : No
+
+# Show a progress indicator when processing files and
+# code differentials.
+Show progress indicator                 : Yes
+Detailed Progress Showing File Names    : Yes
+
+# Number of files which comprise a status marker when
+# status is indicated during lengthy operations.
+Progress status interval number of files: 10
+
+# Show file dates when displaying file metrics.
+Show file date and size                 : No
+
+# RSM will process only files with the following extensions.
+# The user may add to this list, but RSM is designed to process
+# only the C, C++, C# and Java languages.
+Validate file extensions for processing : Yes
+
+# Specify the extensions for each type of supported language.
+# Files extensions are separated by commas and are case sensitive
+# if case sensitivity is specified in this file (comma separated,no spaces).
+C File Extensions                       : c
+C Header File Extensions                : h
+C++ File Extensions                     : cc,cpp,cxx,h,hh,H,hxx
+C++ Header File Extensions              : h,hh,H,hxx
+C# File Extensions                      : cs
+Java File Extensions                    : java
+# Other files are not officially supported by RSM
+# but lines will be counted as LOC
+Other File Extensions                   : 
+
+# When analyzing *.h files, treat header files as
+# both C and C++.  If you use separate extensions for C++ and
+# C header files, then set this option to No.
+Treat C headers as C++                  : Yes
+
+# RSM will not process files when the path/file name contains
+# a pattern in the pattern list (comma separated,no spaces).
+Pattern Filter Active                   : No
+Pattern Filter                          : .designer.c
+
+# RSM Code skip strings allow the RSM parser to skip
+# processing of all code between the start and stop
+# tokens.  This is useful for machine generated code.
+# Code tokens are unique in the could base and if
+# found on a code line the rsm processing will be effected.
+# Start and stop tokens must match within a file and
+# cannot span files.  A token cannot contain spaces and
+# must be alphnumeric and can contain the underscore.
+# Quality skip tokens turn off just quality notice checking.
+# i.e.  // RSM_IGNORE_BEGIN
+#       some code ....
+#       // RSM_IGNORE_END
+RSM Code Skip Start Token               : RSM_IGNORE_BEGIN
+RSM Code Skip End Token                 : RSM_IGNORE_END
+RSM Code Quality Skip Start Token       : RSM_IGNORE_QUALITY_BEGIN
+RSM Code Quality Skip End Token         : RSM_IGNORE_QUALITY_END
+Activate RSM code skip tokens           : Yes
+
+# RSM will not process files in local directories when this
+# flag is set.  This will prevent recursive descent into
+# these directories (comma separated,no spaces).
+Do not process these local directories  : No
+Local directory names not processed     : test,sccs,cvs,rcs,svn
+
+# Names in reports include file, namespace or package, class
+# and function names.  These names can get quite long and will
+# extend beyond the report right margin.  This setting will
+# wrap the name to the report right margin.
+Wrap long names in reports              : Yes
+
+####################################################################
+# RSM Configuration for Baseline Metrics Differentials #############
+
+# The following path location specifies where work files
+# are to be created.  The path must be a location with write
+# permissions.  RSM will create work files in the current
+# directory if no path is specified.
+Work file location path                 : 
+
+# When processing code line differentials, ignore
+# blank line changes in the code.
+Ignore code differential blank lines    : Yes
+
+# When processing code line differentials, ignore
+# blanks and tab changes in the code.
+Ignore code differential white space    : Yes
+
+# Maximum number of lines in a file when using Longest Common Sequence
+# differential algorithm.  This value establishes the line to line
+# comparison matrix size.  This value has been set to the maximum allowed
+# under 32 bit operating systems.  It is not advised to make this value >
+# than 10000.  If you have a machine with very low physical memory you may
+# want to use a value of 6000 to 7000 where 10000 should be a maximum.
+# When file lengths exceed the matrix limits, the file is segmented to fit
+# the matrix size.
+Maximum LCS file size, number of lines  : 10000
+
+# Code differential metrics determine lines that are
+# different in the current baseline compared to the
+# older baseline.  This metric can include
+# lines that are removed from the current baseline.
+Add removed older lines as modified     : No
+
+# When showing differential details for each file
+# using the switch -ws
+Show equal lines                        : Yes
+Show lines removed from older file      : Yes
+Show lines added (mod) to newer file    : Yes
+
+# The following parameter, when set to Yes will cause
+# the files stored into work files to be relative to the
+# location specified by the -w"create top_dir", baseline
+# top directory.
+Relative Work Files                     : Yes
+
+# User defined productivity values for determining works
+# rates for baseline metric differentials.
+Work Seconds per Hour                   : 3600
+Work Hours per Shift                    : 8
+Work Shifts per Day                     : 1
+Work Days per Week                      : 5
+Work Hours per Man Day                  : 8
+Work Hours per Man Week                 : 40
+Work Hours per Man Month                : 160
+Work Hours per Man Year                 : 1960
+
+#####################################################################
+# Function point conversion factors for LOC metrics
+#
+Header File Function Points per LOC     : 0
+Header File Function Points per eLOC    : 0
+Header File Function Points per lLOC    : 0
+C File Function Points per LOC          : 128
+C File Function Points per eLOC         : 128
+C File Function Points per lLOC         : 128
+C++ File Function Points per LOC        : 53
+C++ File Function Points per eLOC       : 53
+C++ File Function Points per lLOC       : 53
+Java File Function Points per LOC       : 53
+Java File Function Points per eLOC      : 53
+Java File Function Points per lLOC      : 53
+C# File Function Points per LOC         : 53
+C# File Function Points per eLOC        : 53
+C# File Function Points per lLOC        : 53
+Other File Function Points per LOC      : 0
+Other File Function Points per eLOC     : 0
+Other File Function Points per lLOC     : 0
+
+####################################################################
+# RSM Configuration for cyclomatic complexity ######################
+#
+# McCabe Cyclomatic Complexity includes the following constructs in
+# the calculation.
+#   function call + if + inline if + while + for + foreach
+#   case + goto + logical or + Logical and
+#
+# You may tailor the cyclomatic complexity calculation to meet your
+# specific requirements.
+
+Include 'function call' in cyclomatic complexity: Yes
+Include 'while' in cyclomatic complexity        : Yes
+Include 'for' in cyclomatic complexity          : Yes
+Include 'switch' in cyclomatic complexity       : No
+Include 'case' in cyclomatic complexity         : Yes
+Include 'if' in cyclomatic complexity           : Yes
+Include 'else' in cyclomatic complexity         : No
+Include '?' inlined if in cyclomatic complexity : Yes
+Include 'goto' in cyclomatic complexity         : Yes
+Include '||' or 'or' in cyclomatic complexity   : Yes
+Include '&&' or 'and' in cyclomatic complexity  : Yes
+
+####################################################################
+# RSM Quality Notices Configuration ################################
+
+# User Defined Quality Notices UDQN
+# Specify the file name which contains the UDQN definitions
+# See this provided example for a tutorial on UDQN.
+RSM user defined quality notice file    : rsm_udqn.cfg
+
+# Re-order the quality notice format so that if a line number
+# is emitted, the line number precedes the notice number.  This
+# option enables code editors to parse the notice line.
+Reorder notice, line in quality notices : No
+
+# RSM Quality Notices For Code Style ###################################
+
+# Quality Notice No. 1
+# Emit a quality notice when the physical line length
+# is greater than the specified number of characters.
+Quality Notice 1                        : Yes
+Maximum Line Length                     : 80
+
+# Quality Notice No. 2
+# Emit a quality notice when the function name length
+# is greater than the specified number of characters.
+Quality Notice 2                        : Yes
+Maximum Function Name Length            : 32
+
+# Quality Notice No. 21
+# Emit a quality notice when a file does not contain
+# the specified key string.
+Quality Notice 21                       : No
+RSM KEY String                          : 
+
+# RSM Quality Notices For Stability and Maintainability ################
+
+# Quality Notice No. 3
+# Emit a quality notice when ellipsis '...' are identified
+# within a functions parameter list thus enabling variable
+# arguments.
+Quality Notice 3                        : Yes
+
+# Quality Notice No. 4
+# Emit a quality notice if there exists an assignment
+# operator '=' within a logical 'if' condition.
+Quality Notice 4                        : Yes
+
+# Quality Notice No. 5
+# Emit a quality notice if there exists an assignment
+# operator '=' within a logical 'while' condition.
+Quality Notice 5                        : Yes
+
+# Quality Notice No. 6
+# Emit a quality notice when a pre-decrement operator '--'
+# is identified within the code.
+Quality Notice 6                        : No
+
+# Quality Notice No. 7
+# Emit a quality notice when a pre-increment operator '++'
+# is identified within the code.
+Quality Notice 7                        : No
+
+# Quality Notice No. 8
+# Emit a quality notice when the 'realloc' function
+# is identified within the code.
+Quality Notice 8                        : Yes
+
+# Quality Notice No. 9
+# Emit a quality notice when the 'goto' function
+# is identified within the code.
+Quality Notice 9                        : Yes
+
+# Quality Notice No. 10
+# Emit a quality notice when the Non-ANSI function
+# prototype is identified within the code.
+Quality Notice 10                       : Yes
+
+# Quality Notice No. 11
+# Emit a quality notice when open and closed brackets
+# '[ ]' are not balance within a file.
+Quality Notice 11                       : Yes
+
+# Quality Notice No. 12
+# Emit a quality notice when open and closed parenthesis
+# '()' are not balance within a file.
+Quality Notice 12                       : Yes
+
+# Quality Notice No. 13
+# Emit a quality notice when a 'switch' statement does
+# not have a 'default' condition.
+Quality Notice 13                       : Yes
+
+# Quality Notice No. 14
+# Emit a quality notice when there are more 'case' conditions
+# than 'break' statements or 'fall through' comments.
+Use default in case/break comparison    : Yes
+Quality Notice 14                       : Yes
+
+# Quality Notice No. 15
+# Emit a quality notice when a friend class
+# is identified within the code.
+Quality Notice 15                       : Yes
+
+# Quality Notice No. 22
+# Emit a quality notice when each if, else, for
+# or while is not bound by scope.
+Quality Notice 22                       : Yes
+
+# Quality Notice No. 23
+# Emit a quality notice when the '?' or the implied
+# if-then-else construct has been identified.
+Quality Notice 23                       : Yes
+
+# Quality Notice No. 24
+# Emit a quality notice when an ANSI C++ keyword
+# is identified within a *.c or a *.h file.
+Quality Notice 24                       : Yes
+
+# Quality Notice No. 26
+# Emit a quality notice when a void * is identified
+# within a source file.
+Quality Notice 26                       : No
+
+# Quality Notice No. 27
+# Emit a quality notice when the number of function
+# return points is greater than the specified maximum.
+Quality Notice 27                       : Yes
+Maximum functional return points        : 1
+Count goto as a function return point   : Yes
+
+# Quality Notice No. 28
+# Emit a quality notice when the cyclomatic complexity
+# of a function exceeds the specified maximum.
+Quality Notice 28                       : Yes
+Maximum functional cyclomatic complexity: 10
+
+# Quality Notice No. 29
+# Emit a quality notice when the number of function
+# input parameters exceeds the specified maximum.
+Quality Notice 29                       : Yes
+Maximum functional interface complexity : 6
+
+# Quality Notice No. 49
+# Emit a quality notice when function parameters
+# are blank or not specified, thus requiring void.
+Quality Notice 49                       : Yes
+
+# Quality Notice No. 30
+# Emit a quality notice when a TAB character is identified
+# within the source code.  Indentation with TAB will create
+# editor and device dependent formatting.
+Quality Notice 30                       : Yes
+
+# Quality Notice No. 32
+# Emit a quality notice when 'using namespace'
+# has been identified in a C++ source file.
+Quality Notice 32                       : Yes
+
+# Quality Notice No. 33
+# Emit a quality notice when a class/struct definition
+# is identified within a function definition.
+Quality Notice 33                       : Yes
+
+# Quality Notice No. 34
+# Emit a quality notice when a class definition
+# contains a pointer to a data item.
+Quality Notice 34                       : Yes
+
+# Quality Notice No. 35
+# Emit a quality notice when a class definition
+# contains public data.
+Quality Notice 35                       : Yes
+
+# Reference Quality Notice No. 35
+# Ignore public data for specific types of data
+Ignore public event data                : Yes
+Ignore public const data                : Yes
+Ignore public delegate data             : Yes
+
+# Quality Notice No. 36
+# Emit a quality notice when a class definition
+# contains protected data.
+Quality Notice 36                       : Yes
+
+# Quality Notice No. 37
+# Emit a quality notice when a base class, with virtual
+# functions, does not contain a virtual destructor.
+Quality Notice 37                       : Yes
+
+# Quality Notice No. 38
+# Emit a quality notice when exception handling is
+# present within a function.
+Quality Notice 38                       : Yes
+
+# Quality Notice No. 39
+# Emit a quality notice when the number of class/struct methods
+# exceed the specified maximum (public, protected and private).
+Quality Notice 39                       : Yes
+Maximum number of methods per class     : 100
+
+# Quality Notice No. 40
+# Emit a quality notice when the depth of the inheritance
+# tree exceeds the specified maximum value.
+Quality Notice 40                       : Yes
+Maximum depth of inheritance tree       : 4
+
+# Quality Notice No. 41
+# Emit a quality notice when the number of direct derived
+# classes exceeds the specified maximum value.
+Quality Notice 41                       : Yes
+Maximum number of derived child classes : 10
+
+# Quality Notice No. 42
+# Emit a quality notice when the multiple inheritance
+# has been identified.
+Quality Notice 42                       : Yes
+
+# Quality Notice No. 43
+# Emit a quality notice when the keyword 'continue'
+# has been identified.
+Quality Notice 43                       : Yes
+
+# Quality Notice No. 44
+# Emit a quality notice when the keyword 'break'
+# has been identified outside a 'switch' logic
+# control structure.
+Quality Notice 44                       : Yes
+
+# Quality Notice No. 45
+# Emit a quality notice when a file does not
+# have equal counts of new and delete.
+Quality Notice 45                       : Yes
+
+# Quality Notice No. 50
+# Emit a quality notice when a variable is assigned
+# to a literal number and not a symbolic constant.
+Quality Notice 50                       : No
+Include zero (0) as literal assignment  : No
+
+# Quality Notice No. 55
+# Emit a quality notice when the depth of scope
+# exceeds the specified maximum value.  This condition
+# indicates complex logic and/or a maintenance concern.
+Quality Notice 55                       : Yes
+Maximum depth of scope                  : 6
+
+# Quality Notice No. 56
+# Emit a quality notice when sequential breaks are
+# identified without a respective case statement.
+Quality Notice 56                       : Yes
+
+# RSM Quality Notices for Functional/Struct and Class Content ##########
+
+# Minimum LOC for content analysis for blank lines
+# comments, and white space.
+Min. Function LOC for content analysis  : 5
+Min. Class/Struct LOC content analysis  : 10
+
+# Quality Notice No. 16
+# Emit a quality notice when function, struct, class
+# or interface white space percentage is less than
+# the specified minimum.
+Quality Notice 16                       : Yes
+Minimum Function Whitespace Percent     : 10.00 
+
+# Quality Notice No. 17
+# Emit a quality notice when function comment line
+# percentage is less than the specified minimum.
+Quality Notice 17                       : No
+Minimum Function Comment Line Percent   : 10.00 
+
+# Quality Notice No. 18
+# Emit a quality notice when the eLOC within a
+# function exceeds the specified maximum.
+Quality Notice 18                       : Yes
+Maximum Function eLOC                   : 200
+
+# Quality Notice No. 48
+# Emit a quality notice when the lLOC within a
+# function does not meet the specified minimum.
+# This notice serves to find nop functions.
+Quality Notice 48                       : Yes
+Minimum Function lLOC                   : 0
+
+# Quality Notice No. 31
+# Emit a quality notice when class/struct comment line
+# percentage is less than the specified minimum.
+Quality Notice 31                       : Yes
+Minimum Class/Struct Comment Percent    : 10.00 
+
+# Quality Notice No. 46
+# Emit a quality notice when function, struct, class
+# or interface blank line percentage is less than the
+# specified minimum.
+Quality Notice 46                       : No
+Minimum Function Blank Line Percent     : 10.00 
+
+# Quality Notice No. 51
+# Emit a quality notice when a function
+# does not have a preceding comment.
+Quality Notice 51                       : Yes
+
+# Quality Notice No. 52
+# Emit a quality notice when a class
+# does not have a preceding comment.
+Quality Notice 52                       : Yes
+
+# Quality Notice No. 53
+# Emit a quality notice when a struct
+# does not have a preceding comment.
+Quality Notice 53                       : Yes
+
+# Quality Notice No. 54
+# Emit a quality notice when a interface
+# does not have a preceding comment.
+Quality Notice 54                       : Yes
+
+# RSM Quality Notices for File Content #
+
+# Quality Notice No. 19
+# Emit a quality notice when file white space
+# percentage is less than the specified minimum.
+# Consider setting Notice 30 to No.
+Quality Notice 19                       : Yes
+Minimum File Whitespace Percent         : 10.00 
+A TAB is equivalent to n space          : 2
+
+# Quality Notice No. 20
+# Emit a quality notice when file comment line
+# percentage is less than the specified minimum.
+Quality Notice 20                       : Yes
+Minimum File Comment Line Percent       : 10.00 
+
+# Quality Notice No. 47
+# Emit a quality notice when file blank line
+# percentage is less than the specified minimum.
+Quality Notice 47                       : No
+Minimum File Blank Line Percent         : 10.00 
+
+# Quality Notice No. 57
+# Emit a quality notice when RSM skip lines conditions
+# are met by a matching token.
+Quality Notice 57                       : No
+
+# Quality Notice No. 58
+# Emit a quality notice when RSM skip quality notice conditions
+# are met by a matching token.
+Quality Notice 58                       : No
+
+# RSM Quality Notices Miscellaneous ####################################
+
+# Quality Notice No. 25
+# Deprecated in Version 6.70
+# See settings under language extensions.
+
+####################################################################
+# Code Listing Report Configuration ################################
+
+# The following parameters setup source code printing.
+# These values become the default settings.
+Printed Line Length                     : 80
+Printed Page Length                     : 55
+Printed Left Margin                     : 5
+Printed Top Margin                      : 1
+Printed Page Header                     : RSM Code Listing
+Page breaks in code print format        : No
+
+####################################################################
+# HTML Report and Color Configuration ##############################
+
+# The following parameters setup HTML report output.  The hyperlinks
+# for source code can be either absolute or relative.
+Relative HTML Links                     : No
+
+# The following color parameters modify the HTML report
+# output.  Colors can be specified as Hex or Name.
+# Blank color parameters will result to the browser default.
+HTML RSM Color                          : #0000FF
+HTML Date Color                         : #0000FF
+HTML Text Color                         : #000000
+HTML VLink Color                        : #660099
+HTML Link Color                         : #0000EE
+HTML Background Color                   : #F8F8F8
+HTML Error Color                        : #FF0000
+HTML Line Color                         : #003399
+HTML Old File Differential Color        : #CC0033
+HTML New File Differential Color        : #336666
+HTML File Name Color                    : #0000FF
+HTML Function Color                     : #0000FF
+HTML Function Parameter Color           : #006600
+HTML Template Color                     : #006699
+HTML Macro Color                        : #33CCFF
+HTML Class Color                        : #663300
+HTML Inheritance Color                  : #FF3300
+HTML Struct Color                       : #990000
+HTML Notice Color                       : #CC0000
+HTML Header Color                       : #993300
+HTML New Code Differential Color        : #3366CC
+HTML Removed Code Differential Color    : #FF0000
+HTML Modified Code Differential Color   : #993300
+HTML Equal Code Differential Color      : #00CC00
+HTML Total Color                        : #993300
+HTML Inheritance Depth Color            : #333300
+HTML Inheritance Child Color            : #CC6600
+####################################################################
+# end of rsm.cfg

+ 4 - 4
examples/80x86/dos/watcom/l/bomb/bomb4.c

@@ -1,13 +1,13 @@
 /*****************************************************************************
 * Product: Time Bomb Example with QEP
-* Last Updated for Version: 4.5.00
-* Date of the Last Update:  May 18, 2012
+* Last Updated for Version: 5.2.0
+* Date of the Last Update:  Dec 24, 2013
 *
 *                    Q u a n t u m     L e a P s
 *                    ---------------------------
 *                    innovating embedded systems
 *
-* Copyright (C) 2002-2012 Quantum Leaps, LLC. All rights reserved.
+* Copyright (C) 2002-2013 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
@@ -32,7 +32,7 @@
 *                          http://www.state-machine.com
 * e-mail:                  info@quantum-leaps.com
 *****************************************************************************/
-#include "qep_port.h"                /* the port of the QEP event processor */
+#include "qp_port.h"                                         /* the QP port */
 #include "bsp.h"                                   /* board support package */
 
 enum BombSignals {                          /* all signals for the Bomb FSM */

+ 1 - 1
examples/80x86/dos/watcom/l/comp/bsp.c

@@ -95,7 +95,7 @@ void QF_onIdle(void) {            /* NOTE: entered with interrupts DISABLED */
     QF_INT_ENABLE();                     /* must at least enable interrupts */
 }
 /*..........................................................................*/
-void Q_onAssert(char const Q_ROM * const Q_ROM_VAR file, int line) {
+void Q_onAssert(char const Q_ROM * const file, int line) {
     fprintf(stderr, "Assertion failed in %s, line %d", file, line);
     QF_stop();
 }

+ 1 - 1
examples/80x86/dos/watcom/l/defer/bsp.c

@@ -95,7 +95,7 @@ void QF_onIdle(void) {            /* NOTE: entered with interrupts DISABLED */
     QF_INT_ENABLE();                     /* must at least enable interrupts */
 }
 /*..........................................................................*/
-void Q_onAssert(char const Q_ROM * const Q_ROM_VAR file, int line) {
+void Q_onAssert(char const Q_ROM * const file, int line) {
     fprintf(stderr, "Assertion failed in %s, line %d", file, line);
     QF_stop();
 }

+ 1 - 1
examples/80x86/dos/watcom/l/dpp/bsp.c

@@ -172,7 +172,7 @@ void BSP_busyDelay(void) {
     }
 }
 /*..........................................................................*/
-void Q_onAssert(char const Q_ROM * const Q_ROM_VAR file, int line) {
+void Q_onAssert(char const Q_ROM * const file, int line) {
     fprintf(stderr, "Assertion failed in %s, line %d", file, line);
     QF_stop();
 }

+ 1 - 1
examples/80x86/dos/watcom/l/game/bsp.c

@@ -241,7 +241,7 @@ void QF_onIdle(void) {
 #endif
 }
 /*--------------------------------------------------------------------------*/
-void Q_onAssert(char const Q_ROM * const Q_ROM_VAR file, int line) {
+void Q_onAssert(char const Q_ROM * const file, int line) {
     Video_clearRect ( 0, 24, 80, 25, VIDEO_BGND_RED);
     Video_printStrAt( 0, 24, VIDEO_FGND_WHITE, "ASSERTION FAILED in file:");
     Video_printStrAt(26, 24, VIDEO_FGND_YELLOW, file);

+ 5 - 5
examples/80x86/dos/watcom/l/history/history.c

@@ -1,13 +1,13 @@
 /*****************************************************************************
 * Product: History state pattern example
-* Last Updated for Version: 4.5.00
-* Date of the Last Update:  May 18, 2012
+* Last Updated for Version: 5.2.0
+* Date of the Last Update:  Dec 24, 2013
 *
 *                    Q u a n t u m     L e a P s
 *                    ---------------------------
 *                    innovating embedded systems
 *
-* Copyright (C) 2002-2012 Quantum Leaps, LLC. All rights reserved.
+* Copyright (C) 2002-2013 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
@@ -32,7 +32,7 @@
 *                          http://www.state-machine.com
 * e-mail:                  info@quantum-leaps.com
 *****************************************************************************/
-#include "qep_port.h"
+#include "qp_port.h"                                         /* the QP port */
 #include "qassert.h"
 
 #include <stdio.h>
@@ -229,7 +229,7 @@ void main() {
     }
 }
 /*..........................................................................*/
-void Q_onAssert(char const Q_ROM * const Q_ROM_VAR file, int line) {
+void Q_onAssert(char const Q_ROM * const file, int line) {
     fprintf(stderr, "Assertion failed in %s, line %d", file, line);
     _exit(-1);
 }

+ 5 - 5
examples/80x86/dos/watcom/l/hook/hook.c

@@ -1,13 +1,13 @@
 /*****************************************************************************
 * Product: Ultimate Hook state pattern example
-* Last Updated for Version: 4.5.00
-* Date of the Last Update:  May 18, 2012
+* Last Updated for Version: 5.2.0
+* Date of the Last Update:  Dec 24, 2013
 *
 *                    Q u a n t u m     L e a P s
 *                    ---------------------------
 *                    innovating embedded systems
 *
-* Copyright (C) 2002-2012 Quantum Leaps, LLC. All rights reserved.
+* Copyright (C) 2002-2013 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
@@ -32,7 +32,7 @@
 *                          http://www.state-machine.com
 * e-mail:                  info@quantum-leaps.com
 *****************************************************************************/
-#include "qep_port.h"
+#include "qp_port.h"                                         /* the QP port */
 #include "qassert.h"
 
 #include <stdio.h>
@@ -171,7 +171,7 @@ void main() {
     }
 }
 /*..........................................................................*/
-void Q_onAssert(char const Q_ROM * const Q_ROM_VAR file, int line) {
+void Q_onAssert(char const Q_ROM * const file, int line) {
     fprintf(stderr, "Assertion failed in %s, line %d", file, line);
     _exit(-1);
 }

+ 1 - 1
examples/80x86/dos/watcom/l/qhsmtst/log_pass.txt

@@ -1,4 +1,4 @@
-QHsmTst example, QEP 5.1.1
+QHsmTst example, QEP 5.2.0
 top-INIT;s-ENTRY;s2-ENTRY;s2-INIT;s21-ENTRY;s211-ENTRY;
 A:s21-A;s211-EXIT;s21-EXIT;s21-ENTRY;s21-INIT;s211-ENTRY;
 B:s21-B;s211-EXIT;s211-ENTRY;

+ 5 - 6
examples/80x86/dos/watcom/l/qhsmtst/main.c

@@ -1,13 +1,13 @@
 /*****************************************************************************
 * Product: QHsmTst Example, DOS, Large model
-* Last Updated for Version: 4.5.00
-* Date of the Last Update:  May 18, 2012
+* Last Updated for Version: 5.2.0
+* Date of the Last Update:  Dec 24, 2013
 *
 *                    Q u a n t u m     L e a P s
 *                    ---------------------------
 *                    innovating embedded systems
 *
-* Copyright (C) 2002-2012 Quantum Leaps, LLC. All rights reserved.
+* Copyright (C) 2002-2013 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
@@ -32,8 +32,7 @@
 *                          http://www.state-machine.com
 * e-mail:                  info@quantum-leaps.com
 *****************************************************************************/
-#include "qep_port.h"
-#include "qassert.h"
+#include "qp_port.h"                                         /* the QP port */
 #include "qhsmtst.h"
 
 #include <conio.h>
@@ -128,7 +127,7 @@ int main(int argc, char *argv[]) {
     return 0;
 }
 /*..........................................................................*/
-void Q_onAssert(char const Q_ROM * const Q_ROM_VAR file, int line) {
+void Q_onAssert(char const Q_ROM * const file, int line) {
     fprintf(stderr, "Assertion failed in %s, line %d", file, line);
     exit(-1);
 }

+ 1 - 1
examples/80x86/dos/watcom/l/reminder/bsp.c

@@ -95,7 +95,7 @@ void QF_onIdle(void) {            /* NOTE: entered with interrupts DISABLED */
     QF_INT_ENABLE();                     /* must at least enable interrupts */
 }
 /*..........................................................................*/
-void Q_onAssert(char const Q_ROM * const Q_ROM_VAR file, int line) {
+void Q_onAssert(char const Q_ROM * const file, int line) {
     fprintf(stderr, "Assertion failed in %s, line %d", file, line);
     QF_stop();
 }

+ 1 - 1
examples/80x86/qk/watcom/l/dpp/bsp.c

@@ -235,7 +235,7 @@ void BSP_displyPhilStat(uint8_t n, char const *stat) {
     QS_END()
 }
 /*..........................................................................*/
-void Q_onAssert(char const Q_ROM * const Q_ROM_VAR file, int line) {
+void Q_onAssert(char const Q_ROM * const file, int line) {
     Video_clearRect ( 0, 24, 80, 25, VIDEO_BGND_RED);
     Video_printStrAt( 0, 24, VIDEO_FGND_WHITE, "ASSERTION FAILED in file:");
     Video_printStrAt(26, 24, VIDEO_FGND_YELLOW, file);

+ 1 - 1
examples/80x86/qk/watcom/l/game/bsp.c

@@ -243,7 +243,7 @@ void QK_onIdle(void) {
 #endif
 }
 /*--------------------------------------------------------------------------*/
-void Q_onAssert(char const Q_ROM * const Q_ROM_VAR file, int line) {
+void Q_onAssert(char const Q_ROM * const file, int line) {
     Video_clearRect ( 0, 24, 80, 25, VIDEO_BGND_RED);
     Video_printStrAt( 0, 24, VIDEO_FGND_WHITE, "ASSERTION FAILED in file:");
     Video_printStrAt(26, 24, VIDEO_FGND_YELLOW, file);

+ 0 - 58
examples/arm-cm/qk/arm_keil/dpp-qk_ek-lm3s811/.dpp

@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<session version="2.3.2">
- <item name="license"></item>
- <group name="locked"/>
- <group name="settings">
-  <item name="tabs">1</item>
-  <item name="windows">0</item>
-  <item name="grid">3</item>
- </group>
- <group name="windows"/>
- <group name="search">
-  <item name="options">4129280</item>
-  <item name="replace">0</item>
- </group>
- <group name="vars"/>
- <group name="tools">
-  <group name="tool">
-   <item name="icon">0</item>
-   <item name="title"></item>
-   <item name="command"></item>
-   <item name="args"></item>
-   <item name="initial"></item>
-   <item name="options">0</item>
-  </group>
-  <group name="tool">
-   <item name="icon">0</item>
-   <item name="title"></item>
-   <item name="command"></item>
-   <item name="args"></item>
-   <item name="initial"></item>
-   <item name="options">0</item>
-  </group>
-  <group name="tool">
-   <item name="icon">0</item>
-   <item name="title"></item>
-   <item name="command"></item>
-   <item name="args"></item>
-   <item name="initial"></item>
-   <item name="options">0</item>
-  </group>
-  <group name="tool">
-   <item name="icon">0</item>
-   <item name="title"></item>
-   <item name="command"></item>
-   <item name="args"></item>
-   <item name="initial"></item>
-   <item name="options">0</item>
-  </group>
-  <group name="tool">
-   <item name="icon">0</item>
-   <item name="title"></item>
-   <item name="command"></item>
-   <item name="args"></item>
-   <item name="initial"></item>
-   <item name="options">0</item>
-  </group>
- </group>
-</session>

+ 9 - 12
examples/arm-cm/qk/arm_keil/dpp-qk_ek-lm3s811/bsp.c

@@ -1,7 +1,7 @@
 /*****************************************************************************
 * Product: "Dining Philosophers Problem" example, preemptive QK kernel
-* Last Updated for Version: 5.1.0
-* Date of the Last Update:  Sep 19, 2013
+* Last Updated for Version: 5.2.0
+* Date of the Last Update:  Dec 25, 2013
 *
 *                    Q u a n t u m     L e a P s
 *                    ---------------------------
@@ -64,7 +64,6 @@ Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
 /* ISRs defined in this BSP ------------------------------------------------*/
 void SysTick_Handler(void);
 void GPIOPortA_IRQHandler(void);
-void assert_failed(char const *file, int line);
 
 /* Local-scope objects -----------------------------------------------------*/
 static unsigned  l_rnd;                                      /* random seed */
@@ -104,7 +103,7 @@ void SysTick_Handler(void) {
     }
 #endif
 
-    QF_TICK(&l_SysTick_Handler);           /* process all armed time events */
+    QF_TICK_X(0U, &l_SysTick_Handler);    /* process time events for rate 0 */
 
                                              /* debounce the USER button... */
     btn = GPIOC->DATA_Bits[PUSH_BUTTON];               /* read the push btn */
@@ -186,7 +185,6 @@ void BSP_init(void) {
     if (QS_INIT((void *)0) == 0) {    /* initialize the QS software tracing */
         Q_ERROR();
     }
-    QS_RESET();
     QS_OBJ_DICTIONARY(&l_SysTick_Handler);
     QS_OBJ_DICTIONARY(&l_GPIOPortA_IRQHandler);
 }
@@ -279,17 +277,16 @@ void QK_onIdle(void) {
 }
 
 /*..........................................................................*/
-void Q_onAssert(char_t const Q_ROM * const Q_ROM_VAR file, int_t line) {
-    (void)file;                                   /* avoid compiler warning */
-    (void)line;                                   /* avoid compiler warning */
-    QF_INT_DISABLE();         /* make sure that all interrupts are disabled */
-    for (;;) {       /* NOTE: replace the loop with reset for final version */
-    }
+void Q_onAssert(char const Q_ROM * const file, int_t line) {
+    assert_failed(file, line);
 }
 /*..........................................................................*/
 /* error routine that is called if the CMSIS library encounters an error    */
 void assert_failed(char const *file, int line) {
-    Q_onAssert(file, line);
+    (void)file;                                   /* avoid compiler warning */
+    (void)line;                                   /* avoid compiler warning */
+    QF_INT_DISABLE();         /* make sure that all interrupts are disabled */
+    NVIC_SystemReset();                             /* perform system reset */
 }
 
 /*--------------------------------------------------------------------------*/

+ 23 - 8
examples/arm-cm/qk/arm_keil/dpp-qk_ek-lm3s811/dpp-qk.uvopt

@@ -73,7 +73,7 @@
       <OPTFL>
         <tvExp>1</tvExp>
         <tvExpOptDlg>0</tvExpOptDlg>
-        <IsCurrentTarget>1</IsCurrentTarget>
+        <IsCurrentTarget>0</IsCurrentTarget>
       </OPTFL>
       <CpuCode>255</CpuCode>
       <DllOpt>
@@ -120,6 +120,15 @@
         <pMon>BIN\lmidk-agdi.dll</pMon>
       </DebugOpt>
       <TargetDriverDllRegistry>
+        <SetRegEntry>
+          <Number>0</Number>
+          <Key>DLGUARM</Key>
+        </SetRegEntry>
+        <SetRegEntry>
+          <Number>0</Number>
+          <Key>UL2CM3</Key>
+          <Name>UL2CM3(-UU0101L5E -O14 -S0 -C0 -N00("ARM Cortex-M3") -D00(1BA00477) -L00(4) -FO7 -FD20000000 -FC800 -FN1 -FF0LM3S_64 -FS00 -FL010000)</Name>
+        </SetRegEntry>
         <SetRegEntry>
           <Number>0</Number>
           <Key>DLGTARM</Key>
@@ -280,7 +289,8 @@
       <TargetDriverDllRegistry>
         <SetRegEntry>
           <Number>0</Number>
-          <Key>DLGUARM</Key>
+          <Key>UL2CM3</Key>
+          <Name>UL2CM3(-UU0101L5E -O14 -S0 -C0 -N00("ARM Cortex-M3") -D00(1BA00477) -L00(4) -FO7 -FD20000000 -FC800 -FN1 -FF0LM3S_64 -FS00 -FL010000)</Name>
         </SetRegEntry>
         <SetRegEntry>
           <Number>0</Number>
@@ -393,7 +403,7 @@
       <OPTFL>
         <tvExp>1</tvExp>
         <tvExpOptDlg>0</tvExpOptDlg>
-        <IsCurrentTarget>0</IsCurrentTarget>
+        <IsCurrentTarget>1</IsCurrentTarget>
       </OPTFL>
       <CpuCode>255</CpuCode>
       <DllOpt>
@@ -444,6 +454,11 @@
           <Number>0</Number>
           <Key>DLGUARM</Key>
         </SetRegEntry>
+        <SetRegEntry>
+          <Number>0</Number>
+          <Key>UL2CM3</Key>
+          <Name>UL2CM3(-UU0101L5E -O14 -S0 -C0 -N00("ARM Cortex-M3") -D00(1BA00477) -L00(4) -FO7 -FD20000000 -FC800 -FN1 -FF0LM3S_64 -FS00 -FL010000)</Name>
+        </SetRegEntry>
         <SetRegEntry>
           <Number>0</Number>
           <Key>DLGTARM</Key>
@@ -479,7 +494,7 @@
         <aSer1>0</aSer1>
         <aSer2>0</aSer2>
         <aPa>0</aPa>
-        <viewmode>1</viewmode>
+        <viewmode>2</viewmode>
         <vrSel>0</vrSel>
         <aSym>0</aSym>
         <aTbox>0</aTbox>
@@ -516,8 +531,8 @@
       <Focus>0</Focus>
       <ColumnNumber>0</ColumnNumber>
       <tvExpOptDlg>0</tvExpOptDlg>
-      <TopLine>234</TopLine>
-      <CurrentLine>251</CurrentLine>
+      <TopLine>236</TopLine>
+      <CurrentLine>266</CurrentLine>
       <bDave2>0</bDave2>
       <PathWithFileName>.\bsp.c</PathWithFileName>
       <FilenameWithoutPath>bsp.c</FilenameWithoutPath>
@@ -676,8 +691,8 @@
       <Focus>0</Focus>
       <ColumnNumber>0</ColumnNumber>
       <tvExpOptDlg>0</tvExpOptDlg>
-      <TopLine>1</TopLine>
-      <CurrentLine>1</CurrentLine>
+      <TopLine>175</TopLine>
+      <CurrentLine>188</CurrentLine>
       <bDave2>0</bDave2>
       <PathWithFileName>.\startup-qk_lm3s.s</PathWithFileName>
       <FilenameWithoutPath>startup-qk_lm3s.s</FilenameWithoutPath>

+ 32 - 5
examples/arm-cm/qk/arm_keil/dpp-qk_ek-lm3s811/dpp-qk.uvproj

@@ -30,6 +30,7 @@
           <SLE66AMisc></SLE66AMisc>
           <SLE66LinkerMisc></SLE66LinkerMisc>
           <SFDFile>SFD\Luminary\LM3S811.SFR</SFDFile>
+          <bCustSvd>0</bCustSvd>
           <UseEnv>0</UseEnv>
           <BinPath></BinPath>
           <IncludePath></IncludePath>
@@ -97,6 +98,7 @@
           <StopOnExitCode>3</StopOnExitCode>
           <CustomArgument></CustomArgument>
           <IncludeLibraryModules></IncludeLibraryModules>
+          <ComprImg>1</ComprImg>
         </CommonProperty>
         <DllOption>
           <SimDllName>SARMCM3.DLL</SimDllName>
@@ -165,10 +167,14 @@
             <Capability>1</Capability>
             <DriverSelection>4097</DriverSelection>
           </Flash1>
-          <bUseTDR>0</bUseTDR>
+          <bUseTDR>1</bUseTDR>
           <Flash2>BIN\lmidk-agdi.dll</Flash2>
           <Flash3>"" ()</Flash3>
           <Flash4></Flash4>
+          <pFcarmOut></pFcarmOut>
+          <pFcarmGrp></pFcarmGrp>
+          <pFcArmRoot></pFcArmRoot>
+          <FcArmLst>0</FcArmLst>
         </Utilities>
         <TargetArmAds>
           <ArmAdsMisc>
@@ -335,7 +341,7 @@
           </ArmAdsMisc>
           <Cads>
             <interw>0</interw>
-            <Optim>1</Optim>
+            <Optim>2</Optim>
             <oTime>0</oTime>
             <SplitLS>0</SplitLS>
             <OneElfS>1</OneElfS>
@@ -466,6 +472,7 @@
               <StopOnExitCode>11</StopOnExitCode>
               <CustomArgument></CustomArgument>
               <IncludeLibraryModules></IncludeLibraryModules>
+              <ComprImg>0</ComprImg>
             </CommonProperty>
             <GroupArmAds>
               <Cads>
@@ -532,6 +539,7 @@
               <StopOnExitCode>11</StopOnExitCode>
               <CustomArgument></CustomArgument>
               <IncludeLibraryModules></IncludeLibraryModules>
+              <ComprImg>0</ComprImg>
             </CommonProperty>
             <GroupArmAds>
               <Cads>
@@ -598,6 +606,7 @@
               <StopOnExitCode>11</StopOnExitCode>
               <CustomArgument></CustomArgument>
               <IncludeLibraryModules></IncludeLibraryModules>
+              <ComprImg>0</ComprImg>
             </CommonProperty>
             <GroupArmAds>
               <Cads>
@@ -673,6 +682,7 @@
           <SLE66AMisc></SLE66AMisc>
           <SLE66LinkerMisc></SLE66LinkerMisc>
           <SFDFile>SFD\Luminary\LM3S811.SFR</SFDFile>
+          <bCustSvd>0</bCustSvd>
           <UseEnv>0</UseEnv>
           <BinPath></BinPath>
           <IncludePath></IncludePath>
@@ -740,6 +750,7 @@
           <StopOnExitCode>3</StopOnExitCode>
           <CustomArgument></CustomArgument>
           <IncludeLibraryModules></IncludeLibraryModules>
+          <ComprImg>1</ComprImg>
         </CommonProperty>
         <DllOption>
           <SimDllName>SARMCM3.DLL</SimDllName>
@@ -808,10 +819,14 @@
             <Capability>1</Capability>
             <DriverSelection>4097</DriverSelection>
           </Flash1>
-          <bUseTDR>0</bUseTDR>
+          <bUseTDR>1</bUseTDR>
           <Flash2>BIN\lmidk-agdi.dll</Flash2>
           <Flash3>"" ()</Flash3>
           <Flash4></Flash4>
+          <pFcarmOut></pFcarmOut>
+          <pFcarmGrp></pFcarmGrp>
+          <pFcArmRoot></pFcArmRoot>
+          <FcArmLst>0</FcArmLst>
         </Utilities>
         <TargetArmAds>
           <ArmAdsMisc>
@@ -1109,6 +1124,7 @@
               <StopOnExitCode>11</StopOnExitCode>
               <CustomArgument></CustomArgument>
               <IncludeLibraryModules></IncludeLibraryModules>
+              <ComprImg>0</ComprImg>
             </CommonProperty>
             <GroupArmAds>
               <Cads>
@@ -1175,6 +1191,7 @@
               <StopOnExitCode>11</StopOnExitCode>
               <CustomArgument></CustomArgument>
               <IncludeLibraryModules></IncludeLibraryModules>
+              <ComprImg>0</ComprImg>
             </CommonProperty>
             <GroupArmAds>
               <Cads>
@@ -1241,6 +1258,7 @@
               <StopOnExitCode>11</StopOnExitCode>
               <CustomArgument></CustomArgument>
               <IncludeLibraryModules></IncludeLibraryModules>
+              <ComprImg>0</ComprImg>
             </CommonProperty>
             <GroupArmAds>
               <Cads>
@@ -1316,6 +1334,7 @@
           <SLE66AMisc></SLE66AMisc>
           <SLE66LinkerMisc></SLE66LinkerMisc>
           <SFDFile>SFD\Luminary\LM3S811.SFR</SFDFile>
+          <bCustSvd>0</bCustSvd>
           <UseEnv>0</UseEnv>
           <BinPath></BinPath>
           <IncludePath></IncludePath>
@@ -1383,6 +1402,7 @@
           <StopOnExitCode>3</StopOnExitCode>
           <CustomArgument></CustomArgument>
           <IncludeLibraryModules></IncludeLibraryModules>
+          <ComprImg>1</ComprImg>
         </CommonProperty>
         <DllOption>
           <SimDllName>SARMCM3.DLL</SimDllName>
@@ -1451,10 +1471,14 @@
             <Capability>1</Capability>
             <DriverSelection>4097</DriverSelection>
           </Flash1>
-          <bUseTDR>0</bUseTDR>
+          <bUseTDR>1</bUseTDR>
           <Flash2>BIN\lmidk-agdi.dll</Flash2>
           <Flash3>"" ()</Flash3>
           <Flash4></Flash4>
+          <pFcarmOut></pFcarmOut>
+          <pFcarmGrp></pFcarmGrp>
+          <pFcArmRoot></pFcArmRoot>
+          <FcArmLst>0</FcArmLst>
         </Utilities>
         <TargetArmAds>
           <ArmAdsMisc>
@@ -1621,7 +1645,7 @@
           </ArmAdsMisc>
           <Cads>
             <interw>0</interw>
-            <Optim>1</Optim>
+            <Optim>2</Optim>
             <oTime>0</oTime>
             <SplitLS>0</SplitLS>
             <OneElfS>1</OneElfS>
@@ -1752,6 +1776,7 @@
               <StopOnExitCode>11</StopOnExitCode>
               <CustomArgument></CustomArgument>
               <IncludeLibraryModules></IncludeLibraryModules>
+              <ComprImg>0</ComprImg>
             </CommonProperty>
             <GroupArmAds>
               <Cads>
@@ -1818,6 +1843,7 @@
               <StopOnExitCode>11</StopOnExitCode>
               <CustomArgument></CustomArgument>
               <IncludeLibraryModules></IncludeLibraryModules>
+              <ComprImg>0</ComprImg>
             </CommonProperty>
             <GroupArmAds>
               <Cads>
@@ -1884,6 +1910,7 @@
               <StopOnExitCode>11</StopOnExitCode>
               <CustomArgument></CustomArgument>
               <IncludeLibraryModules></IncludeLibraryModules>
+              <ComprImg>0</ComprImg>
             </CommonProperty>
             <GroupArmAds>
               <Cads>

+ 57 - 9
examples/arm-cm/qk/arm_keil/dpp-qk_ek-lm3s811/dpp.qm

@@ -1,6 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<model version="2.3.0">
- <documentation>Dining Philosopher Problem example</documentation>
+<model version="3.0.0">
+ <documentation>Dining Philosopher Problem example
+
+NOTE: Requries QP 5.</documentation>
  <framework name="qpc"/>
  <package name="Events" stereotype="0x01">
   <class name="TableEvt" superclass="qpc::QEvt">
@@ -8,7 +10,7 @@
   </class>
  </package>
  <package name="AOs" stereotype="0x02">
-  <class name="Philo" superclass="qpc::QActive">
+  <class name="Philo" superclass="qpc::QMActive">
    <attribute name="timeEvt" type="QTimeEvt" visibility="0x02" properties="0x00"/>
    <statechart>
     <initial target="../1">
@@ -42,7 +44,7 @@ QActive_subscribe(&amp;me-&gt;super, EAT_SIG);</action>
      </initial_glyph>
     </initial>
     <state name="thinking">
-     <entry>QTimeEvt_postIn(&amp;me-&gt;timeEvt, &amp;me-&gt;super, THINK_TIME);</entry>
+     <entry>QTimeEvt_armX(&amp;me-&gt;timeEvt, THINK_TIME, 0U);</entry>
      <tran trig="TIMEOUT" target="../../2">
       <tran_glyph conn="2,12,3,1,20,13,-3">
        <action box="0,-2,6,2"/>
@@ -86,7 +88,7 @@ Q_ASSERT(Q_EVT_CAST(TableEvt)-&gt;philoNum != PHILO_ID(me));</action>
      </state_glyph>
     </state>
     <state name="eating">
-     <entry>QTimeEvt_postIn(&amp;me-&gt;timeEvt, &amp;me-&gt;super, EAT_TIME);</entry>
+     <entry>QTimeEvt_armX(&amp;me-&gt;timeEvt, EAT_TIME, 0U);</entry>
      <exit>TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
 pe-&gt;philoNum = PHILO_ID(me);
 QF_PUBLISH(&amp;pe-&gt;super, me);</exit>
@@ -110,7 +112,7 @@ Q_ASSERT(Q_EVT_CAST(TableEvt)-&gt;philoNum != PHILO_ID(me));</action>
     <state_diagram size="37,61"/>
    </statechart>
   </class>
-  <class name="Table" superclass="qpc::QActive">
+  <class name="Table" superclass="qpc::QMActive">
    <attribute name="fork[N_PHILO]" type="uint8_t" visibility="0x02" properties="0x00"/>
    <attribute name="isHungry[N_PHILO]" type="uint8_t" visibility="0x02" properties="0x00"/>
    <statechart>
@@ -316,15 +318,15 @@ me-&gt;fork[n] = FREE;</action>
 Philo *me;
 for (n = 0U; n &lt; N_PHILO; ++n) {
     me = &amp;l_philo[n];
-    QActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Philo_initial));
-    QTimeEvt_ctor(&amp;me-&gt;timeEvt, TIMEOUT_SIG);
+    QMActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Philo_initial));
+    QTimeEvt_ctorX(&amp;me-&gt;timeEvt, &amp;me-&gt;super, TIMEOUT_SIG, 0U);
 }</code>
   </operation>
   <operation name="Table_ctor" type="void" visibility="0x00" properties="0x00">
    <code>uint8_t n;
 Table *me = &amp;l_table;
 
-QActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Table_initial));
+QMActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Table_initial));
 
 for (n = 0U; n &lt; N_PHILO; ++n) {
     me-&gt;fork[n] = FREE;
@@ -424,5 +426,51 @@ QActive * const AO_Table = &amp;l_table.super; /* &quot;opaque&quot; AO pointer
 $define(AOs::Table_ctor)
 $define(AOs::Table)</text>
   </file>
+  <file name="main.c">
+   <text>#include &quot;qp_port.h&quot;
+#include &quot;dpp.h&quot;
+#include &quot;bsp.h&quot;
+
+/*..........................................................................*/
+int main() {
+    static QEvt const *tableQueueSto[N_PHILO];
+    static QEvt const *philoQueueSto[N_PHILO][N_PHILO];
+    static QSubscrList subscrSto[MAX_PUB_SIG];
+    static QF_MPOOL_EL(TableEvt) smlPoolSto[2*N_PHILO];       /* small pool */
+    uint8_t n;
+
+    Philo_ctor();             /* instantiate all Philosopher active objects */
+    Table_ctor();                    /* instantiate the Table active object */
+
+    QF_init();     /* initialize the framework and the underlying RT kernel */
+    BSP_init();                     /* initialize the Board Support Package */
+
+                                                  /* object dictionaries... */
+    QS_OBJ_DICTIONARY(smlPoolSto);
+    QS_OBJ_DICTIONARY(tableQueueSto);
+    QS_OBJ_DICTIONARY(philoQueueSto[0]);
+    QS_OBJ_DICTIONARY(philoQueueSto[1]);
+    QS_OBJ_DICTIONARY(philoQueueSto[2]);
+    QS_OBJ_DICTIONARY(philoQueueSto[3]);
+    QS_OBJ_DICTIONARY(philoQueueSto[4]);
+
+    QF_psInit(subscrSto, Q_DIM(subscrSto));       /* init publish-subscribe */
+
+                                               /* initialize event pools... */
+    QF_poolInit(smlPoolSto, sizeof(smlPoolSto), sizeof(smlPoolSto[0]));
+
+    for (n = 0U; n &lt; N_PHILO; ++n) {         /* start the active objects... */
+        QACTIVE_START(AO_Philo[n], (uint8_t)(n + 1),
+                      philoQueueSto[n], Q_DIM(philoQueueSto[n]),
+                      (void *)0, 0U, (QEvt *)0);
+    }
+    QACTIVE_START(AO_Table, (uint8_t)(N_PHILO + 1),
+                  tableQueueSto, Q_DIM(tableQueueSto),
+                  (void *)0, 0U, (QEvt *)0);
+
+    return QF_run();                              /* run the QF application */
+}
+</text>
+  </file>
  </directory>
 </model>

+ 31 - 51
examples/arm-cm/qk/arm_keil/dpp-qk_ek-lm3s811/main.c

@@ -1,81 +1,61 @@
 /*****************************************************************************
-* Product: DPP example
-* Last Updated for Version: 4.5.02
-* Date of the Last Update:  Jul 04, 2012
+* Model: dpp.qm
+* File:  ./main.c
 *
-*                    Q u a n t u m     L e a P s
-*                    ---------------------------
-*                    innovating embedded systems
-*
-* Copyright (C) 2002-2012 Quantum Leaps, LLC. All rights reserved.
+* This code has been generated by QM tool (see state-machine.com/qm).
+* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
 *
 * 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 3 of the License, or
-* (at your option) any later version.
-*
-* 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.
-*
-* 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/>.
+* by the Free Software Foundation.
 *
-* Contact information:
-* Quantum Leaps Web sites: http://www.quantum-leaps.com
-*                          http://www.state-machine.com
-* e-mail:                  info@quantum-leaps.com
+* 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.
 *****************************************************************************/
+/* @(/3/3) .................................................................*/
 #include "qp_port.h"
 #include "dpp.h"
 #include "bsp.h"
 
-/* Local-scope objects -----------------------------------------------------*/
-static QEvt const *l_tableQueueSto[N_PHILO];
-static QEvt const *l_philoQueueSto[N_PHILO][N_PHILO];
-static QSubscrList l_subscrSto[MAX_PUB_SIG];
-
-/* storage for event pools... */
-static QF_MPOOL_EL(TableEvt) l_smlPoolSto[2*N_PHILO];         /* small pool */
-
 /*..........................................................................*/
-int main(void) {
+int main() {
+    static QEvt const *tableQueueSto[N_PHILO];
+    static QEvt const *philoQueueSto[N_PHILO][N_PHILO];
+    static QSubscrList subscrSto[MAX_PUB_SIG];
+    static QF_MPOOL_EL(TableEvt) smlPoolSto[2*N_PHILO];       /* small pool */
     uint8_t n;
 
     Philo_ctor();             /* instantiate all Philosopher active objects */
     Table_ctor();                    /* instantiate the Table active object */
 
     QF_init();     /* initialize the framework and the underlying RT kernel */
-    BSP_init();                                       /* initialize the BSP */
+    BSP_init();                     /* initialize the Board Support Package */
 
                                                   /* object dictionaries... */
-    QS_OBJ_DICTIONARY(l_smlPoolSto);
-    QS_OBJ_DICTIONARY(l_tableQueueSto);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[0]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[1]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[2]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[3]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[4]);
+    QS_OBJ_DICTIONARY(smlPoolSto);
+    QS_OBJ_DICTIONARY(tableQueueSto);
+    QS_OBJ_DICTIONARY(philoQueueSto[0]);
+    QS_OBJ_DICTIONARY(philoQueueSto[1]);
+    QS_OBJ_DICTIONARY(philoQueueSto[2]);
+    QS_OBJ_DICTIONARY(philoQueueSto[3]);
+    QS_OBJ_DICTIONARY(philoQueueSto[4]);
 
-    QF_psInit(l_subscrSto, Q_DIM(l_subscrSto));   /* init publish-subscribe */
+    QF_psInit(subscrSto, Q_DIM(subscrSto));       /* init publish-subscribe */
 
                                                /* initialize event pools... */
-    QF_poolInit(l_smlPoolSto, sizeof(l_smlPoolSto), sizeof(l_smlPoolSto[0]));
+    QF_poolInit(smlPoolSto, sizeof(smlPoolSto), sizeof(smlPoolSto[0]));
 
-    for (n = 0; n < N_PHILO; ++n) {          /* start the active objects... */
-        QActive_start(AO_Philo[n], (uint8_t)(n + 1),
-                      l_philoQueueSto[n], Q_DIM(l_philoQueueSto[n]),
+    for (n = 0U; n < N_PHILO; ++n) {         /* start the active objects... */
+        QACTIVE_START(AO_Philo[n], (uint8_t)(n + 1),
+                      philoQueueSto[n], Q_DIM(philoQueueSto[n]),
                       (void *)0, 0U, (QEvt *)0);
     }
-    QActive_start(AO_Table, (uint8_t)(N_PHILO + 1),
-                  l_tableQueueSto, Q_DIM(l_tableQueueSto),
+    QACTIVE_START(AO_Table, (uint8_t)(N_PHILO + 1),
+                  tableQueueSto, Q_DIM(tableQueueSto),
                   (void *)0, 0U, (QEvt *)0);
 
     return QF_run();                              /* run the QF application */
 }
+

+ 73 - 45
examples/arm-cm/qk/arm_keil/dpp-qk_ek-lm3s811/philo.c

@@ -25,7 +25,7 @@ Q_DEFINE_THIS_FILE
 /* @(/2/0) .................................................................*/
 typedef struct PhiloTag {
 /* protected: */
-    QActive super;
+    QMActive super;
 
 /* private: */
     QTimeEvt timeEvt;
@@ -33,9 +33,28 @@ typedef struct PhiloTag {
 
 /* protected: */
 static QState Philo_initial(Philo * const me, QEvt const * const e);
-static QState Philo_thinking(Philo * const me, QEvt const * const e);
-static QState Philo_hungry(Philo * const me, QEvt const * const e);
-static QState Philo_eating(Philo * const me, QEvt const * const e);
+static QState Philo_thinking  (Philo * const me, QEvt const * const e);
+static QState Philo_thinking_e(Philo * const me);
+static QMState const Philo_thinking_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Philo_thinking),
+    Q_ACTION_CAST(0)
+};
+static QState Philo_hungry  (Philo * const me, QEvt const * const e);
+static QState Philo_hungry_e(Philo * const me);
+static QMState const Philo_hungry_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Philo_hungry),
+    Q_ACTION_CAST(0)
+};
+static QState Philo_eating  (Philo * const me, QEvt const * const e);
+static QState Philo_eating_e(Philo * const me);
+static QState Philo_eating_x(Philo * const me);
+static QMState const Philo_eating_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Philo_eating),
+    Q_ACTION_CAST(&Philo_eating_x)
+};
 
 
 /* Local objects -----------------------------------------------------------*/
@@ -69,14 +88,18 @@ void Philo_ctor(void) {
     Philo *me;
     for (n = 0U; n < N_PHILO; ++n) {
         me = &l_philo[n];
-        QActive_ctor(&me->super, Q_STATE_CAST(&Philo_initial));
-        QTimeEvt_ctor(&me->timeEvt, TIMEOUT_SIG);
+        QMActive_ctor(&me->super, Q_STATE_CAST(&Philo_initial));
+        QTimeEvt_ctorX(&me->timeEvt, &me->super, TIMEOUT_SIG, 0U);
     }
 }
 /* @(/2/0) .................................................................*/
 /* @(/2/0/1) ...............................................................*/
 /* @(/2/0/1/0) */
 static QState Philo_initial(Philo * const me, QEvt const * const e) {
+    static QActionHandler const act_[] = {
+        Q_ACTION_CAST(&Philo_thinking_e),
+        Q_ACTION_CAST(0)
+    };
     static uint8_t registered = (uint8_t)0; /* starts off with 0, per C-standard */
     (void)e; /* suppress the compiler warning about unused parameter */
     if (registered == (uint8_t)0) {
@@ -102,21 +125,23 @@ static QState Philo_initial(Philo * const me, QEvt const * const e) {
     QS_SIG_DICTIONARY(TIMEOUT_SIG, me); /* signal for each Philos */
 
     QActive_subscribe(&me->super, EAT_SIG);
-    return Q_TRAN(&Philo_thinking);
+    return QM_INITIAL(&Philo_thinking_s, act_);
 }
 /* @(/2/0/1/1) .............................................................*/
+static QState Philo_thinking_e(Philo * const me) {
+    QTimeEvt_armX(&me->timeEvt, THINK_TIME, 0U);
+    return QM_ENTRY(&Philo_thinking_s);
+}
 static QState Philo_thinking(Philo * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/0/1/1) */
-        case Q_ENTRY_SIG: {
-            QTimeEvt_postIn(&me->timeEvt, &me->super, THINK_TIME);
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/0/1/1/0) */
         case TIMEOUT_SIG: {
-            status_ = Q_TRAN(&Philo_hungry);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Philo_hungry_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Philo_hungry_s, act_);
             break;
         }
         /* @(/2/0/1/1/1) */
@@ -124,36 +149,38 @@ static QState Philo_thinking(Philo * const me, QEvt const * const e) {
         case DONE_SIG: {
             /* EAT or DONE must be for other Philos than this one */
             Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/0/1/2) .............................................................*/
+static QState Philo_hungry_e(Philo * const me) {
+    TableEvt *pe = Q_NEW(TableEvt, HUNGRY_SIG);
+    pe->philoNum = PHILO_ID(me);
+    QACTIVE_POST(AO_Table, &pe->super, me);
+    return QM_ENTRY(&Philo_hungry_s);
+}
 static QState Philo_hungry(Philo * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/0/1/2) */
-        case Q_ENTRY_SIG: {
-            TableEvt *pe = Q_NEW(TableEvt, HUNGRY_SIG);
-            pe->philoNum = PHILO_ID(me);
-            QACTIVE_POST(AO_Table, &pe->super, me);
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/0/1/2/0) */
         case EAT_SIG: {
             /* @(/2/0/1/2/0/0) */
             if (Q_EVT_CAST(TableEvt)->philoNum == PHILO_ID(me)) {
-                status_ = Q_TRAN(&Philo_eating);
+                static QActionHandler const act_[] = {
+                    Q_ACTION_CAST(&Philo_eating_e),
+                    Q_ACTION_CAST(0)
+                };
+                status_ = QM_TRAN(&Philo_eating_s, act_);
             }
             else {
-                status_ = Q_UNHANDLED();
+                status_ = QM_UNHANDLED();
             }
             break;
         }
@@ -161,37 +188,38 @@ static QState Philo_hungry(Philo * const me, QEvt const * const e) {
         case DONE_SIG: {
             /* DONE must be for other Philos than this one */
             Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/0/1/3) .............................................................*/
+static QState Philo_eating_e(Philo * const me) {
+    QTimeEvt_armX(&me->timeEvt, EAT_TIME, 0U);
+    return QM_ENTRY(&Philo_eating_s);
+}
+static QState Philo_eating_x(Philo * const me) {
+    TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
+    pe->philoNum = PHILO_ID(me);
+    QF_PUBLISH(&pe->super, me);
+    return QM_EXIT(&Philo_eating_s);
+}
 static QState Philo_eating(Philo * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/0/1/3) */
-        case Q_ENTRY_SIG: {
-            QTimeEvt_postIn(&me->timeEvt, &me->super, EAT_TIME);
-            status_ = Q_HANDLED();
-            break;
-        }
-        /* @(/2/0/1/3) */
-        case Q_EXIT_SIG: {
-            TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
-            pe->philoNum = PHILO_ID(me);
-            QF_PUBLISH(&pe->super, me);
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/0/1/3/0) */
         case TIMEOUT_SIG: {
-            status_ = Q_TRAN(&Philo_thinking);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Philo_eating_x),
+                Q_ACTION_CAST(&Philo_thinking_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Philo_thinking_s, act_);
             break;
         }
         /* @(/2/0/1/3/1) */
@@ -199,11 +227,11 @@ static QState Philo_eating(Philo * const me, QEvt const * const e) {
         case DONE_SIG: {
             /* EAT or DONE must be for other Philos than this one */
             Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }

+ 78 - 53
examples/arm-cm/qk/arm_keil/dpp-qk_ek-lm3s811/table.c

@@ -25,7 +25,7 @@ Q_DEFINE_THIS_FILE
 /* @(/2/1) .................................................................*/
 typedef struct TableTag {
 /* protected: */
-    QActive super;
+    QMActive super;
 
 /* private: */
     uint8_t fork[N_PHILO];
@@ -34,9 +34,27 @@ typedef struct TableTag {
 
 /* protected: */
 static QState Table_initial(Table * const me, QEvt const * const e);
-static QState Table_active(Table * const me, QEvt const * const e);
-static QState Table_serving(Table * const me, QEvt const * const e);
-static QState Table_paused(Table * const me, QEvt const * const e);
+static QState Table_active  (Table * const me, QEvt const * const e);
+static QMState const Table_active_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Table_active),
+    Q_ACTION_CAST(0)
+};
+static QState Table_serving  (Table * const me, QEvt const * const e);
+static QState Table_serving_e(Table * const me);
+static QMState const Table_serving_s = {
+    &Table_active_s,
+    Q_STATE_CAST(&Table_serving),
+    Q_ACTION_CAST(0)
+};
+static QState Table_paused  (Table * const me, QEvt const * const e);
+static QState Table_paused_e(Table * const me);
+static QState Table_paused_x(Table * const me);
+static QMState const Table_paused_s = {
+    &Table_active_s,
+    Q_STATE_CAST(&Table_paused),
+    Q_ACTION_CAST(&Table_paused_x)
+};
 
 
 #define RIGHT(n_) ((uint8_t)(((n_) + (N_PHILO - 1U)) % N_PHILO))
@@ -56,7 +74,7 @@ void Table_ctor(void) {
     uint8_t n;
     Table *me = &l_table;
 
-    QActive_ctor(&me->super, Q_STATE_CAST(&Table_initial));
+    QMActive_ctor(&me->super, Q_STATE_CAST(&Table_initial));
 
     for (n = 0U; n < N_PHILO; ++n) {
         me->fork[n] = FREE;
@@ -67,6 +85,10 @@ void Table_ctor(void) {
 /* @(/2/1/2) ...............................................................*/
 /* @(/2/1/2/0) */
 static QState Table_initial(Table * const me, QEvt const * const e) {
+    static QActionHandler const act_[] = {
+        Q_ACTION_CAST(&Table_serving_e),
+        Q_ACTION_CAST(0)
+    };
     uint8_t n;
     (void)e; /* suppress the compiler warning about unused parameter */
 
@@ -91,7 +113,7 @@ static QState Table_initial(Table * const me, QEvt const * const e) {
         me->isHungry[n] = 0U;
         BSP_displayPhilStat(n, "thinking");
     }
-    return Q_TRAN(&Table_serving);
+    return QM_INITIAL(&Table_serving_s, act_);
 }
 /* @(/2/1/2/1) .............................................................*/
 static QState Table_active(Table * const me, QEvt const * const e) {
@@ -100,48 +122,46 @@ static QState Table_active(Table * const me, QEvt const * const e) {
         /* @(/2/1/2/1/0) */
         case TERMINATE_SIG: {
             BSP_terminate(0);
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/1) */
         case EAT_SIG: {
             Q_ERROR();
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/1/2/1/2) ...........................................................*/
+static QState Table_serving_e(Table * const me) {
+    uint8_t n;
+    for (n = 0U; n < N_PHILO; ++n) { /* give permissions to eat... */
+        if ((me->isHungry[n] != 0U)
+            && (me->fork[LEFT(n)] == FREE)
+            && (me->fork[n] == FREE))
+        {
+            TableEvt *te;
+
+            me->fork[LEFT(n)] = USED;
+            me->fork[n] = USED;
+            te = Q_NEW(TableEvt, EAT_SIG);
+            te->philoNum = n;
+            QF_PUBLISH(&te->super, me);
+            me->isHungry[n] = 0U;
+            BSP_displayPhilStat(n, "eating  ");
+        }
+    }
+    return QM_ENTRY(&Table_serving_s);
+}
 static QState Table_serving(Table * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/1/2/1/2) */
-        case Q_ENTRY_SIG: {
-            uint8_t n;
-            for (n = 0U; n < N_PHILO; ++n) { /* give permissions to eat... */
-                if ((me->isHungry[n] != 0U)
-                    && (me->fork[LEFT(n)] == FREE)
-                    && (me->fork[n] == FREE))
-                {
-                    TableEvt *te;
-
-                    me->fork[LEFT(n)] = USED;
-                    me->fork[n] = USED;
-                    te = Q_NEW(TableEvt, EAT_SIG);
-                    te->philoNum = n;
-                    QF_PUBLISH(&te->super, me);
-                    me->isHungry[n] = 0U;
-                    BSP_displayPhilStat(n, "eating  ");
-                }
-            }
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/1/2/1/2/0) */
         case HUNGRY_SIG: {
             uint8_t n, m;
@@ -161,12 +181,12 @@ static QState Table_serving(Table * const me, QEvt const * const e) {
                 pe->philoNum = n;
                 QF_PUBLISH(&pe->super, me);
                 BSP_displayPhilStat(n, "eating  ");
-                status_ = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             /* @(/2/1/2/1/2/0/1) */
             else {
                 me->isHungry[n] = 1U;
-                status_ = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             break;
         }
@@ -208,46 +228,51 @@ static QState Table_serving(Table * const me, QEvt const * const e) {
                 QF_PUBLISH(&pe->super, me);
                 BSP_displayPhilStat(m, "eating  ");
             }
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/2/2) */
         case EAT_SIG: {
             Q_ERROR();
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/2/3) */
         case PAUSE_SIG: {
-            status_ = Q_TRAN(&Table_paused);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Table_paused_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Table_paused_s, act_);
             break;
         }
         default: {
-            status_ = Q_SUPER(&Table_active);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/1/2/1/3) ...........................................................*/
+static QState Table_paused_e(Table * const me) {
+    BSP_displayPaused(1U);
+    return QM_ENTRY(&Table_paused_s);
+}
+static QState Table_paused_x(Table * const me) {
+    BSP_displayPaused(0U);
+    return QM_EXIT(&Table_paused_s);
+}
 static QState Table_paused(Table * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/1/2/1/3) */
-        case Q_ENTRY_SIG: {
-            BSP_displayPaused(1U);
-            status_ = Q_HANDLED();
-            break;
-        }
-        /* @(/2/1/2/1/3) */
-        case Q_EXIT_SIG: {
-            BSP_displayPaused(0U);
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/1/2/1/3/0) */
         case PAUSE_SIG: {
-            status_ = Q_TRAN(&Table_serving);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Table_paused_x),
+                Q_ACTION_CAST(&Table_serving_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Table_serving_s, act_);
             break;
         }
         /* @(/2/1/2/1/3/1) */
@@ -257,7 +282,7 @@ static QState Table_paused(Table * const me, QEvt const * const e) {
             Q_ASSERT((n < N_PHILO) && (me->isHungry[n] == 0U));
             me->isHungry[n] = 1U;
             BSP_displayPhilStat(n, "hungry  ");
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/3/2) */
@@ -275,11 +300,11 @@ static QState Table_paused(Table * const me, QEvt const * const e) {
 
             me->fork[m] = FREE;
             me->fork[n] = FREE;
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status_ = Q_SUPER(&Table_active);
+            status_ = QM_SUPER();
             break;
         }
     }

+ 0 - 58
examples/arm-cm/qk/arm_keil/dpp-qk_ek-tm4c123gxl/.dpp

@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<session version="2.3.2">
- <item name="license"></item>
- <group name="locked"/>
- <group name="settings">
-  <item name="tabs">1</item>
-  <item name="windows">0</item>
-  <item name="grid">3</item>
- </group>
- <group name="windows"/>
- <group name="search">
-  <item name="options">4129280</item>
-  <item name="replace">0</item>
- </group>
- <group name="vars"/>
- <group name="tools">
-  <group name="tool">
-   <item name="icon">0</item>
-   <item name="title"></item>
-   <item name="command"></item>
-   <item name="args"></item>
-   <item name="initial"></item>
-   <item name="options">0</item>
-  </group>
-  <group name="tool">
-   <item name="icon">0</item>
-   <item name="title"></item>
-   <item name="command"></item>
-   <item name="args"></item>
-   <item name="initial"></item>
-   <item name="options">0</item>
-  </group>
-  <group name="tool">
-   <item name="icon">0</item>
-   <item name="title"></item>
-   <item name="command"></item>
-   <item name="args"></item>
-   <item name="initial"></item>
-   <item name="options">0</item>
-  </group>
-  <group name="tool">
-   <item name="icon">0</item>
-   <item name="title"></item>
-   <item name="command"></item>
-   <item name="args"></item>
-   <item name="initial"></item>
-   <item name="options">0</item>
-  </group>
-  <group name="tool">
-   <item name="icon">0</item>
-   <item name="title"></item>
-   <item name="command"></item>
-   <item name="args"></item>
-   <item name="initial"></item>
-   <item name="options">0</item>
-  </group>
- </group>
-</session>

+ 9 - 12
examples/arm-cm/qk/arm_keil/dpp-qk_ek-tm4c123gxl/bsp.c

@@ -1,7 +1,7 @@
 /*****************************************************************************
 * Product: "Dining Philosophers Problem" example, preemptive QK kernel
-* Last Updated for Version: 5.1.0
-* Date of the Last Update:  Sep 19, 2013
+* Last Updated for Version: 5.2.0
+* Date of the Last Update:  Dec 25, 2013
 *
 *                    Q u a n t u m     L e a P s
 *                    ---------------------------
@@ -66,7 +66,6 @@ Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
 /* ISRs defined in this BSP ------------------------------------------------*/
 void SysTick_Handler(void);
 void GPIOPortA_IRQHandler(void);
-void assert_failed(char const *file, int line);
 
 /* Local-scope objects -----------------------------------------------------*/
 static unsigned  l_rnd;                                      /* random seed */
@@ -110,7 +109,7 @@ void SysTick_Handler(void) {
     }
 #endif
 
-    QF_TICK_X(0U, &l_SysTick_Handler);     /* process all armed time events */
+    QF_TICK_X(0U, &l_SysTick_Handler);    /* process time events for rate 0 */
 
                                               /* debounce the SW1 button... */
     btn = GPIOF->DATA_Bits[USR_SW1];                   /* read the push btn */
@@ -203,7 +202,6 @@ void BSP_init(void) {
     if (QS_INIT((void *)0) == 0) {    /* initialize the QS software tracing */
         Q_ERROR();
     }
-    QS_RESET();
     QS_OBJ_DICTIONARY(&l_SysTick_Handler);
     QS_OBJ_DICTIONARY(&l_GPIOPortA_IRQHandler);
 }
@@ -301,17 +299,16 @@ void QK_onIdle(void) {
 }
 
 /*..........................................................................*/
-void Q_onAssert(char const Q_ROM * const Q_ROM_VAR file, int line) {
-    (void)file;                                   /* avoid compiler warning */
-    (void)line;                                   /* avoid compiler warning */
-    QF_INT_DISABLE();         /* make sure that all interrupts are disabled */
-    for (;;) {       /* NOTE: replace the loop with reset for final version */
-    }
+void Q_onAssert(char const Q_ROM * const file, int_t line) {
+    assert_failed(file, line);
 }
 /*..........................................................................*/
 /* error routine that is called if the CMSIS library encounters an error    */
 void assert_failed(char const *file, int line) {
-    Q_onAssert(file, line);
+    (void)file;                                   /* avoid compiler warning */
+    (void)line;                                   /* avoid compiler warning */
+    QF_INT_DISABLE();         /* make sure that all interrupts are disabled */
+    ROM_SysCtlReset();                                  /* reset the system */
 }
 
 /*--------------------------------------------------------------------------*/

+ 16 - 0
examples/arm-cm/qk/arm_keil/dpp-qk_ek-tm4c123gxl/dpp-qk.sct

@@ -0,0 +1,16 @@
+; *************************************************************
+; *** Scatter-Loading Description File generated by uVision ***
+; *************************************************************
+
+LR_IROM1 0x00000000 0x00040000  {    ; load region size_region
+  ER_IROM1 0x00000000 0x00040000  {  ; load address = execution address
+   *.o (RESET, +FIRST)
+   *(InRoot$$Sections)
+   .ANY (+RO)
+  }
+  RW_IRAM1 0x20000000 0x00008000  {  ; RW data
+   *.o (STACK, +FIRST)
+   .ANY (+RW +ZI)
+  }
+}
+

+ 13 - 4
examples/arm-cm/qk/arm_keil/dpp-qk_ek-tm4c123gxl/dpp-qk.uvopt

@@ -137,6 +137,15 @@
         <pMon>BIN\lmidk-agdi.dll</pMon>
       </DebugOpt>
       <TargetDriverDllRegistry>
+        <SetRegEntry>
+          <Number>0</Number>
+          <Key>DLGUARM</Key>
+        </SetRegEntry>
+        <SetRegEntry>
+          <Number>0</Number>
+          <Key>UL2CM3</Key>
+          <Name>UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0TM4C123_256 -FS00 -FL040000)</Name>
+        </SetRegEntry>
         <SetRegEntry>
           <Number>0</Number>
           <Key>DLGTARM</Key>
@@ -574,8 +583,8 @@
       <Focus>0</Focus>
       <ColumnNumber>0</ColumnNumber>
       <tvExpOptDlg>0</tvExpOptDlg>
-      <TopLine>262</TopLine>
-      <CurrentLine>279</CurrentLine>
+      <TopLine>273</TopLine>
+      <CurrentLine>278</CurrentLine>
       <bDave2>0</bDave2>
       <PathWithFileName>.\bsp.c</PathWithFileName>
       <FilenameWithoutPath>bsp.c</FilenameWithoutPath>
@@ -670,8 +679,8 @@
       <Focus>0</Focus>
       <ColumnNumber>0</ColumnNumber>
       <tvExpOptDlg>0</tvExpOptDlg>
-      <TopLine>0</TopLine>
-      <CurrentLine>0</CurrentLine>
+      <TopLine>274</TopLine>
+      <CurrentLine>279</CurrentLine>
       <bDave2>0</bDave2>
       <PathWithFileName>.\startup-qk_tm4c.s</PathWithFileName>
       <FilenameWithoutPath>startup-qk_tm4c.s</FilenameWithoutPath>

+ 30 - 3
examples/arm-cm/qk/arm_keil/dpp-qk_ek-tm4c123gxl/dpp-qk.uvproj

@@ -30,6 +30,7 @@
           <SLE66AMisc></SLE66AMisc>
           <SLE66LinkerMisc></SLE66LinkerMisc>
           <SFDFile>SFD\Luminary\LM4F120H5QR.SFR</SFDFile>
+          <bCustSvd>0</bCustSvd>
           <UseEnv>0</UseEnv>
           <BinPath></BinPath>
           <IncludePath></IncludePath>
@@ -97,6 +98,7 @@
           <StopOnExitCode>3</StopOnExitCode>
           <CustomArgument></CustomArgument>
           <IncludeLibraryModules></IncludeLibraryModules>
+          <ComprImg>1</ComprImg>
         </CommonProperty>
         <DllOption>
           <SimDllName>SARMCM3.DLL</SimDllName>
@@ -165,10 +167,14 @@
             <Capability>1</Capability>
             <DriverSelection>4097</DriverSelection>
           </Flash1>
-          <bUseTDR>0</bUseTDR>
+          <bUseTDR>1</bUseTDR>
           <Flash2>BIN\lmidk-agdi.dll</Flash2>
           <Flash3>"" ()</Flash3>
           <Flash4></Flash4>
+          <pFcarmOut></pFcarmOut>
+          <pFcarmGrp></pFcarmGrp>
+          <pFcArmRoot></pFcArmRoot>
+          <FcArmLst>0</FcArmLst>
         </Utilities>
         <TargetArmAds>
           <ArmAdsMisc>
@@ -371,7 +377,7 @@
             </VariousControls>
           </Aads>
           <LDads>
-            <umfTarg>1</umfTarg>
+            <umfTarg>0</umfTarg>
             <Ropi>0</Ropi>
             <Rwpi>0</Rwpi>
             <noStLib>0</noStLib>
@@ -379,7 +385,7 @@
             <useFile>0</useFile>
             <TextAddressRange>0x00000000</TextAddressRange>
             <DataAddressRange>0x20000000</DataAddressRange>
-            <ScatterFile>dpp-qk.sct</ScatterFile>
+            <ScatterFile>.\dpp-qk.sct</ScatterFile>
             <IncludeLibs></IncludeLibs>
             <IncludeLibsPath></IncludeLibsPath>
             <Misc>--entry Reset_Handler</Misc>
@@ -446,6 +452,7 @@
               <StopOnExitCode>11</StopOnExitCode>
               <CustomArgument></CustomArgument>
               <IncludeLibraryModules></IncludeLibraryModules>
+              <ComprImg>0</ComprImg>
             </CommonProperty>
             <GroupArmAds>
               <Cads>
@@ -512,6 +519,7 @@
               <StopOnExitCode>11</StopOnExitCode>
               <CustomArgument></CustomArgument>
               <IncludeLibraryModules></IncludeLibraryModules>
+              <ComprImg>0</ComprImg>
             </CommonProperty>
             <GroupArmAds>
               <Cads>
@@ -578,6 +586,7 @@
               <StopOnExitCode>11</StopOnExitCode>
               <CustomArgument></CustomArgument>
               <IncludeLibraryModules></IncludeLibraryModules>
+              <ComprImg>0</ComprImg>
             </CommonProperty>
             <GroupArmAds>
               <Cads>
@@ -653,6 +662,7 @@
           <SLE66AMisc></SLE66AMisc>
           <SLE66LinkerMisc></SLE66LinkerMisc>
           <SFDFile>SFD\Luminary\LM4F120H5QR.SFR</SFDFile>
+          <bCustSvd>0</bCustSvd>
           <UseEnv>0</UseEnv>
           <BinPath></BinPath>
           <IncludePath></IncludePath>
@@ -720,6 +730,7 @@
           <StopOnExitCode>3</StopOnExitCode>
           <CustomArgument></CustomArgument>
           <IncludeLibraryModules></IncludeLibraryModules>
+          <ComprImg>1</ComprImg>
         </CommonProperty>
         <DllOption>
           <SimDllName>SARMCM3.DLL</SimDllName>
@@ -792,6 +803,10 @@
           <Flash2>BIN\lmidk-agdi.dll</Flash2>
           <Flash3>"" ()</Flash3>
           <Flash4></Flash4>
+          <pFcarmOut></pFcarmOut>
+          <pFcarmGrp></pFcarmGrp>
+          <pFcArmRoot></pFcArmRoot>
+          <FcArmLst>0</FcArmLst>
         </Utilities>
         <TargetArmAds>
           <ArmAdsMisc>
@@ -1069,6 +1084,7 @@
               <StopOnExitCode>11</StopOnExitCode>
               <CustomArgument></CustomArgument>
               <IncludeLibraryModules></IncludeLibraryModules>
+              <ComprImg>0</ComprImg>
             </CommonProperty>
             <GroupArmAds>
               <Cads>
@@ -1135,6 +1151,7 @@
               <StopOnExitCode>11</StopOnExitCode>
               <CustomArgument></CustomArgument>
               <IncludeLibraryModules></IncludeLibraryModules>
+              <ComprImg>0</ComprImg>
             </CommonProperty>
             <GroupArmAds>
               <Cads>
@@ -1201,6 +1218,7 @@
               <StopOnExitCode>11</StopOnExitCode>
               <CustomArgument></CustomArgument>
               <IncludeLibraryModules></IncludeLibraryModules>
+              <ComprImg>0</ComprImg>
             </CommonProperty>
             <GroupArmAds>
               <Cads>
@@ -1276,6 +1294,7 @@
           <SLE66AMisc></SLE66AMisc>
           <SLE66LinkerMisc></SLE66LinkerMisc>
           <SFDFile>SFD\Luminary\LM4F120H5QR.SFR</SFDFile>
+          <bCustSvd>0</bCustSvd>
           <UseEnv>0</UseEnv>
           <BinPath></BinPath>
           <IncludePath></IncludePath>
@@ -1343,6 +1362,7 @@
           <StopOnExitCode>3</StopOnExitCode>
           <CustomArgument></CustomArgument>
           <IncludeLibraryModules></IncludeLibraryModules>
+          <ComprImg>1</ComprImg>
         </CommonProperty>
         <DllOption>
           <SimDllName>SARMCM3.DLL</SimDllName>
@@ -1415,6 +1435,10 @@
           <Flash2>BIN\lmidk-agdi.dll</Flash2>
           <Flash3>"" ()</Flash3>
           <Flash4></Flash4>
+          <pFcarmOut></pFcarmOut>
+          <pFcarmGrp></pFcarmGrp>
+          <pFcArmRoot></pFcArmRoot>
+          <FcArmLst>0</FcArmLst>
         </Utilities>
         <TargetArmAds>
           <ArmAdsMisc>
@@ -1692,6 +1716,7 @@
               <StopOnExitCode>11</StopOnExitCode>
               <CustomArgument></CustomArgument>
               <IncludeLibraryModules></IncludeLibraryModules>
+              <ComprImg>0</ComprImg>
             </CommonProperty>
             <GroupArmAds>
               <Cads>
@@ -1758,6 +1783,7 @@
               <StopOnExitCode>11</StopOnExitCode>
               <CustomArgument></CustomArgument>
               <IncludeLibraryModules></IncludeLibraryModules>
+              <ComprImg>0</ComprImg>
             </CommonProperty>
             <GroupArmAds>
               <Cads>
@@ -1824,6 +1850,7 @@
               <StopOnExitCode>11</StopOnExitCode>
               <CustomArgument></CustomArgument>
               <IncludeLibraryModules></IncludeLibraryModules>
+              <ComprImg>0</ComprImg>
             </CommonProperty>
             <GroupArmAds>
               <Cads>

+ 57 - 9
examples/arm-cm/qk/arm_keil/dpp-qk_ek-tm4c123gxl/dpp.qm

@@ -1,6 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<model version="2.3.0">
- <documentation>Dining Philosopher Problem example</documentation>
+<model version="3.0.0">
+ <documentation>Dining Philosopher Problem example
+
+NOTE: Requries QP 5.</documentation>
  <framework name="qpc"/>
  <package name="Events" stereotype="0x01">
   <class name="TableEvt" superclass="qpc::QEvt">
@@ -8,7 +10,7 @@
   </class>
  </package>
  <package name="AOs" stereotype="0x02">
-  <class name="Philo" superclass="qpc::QActive">
+  <class name="Philo" superclass="qpc::QMActive">
    <attribute name="timeEvt" type="QTimeEvt" visibility="0x02" properties="0x00"/>
    <statechart>
     <initial target="../1">
@@ -42,7 +44,7 @@ QActive_subscribe(&amp;me-&gt;super, EAT_SIG);</action>
      </initial_glyph>
     </initial>
     <state name="thinking">
-     <entry>QTimeEvt_postIn(&amp;me-&gt;timeEvt, &amp;me-&gt;super, THINK_TIME);</entry>
+     <entry>QTimeEvt_armX(&amp;me-&gt;timeEvt, THINK_TIME, 0U);</entry>
      <tran trig="TIMEOUT" target="../../2">
       <tran_glyph conn="2,12,3,1,20,13,-3">
        <action box="0,-2,6,2"/>
@@ -86,7 +88,7 @@ Q_ASSERT(Q_EVT_CAST(TableEvt)-&gt;philoNum != PHILO_ID(me));</action>
      </state_glyph>
     </state>
     <state name="eating">
-     <entry>QTimeEvt_postIn(&amp;me-&gt;timeEvt, &amp;me-&gt;super, EAT_TIME);</entry>
+     <entry>QTimeEvt_armX(&amp;me-&gt;timeEvt, EAT_TIME, 0U);</entry>
      <exit>TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
 pe-&gt;philoNum = PHILO_ID(me);
 QF_PUBLISH(&amp;pe-&gt;super, me);</exit>
@@ -110,7 +112,7 @@ Q_ASSERT(Q_EVT_CAST(TableEvt)-&gt;philoNum != PHILO_ID(me));</action>
     <state_diagram size="37,61"/>
    </statechart>
   </class>
-  <class name="Table" superclass="qpc::QActive">
+  <class name="Table" superclass="qpc::QMActive">
    <attribute name="fork[N_PHILO]" type="uint8_t" visibility="0x02" properties="0x00"/>
    <attribute name="isHungry[N_PHILO]" type="uint8_t" visibility="0x02" properties="0x00"/>
    <statechart>
@@ -316,15 +318,15 @@ me-&gt;fork[n] = FREE;</action>
 Philo *me;
 for (n = 0U; n &lt; N_PHILO; ++n) {
     me = &amp;l_philo[n];
-    QActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Philo_initial));
-    QTimeEvt_ctor(&amp;me-&gt;timeEvt, TIMEOUT_SIG);
+    QMActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Philo_initial));
+    QTimeEvt_ctorX(&amp;me-&gt;timeEvt, &amp;me-&gt;super, TIMEOUT_SIG, 0U);
 }</code>
   </operation>
   <operation name="Table_ctor" type="void" visibility="0x00" properties="0x00">
    <code>uint8_t n;
 Table *me = &amp;l_table;
 
-QActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Table_initial));
+QMActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Table_initial));
 
 for (n = 0U; n &lt; N_PHILO; ++n) {
     me-&gt;fork[n] = FREE;
@@ -424,5 +426,51 @@ QActive * const AO_Table = &amp;l_table.super; /* &quot;opaque&quot; AO pointer
 $define(AOs::Table_ctor)
 $define(AOs::Table)</text>
   </file>
+  <file name="main.c">
+   <text>#include &quot;qp_port.h&quot;
+#include &quot;dpp.h&quot;
+#include &quot;bsp.h&quot;
+
+/*..........................................................................*/
+int main() {
+    static QEvt const *tableQueueSto[N_PHILO];
+    static QEvt const *philoQueueSto[N_PHILO][N_PHILO];
+    static QSubscrList subscrSto[MAX_PUB_SIG];
+    static QF_MPOOL_EL(TableEvt) smlPoolSto[2*N_PHILO];       /* small pool */
+    uint8_t n;
+
+    Philo_ctor();             /* instantiate all Philosopher active objects */
+    Table_ctor();                    /* instantiate the Table active object */
+
+    QF_init();     /* initialize the framework and the underlying RT kernel */
+    BSP_init();                     /* initialize the Board Support Package */
+
+                                                  /* object dictionaries... */
+    QS_OBJ_DICTIONARY(smlPoolSto);
+    QS_OBJ_DICTIONARY(tableQueueSto);
+    QS_OBJ_DICTIONARY(philoQueueSto[0]);
+    QS_OBJ_DICTIONARY(philoQueueSto[1]);
+    QS_OBJ_DICTIONARY(philoQueueSto[2]);
+    QS_OBJ_DICTIONARY(philoQueueSto[3]);
+    QS_OBJ_DICTIONARY(philoQueueSto[4]);
+
+    QF_psInit(subscrSto, Q_DIM(subscrSto));       /* init publish-subscribe */
+
+                                               /* initialize event pools... */
+    QF_poolInit(smlPoolSto, sizeof(smlPoolSto), sizeof(smlPoolSto[0]));
+
+    for (n = 0U; n &lt; N_PHILO; ++n) {         /* start the active objects... */
+        QACTIVE_START(AO_Philo[n], (uint8_t)(n + 1),
+                      philoQueueSto[n], Q_DIM(philoQueueSto[n]),
+                      (void *)0, 0U, (QEvt *)0);
+    }
+    QACTIVE_START(AO_Table, (uint8_t)(N_PHILO + 1),
+                  tableQueueSto, Q_DIM(tableQueueSto),
+                  (void *)0, 0U, (QEvt *)0);
+
+    return QF_run();                              /* run the QF application */
+}
+</text>
+  </file>
  </directory>
 </model>

+ 31 - 51
examples/arm-cm/qk/arm_keil/dpp-qk_ek-tm4c123gxl/main.c

@@ -1,81 +1,61 @@
 /*****************************************************************************
-* Product: DPP example
-* Last Updated for Version: 4.5.02
-* Date of the Last Update:  Jul 04, 2012
+* Model: dpp.qm
+* File:  ./main.c
 *
-*                    Q u a n t u m     L e a P s
-*                    ---------------------------
-*                    innovating embedded systems
-*
-* Copyright (C) 2002-2012 Quantum Leaps, LLC. All rights reserved.
+* This code has been generated by QM tool (see state-machine.com/qm).
+* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
 *
 * 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 3 of the License, or
-* (at your option) any later version.
-*
-* 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.
-*
-* 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/>.
+* by the Free Software Foundation.
 *
-* Contact information:
-* Quantum Leaps Web sites: http://www.quantum-leaps.com
-*                          http://www.state-machine.com
-* e-mail:                  info@quantum-leaps.com
+* 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.
 *****************************************************************************/
+/* @(/3/3) .................................................................*/
 #include "qp_port.h"
 #include "dpp.h"
 #include "bsp.h"
 
-/* Local-scope objects -----------------------------------------------------*/
-static QEvt const *l_tableQueueSto[N_PHILO];
-static QEvt const *l_philoQueueSto[N_PHILO][N_PHILO];
-static QSubscrList l_subscrSto[MAX_PUB_SIG];
-
-/* storage for event pools... */
-static QF_MPOOL_EL(TableEvt) l_smlPoolSto[2*N_PHILO];         /* small pool */
-
 /*..........................................................................*/
-int main(void) {
+int main() {
+    static QEvt const *tableQueueSto[N_PHILO];
+    static QEvt const *philoQueueSto[N_PHILO][N_PHILO];
+    static QSubscrList subscrSto[MAX_PUB_SIG];
+    static QF_MPOOL_EL(TableEvt) smlPoolSto[2*N_PHILO];       /* small pool */
     uint8_t n;
 
     Philo_ctor();             /* instantiate all Philosopher active objects */
     Table_ctor();                    /* instantiate the Table active object */
 
     QF_init();     /* initialize the framework and the underlying RT kernel */
-    BSP_init();                                       /* initialize the BSP */
+    BSP_init();                     /* initialize the Board Support Package */
 
                                                   /* object dictionaries... */
-    QS_OBJ_DICTIONARY(l_smlPoolSto);
-    QS_OBJ_DICTIONARY(l_tableQueueSto);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[0]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[1]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[2]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[3]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[4]);
+    QS_OBJ_DICTIONARY(smlPoolSto);
+    QS_OBJ_DICTIONARY(tableQueueSto);
+    QS_OBJ_DICTIONARY(philoQueueSto[0]);
+    QS_OBJ_DICTIONARY(philoQueueSto[1]);
+    QS_OBJ_DICTIONARY(philoQueueSto[2]);
+    QS_OBJ_DICTIONARY(philoQueueSto[3]);
+    QS_OBJ_DICTIONARY(philoQueueSto[4]);
 
-    QF_psInit(l_subscrSto, Q_DIM(l_subscrSto));   /* init publish-subscribe */
+    QF_psInit(subscrSto, Q_DIM(subscrSto));       /* init publish-subscribe */
 
                                                /* initialize event pools... */
-    QF_poolInit(l_smlPoolSto, sizeof(l_smlPoolSto), sizeof(l_smlPoolSto[0]));
+    QF_poolInit(smlPoolSto, sizeof(smlPoolSto), sizeof(smlPoolSto[0]));
 
-    for (n = 0; n < N_PHILO; ++n) {          /* start the active objects... */
-        QActive_start(AO_Philo[n], (uint8_t)(n + 1),
-                      l_philoQueueSto[n], Q_DIM(l_philoQueueSto[n]),
+    for (n = 0U; n < N_PHILO; ++n) {         /* start the active objects... */
+        QACTIVE_START(AO_Philo[n], (uint8_t)(n + 1),
+                      philoQueueSto[n], Q_DIM(philoQueueSto[n]),
                       (void *)0, 0U, (QEvt *)0);
     }
-    QActive_start(AO_Table, (uint8_t)(N_PHILO + 1),
-                  l_tableQueueSto, Q_DIM(l_tableQueueSto),
+    QACTIVE_START(AO_Table, (uint8_t)(N_PHILO + 1),
+                  tableQueueSto, Q_DIM(tableQueueSto),
                   (void *)0, 0U, (QEvt *)0);
 
     return QF_run();                              /* run the QF application */
 }
+

+ 73 - 45
examples/arm-cm/qk/arm_keil/dpp-qk_ek-tm4c123gxl/philo.c

@@ -25,7 +25,7 @@ Q_DEFINE_THIS_FILE
 /* @(/2/0) .................................................................*/
 typedef struct PhiloTag {
 /* protected: */
-    QActive super;
+    QMActive super;
 
 /* private: */
     QTimeEvt timeEvt;
@@ -33,9 +33,28 @@ typedef struct PhiloTag {
 
 /* protected: */
 static QState Philo_initial(Philo * const me, QEvt const * const e);
-static QState Philo_thinking(Philo * const me, QEvt const * const e);
-static QState Philo_hungry(Philo * const me, QEvt const * const e);
-static QState Philo_eating(Philo * const me, QEvt const * const e);
+static QState Philo_thinking  (Philo * const me, QEvt const * const e);
+static QState Philo_thinking_e(Philo * const me);
+static QMState const Philo_thinking_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Philo_thinking),
+    Q_ACTION_CAST(0)
+};
+static QState Philo_hungry  (Philo * const me, QEvt const * const e);
+static QState Philo_hungry_e(Philo * const me);
+static QMState const Philo_hungry_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Philo_hungry),
+    Q_ACTION_CAST(0)
+};
+static QState Philo_eating  (Philo * const me, QEvt const * const e);
+static QState Philo_eating_e(Philo * const me);
+static QState Philo_eating_x(Philo * const me);
+static QMState const Philo_eating_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Philo_eating),
+    Q_ACTION_CAST(&Philo_eating_x)
+};
 
 
 /* Local objects -----------------------------------------------------------*/
@@ -69,14 +88,18 @@ void Philo_ctor(void) {
     Philo *me;
     for (n = 0U; n < N_PHILO; ++n) {
         me = &l_philo[n];
-        QActive_ctor(&me->super, Q_STATE_CAST(&Philo_initial));
-        QTimeEvt_ctor(&me->timeEvt, TIMEOUT_SIG);
+        QMActive_ctor(&me->super, Q_STATE_CAST(&Philo_initial));
+        QTimeEvt_ctorX(&me->timeEvt, &me->super, TIMEOUT_SIG, 0U);
     }
 }
 /* @(/2/0) .................................................................*/
 /* @(/2/0/1) ...............................................................*/
 /* @(/2/0/1/0) */
 static QState Philo_initial(Philo * const me, QEvt const * const e) {
+    static QActionHandler const act_[] = {
+        Q_ACTION_CAST(&Philo_thinking_e),
+        Q_ACTION_CAST(0)
+    };
     static uint8_t registered = (uint8_t)0; /* starts off with 0, per C-standard */
     (void)e; /* suppress the compiler warning about unused parameter */
     if (registered == (uint8_t)0) {
@@ -102,21 +125,23 @@ static QState Philo_initial(Philo * const me, QEvt const * const e) {
     QS_SIG_DICTIONARY(TIMEOUT_SIG, me); /* signal for each Philos */
 
     QActive_subscribe(&me->super, EAT_SIG);
-    return Q_TRAN(&Philo_thinking);
+    return QM_INITIAL(&Philo_thinking_s, act_);
 }
 /* @(/2/0/1/1) .............................................................*/
+static QState Philo_thinking_e(Philo * const me) {
+    QTimeEvt_armX(&me->timeEvt, THINK_TIME, 0U);
+    return QM_ENTRY(&Philo_thinking_s);
+}
 static QState Philo_thinking(Philo * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/0/1/1) */
-        case Q_ENTRY_SIG: {
-            QTimeEvt_postIn(&me->timeEvt, &me->super, THINK_TIME);
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/0/1/1/0) */
         case TIMEOUT_SIG: {
-            status_ = Q_TRAN(&Philo_hungry);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Philo_hungry_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Philo_hungry_s, act_);
             break;
         }
         /* @(/2/0/1/1/1) */
@@ -124,36 +149,38 @@ static QState Philo_thinking(Philo * const me, QEvt const * const e) {
         case DONE_SIG: {
             /* EAT or DONE must be for other Philos than this one */
             Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/0/1/2) .............................................................*/
+static QState Philo_hungry_e(Philo * const me) {
+    TableEvt *pe = Q_NEW(TableEvt, HUNGRY_SIG);
+    pe->philoNum = PHILO_ID(me);
+    QACTIVE_POST(AO_Table, &pe->super, me);
+    return QM_ENTRY(&Philo_hungry_s);
+}
 static QState Philo_hungry(Philo * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/0/1/2) */
-        case Q_ENTRY_SIG: {
-            TableEvt *pe = Q_NEW(TableEvt, HUNGRY_SIG);
-            pe->philoNum = PHILO_ID(me);
-            QACTIVE_POST(AO_Table, &pe->super, me);
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/0/1/2/0) */
         case EAT_SIG: {
             /* @(/2/0/1/2/0/0) */
             if (Q_EVT_CAST(TableEvt)->philoNum == PHILO_ID(me)) {
-                status_ = Q_TRAN(&Philo_eating);
+                static QActionHandler const act_[] = {
+                    Q_ACTION_CAST(&Philo_eating_e),
+                    Q_ACTION_CAST(0)
+                };
+                status_ = QM_TRAN(&Philo_eating_s, act_);
             }
             else {
-                status_ = Q_UNHANDLED();
+                status_ = QM_UNHANDLED();
             }
             break;
         }
@@ -161,37 +188,38 @@ static QState Philo_hungry(Philo * const me, QEvt const * const e) {
         case DONE_SIG: {
             /* DONE must be for other Philos than this one */
             Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/0/1/3) .............................................................*/
+static QState Philo_eating_e(Philo * const me) {
+    QTimeEvt_armX(&me->timeEvt, EAT_TIME, 0U);
+    return QM_ENTRY(&Philo_eating_s);
+}
+static QState Philo_eating_x(Philo * const me) {
+    TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
+    pe->philoNum = PHILO_ID(me);
+    QF_PUBLISH(&pe->super, me);
+    return QM_EXIT(&Philo_eating_s);
+}
 static QState Philo_eating(Philo * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/0/1/3) */
-        case Q_ENTRY_SIG: {
-            QTimeEvt_postIn(&me->timeEvt, &me->super, EAT_TIME);
-            status_ = Q_HANDLED();
-            break;
-        }
-        /* @(/2/0/1/3) */
-        case Q_EXIT_SIG: {
-            TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
-            pe->philoNum = PHILO_ID(me);
-            QF_PUBLISH(&pe->super, me);
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/0/1/3/0) */
         case TIMEOUT_SIG: {
-            status_ = Q_TRAN(&Philo_thinking);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Philo_eating_x),
+                Q_ACTION_CAST(&Philo_thinking_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Philo_thinking_s, act_);
             break;
         }
         /* @(/2/0/1/3/1) */
@@ -199,11 +227,11 @@ static QState Philo_eating(Philo * const me, QEvt const * const e) {
         case DONE_SIG: {
             /* EAT or DONE must be for other Philos than this one */
             Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }

+ 1 - 1
examples/arm-cm/qk/arm_keil/dpp-qk_ek-tm4c123gxl/startup-qk_tm4c.s

@@ -49,7 +49,7 @@ Heap    EQU     0x00000000
 ; Allocate space for the stack.
 ;
 ;******************************************************************************
-        AREA    STACK, NOINIT, READWRITE, ALIGN=3
+        AREA    STACK, READWRITE, ALIGN=3
 StackMem
         SPACE   Stack
 __initial_sp

+ 78 - 53
examples/arm-cm/qk/arm_keil/dpp-qk_ek-tm4c123gxl/table.c

@@ -25,7 +25,7 @@ Q_DEFINE_THIS_FILE
 /* @(/2/1) .................................................................*/
 typedef struct TableTag {
 /* protected: */
-    QActive super;
+    QMActive super;
 
 /* private: */
     uint8_t fork[N_PHILO];
@@ -34,9 +34,27 @@ typedef struct TableTag {
 
 /* protected: */
 static QState Table_initial(Table * const me, QEvt const * const e);
-static QState Table_active(Table * const me, QEvt const * const e);
-static QState Table_serving(Table * const me, QEvt const * const e);
-static QState Table_paused(Table * const me, QEvt const * const e);
+static QState Table_active  (Table * const me, QEvt const * const e);
+static QMState const Table_active_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Table_active),
+    Q_ACTION_CAST(0)
+};
+static QState Table_serving  (Table * const me, QEvt const * const e);
+static QState Table_serving_e(Table * const me);
+static QMState const Table_serving_s = {
+    &Table_active_s,
+    Q_STATE_CAST(&Table_serving),
+    Q_ACTION_CAST(0)
+};
+static QState Table_paused  (Table * const me, QEvt const * const e);
+static QState Table_paused_e(Table * const me);
+static QState Table_paused_x(Table * const me);
+static QMState const Table_paused_s = {
+    &Table_active_s,
+    Q_STATE_CAST(&Table_paused),
+    Q_ACTION_CAST(&Table_paused_x)
+};
 
 
 #define RIGHT(n_) ((uint8_t)(((n_) + (N_PHILO - 1U)) % N_PHILO))
@@ -56,7 +74,7 @@ void Table_ctor(void) {
     uint8_t n;
     Table *me = &l_table;
 
-    QActive_ctor(&me->super, Q_STATE_CAST(&Table_initial));
+    QMActive_ctor(&me->super, Q_STATE_CAST(&Table_initial));
 
     for (n = 0U; n < N_PHILO; ++n) {
         me->fork[n] = FREE;
@@ -67,6 +85,10 @@ void Table_ctor(void) {
 /* @(/2/1/2) ...............................................................*/
 /* @(/2/1/2/0) */
 static QState Table_initial(Table * const me, QEvt const * const e) {
+    static QActionHandler const act_[] = {
+        Q_ACTION_CAST(&Table_serving_e),
+        Q_ACTION_CAST(0)
+    };
     uint8_t n;
     (void)e; /* suppress the compiler warning about unused parameter */
 
@@ -91,7 +113,7 @@ static QState Table_initial(Table * const me, QEvt const * const e) {
         me->isHungry[n] = 0U;
         BSP_displayPhilStat(n, "thinking");
     }
-    return Q_TRAN(&Table_serving);
+    return QM_INITIAL(&Table_serving_s, act_);
 }
 /* @(/2/1/2/1) .............................................................*/
 static QState Table_active(Table * const me, QEvt const * const e) {
@@ -100,48 +122,46 @@ static QState Table_active(Table * const me, QEvt const * const e) {
         /* @(/2/1/2/1/0) */
         case TERMINATE_SIG: {
             BSP_terminate(0);
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/1) */
         case EAT_SIG: {
             Q_ERROR();
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/1/2/1/2) ...........................................................*/
+static QState Table_serving_e(Table * const me) {
+    uint8_t n;
+    for (n = 0U; n < N_PHILO; ++n) { /* give permissions to eat... */
+        if ((me->isHungry[n] != 0U)
+            && (me->fork[LEFT(n)] == FREE)
+            && (me->fork[n] == FREE))
+        {
+            TableEvt *te;
+
+            me->fork[LEFT(n)] = USED;
+            me->fork[n] = USED;
+            te = Q_NEW(TableEvt, EAT_SIG);
+            te->philoNum = n;
+            QF_PUBLISH(&te->super, me);
+            me->isHungry[n] = 0U;
+            BSP_displayPhilStat(n, "eating  ");
+        }
+    }
+    return QM_ENTRY(&Table_serving_s);
+}
 static QState Table_serving(Table * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/1/2/1/2) */
-        case Q_ENTRY_SIG: {
-            uint8_t n;
-            for (n = 0U; n < N_PHILO; ++n) { /* give permissions to eat... */
-                if ((me->isHungry[n] != 0U)
-                    && (me->fork[LEFT(n)] == FREE)
-                    && (me->fork[n] == FREE))
-                {
-                    TableEvt *te;
-
-                    me->fork[LEFT(n)] = USED;
-                    me->fork[n] = USED;
-                    te = Q_NEW(TableEvt, EAT_SIG);
-                    te->philoNum = n;
-                    QF_PUBLISH(&te->super, me);
-                    me->isHungry[n] = 0U;
-                    BSP_displayPhilStat(n, "eating  ");
-                }
-            }
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/1/2/1/2/0) */
         case HUNGRY_SIG: {
             uint8_t n, m;
@@ -161,12 +181,12 @@ static QState Table_serving(Table * const me, QEvt const * const e) {
                 pe->philoNum = n;
                 QF_PUBLISH(&pe->super, me);
                 BSP_displayPhilStat(n, "eating  ");
-                status_ = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             /* @(/2/1/2/1/2/0/1) */
             else {
                 me->isHungry[n] = 1U;
-                status_ = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             break;
         }
@@ -208,46 +228,51 @@ static QState Table_serving(Table * const me, QEvt const * const e) {
                 QF_PUBLISH(&pe->super, me);
                 BSP_displayPhilStat(m, "eating  ");
             }
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/2/2) */
         case EAT_SIG: {
             Q_ERROR();
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/2/3) */
         case PAUSE_SIG: {
-            status_ = Q_TRAN(&Table_paused);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Table_paused_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Table_paused_s, act_);
             break;
         }
         default: {
-            status_ = Q_SUPER(&Table_active);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/1/2/1/3) ...........................................................*/
+static QState Table_paused_e(Table * const me) {
+    BSP_displayPaused(1U);
+    return QM_ENTRY(&Table_paused_s);
+}
+static QState Table_paused_x(Table * const me) {
+    BSP_displayPaused(0U);
+    return QM_EXIT(&Table_paused_s);
+}
 static QState Table_paused(Table * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/1/2/1/3) */
-        case Q_ENTRY_SIG: {
-            BSP_displayPaused(1U);
-            status_ = Q_HANDLED();
-            break;
-        }
-        /* @(/2/1/2/1/3) */
-        case Q_EXIT_SIG: {
-            BSP_displayPaused(0U);
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/1/2/1/3/0) */
         case PAUSE_SIG: {
-            status_ = Q_TRAN(&Table_serving);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Table_paused_x),
+                Q_ACTION_CAST(&Table_serving_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Table_serving_s, act_);
             break;
         }
         /* @(/2/1/2/1/3/1) */
@@ -257,7 +282,7 @@ static QState Table_paused(Table * const me, QEvt const * const e) {
             Q_ASSERT((n < N_PHILO) && (me->isHungry[n] == 0U));
             me->isHungry[n] = 1U;
             BSP_displayPhilStat(n, "hungry  ");
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/3/2) */
@@ -275,11 +300,11 @@ static QState Table_paused(Table * const me, QEvt const * const e) {
 
             me->fork[m] = FREE;
             me->fork[n] = FREE;
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status_ = Q_SUPER(&Table_active);
+            status_ = QM_SUPER();
             break;
         }
     }

+ 0 - 58
examples/arm-cm/qk/arm_keil/game-qk_ek-lm3s811/.game

@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<session version="2.3.2">
- <item name="license"></item>
- <group name="locked"/>
- <group name="settings">
-  <item name="tabs">1</item>
-  <item name="windows">0</item>
-  <item name="grid">3</item>
- </group>
- <group name="windows"/>
- <group name="search">
-  <item name="options">4129280</item>
-  <item name="replace">0</item>
- </group>
- <group name="vars"/>
- <group name="tools">
-  <group name="tool">
-   <item name="icon">0</item>
-   <item name="title"></item>
-   <item name="command"></item>
-   <item name="args"></item>
-   <item name="initial"></item>
-   <item name="options">0</item>
-  </group>
-  <group name="tool">
-   <item name="icon">0</item>
-   <item name="title"></item>
-   <item name="command"></item>
-   <item name="args"></item>
-   <item name="initial"></item>
-   <item name="options">0</item>
-  </group>
-  <group name="tool">
-   <item name="icon">0</item>
-   <item name="title"></item>
-   <item name="command"></item>
-   <item name="args"></item>
-   <item name="initial"></item>
-   <item name="options">0</item>
-  </group>
-  <group name="tool">
-   <item name="icon">0</item>
-   <item name="title"></item>
-   <item name="command"></item>
-   <item name="args"></item>
-   <item name="initial"></item>
-   <item name="options">0</item>
-  </group>
-  <group name="tool">
-   <item name="icon">0</item>
-   <item name="title"></item>
-   <item name="command"></item>
-   <item name="args"></item>
-   <item name="initial"></item>
-   <item name="options">0</item>
-  </group>
- </group>
-</session>

+ 9 - 13
examples/arm-cm/qk/arm_keil/game-qk_ek-lm3s811/bsp.c

@@ -1,7 +1,7 @@
 /*****************************************************************************
 * Product: "Fly 'n' Shoot" game example, preemptive QK kernel
-* Last Updated for Version: 5.1.0
-* Date of the Last Update:  Sep 19, 2013
+* Last Updated for Version: 5.2.0
+* Date of the Last Update:  Dec 25, 2013
 *
 *                    Q u a n t u m     L e a P s
 *                    ---------------------------
@@ -110,7 +110,7 @@ void SysTick_Handler(void) {
     }
 #endif
 
-    QF_TICK(&l_SysTick_Handler);           /* process all armed time events */
+    QF_TICK_X(0U, &l_SysTick_Handler);    /* process time events for rate 0 */
     QF_PUBLISH(&tickEvt, &l_SysTick_Handler); /* publish to all subscribers */
 
     QK_ISR_EXIT();                        /* infrom QK about exiting an ISR */
@@ -338,18 +338,16 @@ void QK_onIdle(void) {
 }
 
 /*..........................................................................*/
-void Q_onAssert(char const Q_ROM * const Q_ROM_VAR file, int line) {
-    (void)file;                                   /* avoid compiler warning */
-    (void)line;                                   /* avoid compiler warning */
-    QF_INT_DISABLE();         /* make sure that all interrupts are disabled */
-    QS_ASSERTION(file, line);
-    for (;;) {       /* NOTE: replace the loop with reset for final version */
-    }
+void Q_onAssert(char const Q_ROM * const file, int_t line) {
+    assert_failed(file, line);
 }
 /*..........................................................................*/
 /* error routine that is called if the CMSIS library encounters an error    */
 void assert_failed(char const *file, int line) {
-    Q_onAssert(file, line);
+    (void)file;                                   /* avoid compiler warning */
+    (void)line;                                   /* avoid compiler warning */
+    QF_INT_DISABLE();         /* make sure that all interrupts are disabled */
+    NVIC_SystemReset();                             /* perform system reset */
 }
 
 /*--------------------------------------------------------------------------*/
@@ -435,8 +433,6 @@ uint8_t QS_onStartup(void const *arg) {
     QS_FILTER_OFF(QS_QF_ISR_ENTRY);
     QS_FILTER_OFF(QS_QF_ISR_EXIT);
 
-    QS_RESET();
-
     return (uint8_t)1;                                    /* return success */
 }
 /*..........................................................................*/

+ 8 - 8
examples/arm-cm/qk/arm_keil/game-qk_ek-lm3s811/game.h

@@ -114,22 +114,22 @@ enum GameBitmapIds {
 };
 
 /* active objects' "constructors" */
-/* @(/2/9) .................................................................*/
+/* @(/2/8) .................................................................*/
 void Tunnel_ctor(void);
 
-/* @(/2/10) ................................................................*/
+/* @(/2/9) .................................................................*/
 void Ship_ctor(void);
 
-/* @(/2/11) ................................................................*/
+/* @(/2/10) ................................................................*/
 void Missile_ctor(void);
 
 
 /* instantiation of the Mines orthogonal components */
-/* @(/2/12) ................................................................*/
-QHsm * Mine1_ctor(uint8_t id);
+/* @(/2/11) ................................................................*/
+QMsm * Mine1_ctor(uint8_t id);
 
-/* @(/2/13) ................................................................*/
-QHsm * Mine2_ctor(uint8_t id);
+/* @(/2/12) ................................................................*/
+QMsm * Mine2_ctor(uint8_t id);
 
 
 /* opaque pointers to active objects in the application */
@@ -141,7 +141,7 @@ extern QActive * const AO_Missile;
 
 
 /* helper function for all AOs */
-/* @(/2/8) .................................................................*/
+/* @(/2/13) ................................................................*/
 uint8_t do_bitmaps_overlap(
     uint8_t bmp_id1,
     uint8_t x1,

+ 54 - 57
examples/arm-cm/qk/arm_keil/game-qk_ek-lm3s811/game.qm

@@ -1,6 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<model version="2.3.2">
- <documentation>&quot;Fly 'n' Shoot&quot; game model from Chapters 1 &amp; 9 of PSiCC2</documentation>
+<model version="3.0.0">
+ <documentation>&quot;Fly 'n' Shoot&quot; game model from Chapters 1 &amp; 9 of PSiCC2
+
+NOTE: Requries QP 5.</documentation>
  <framework name="qpc"/>
  <package name="Events" stereotype="0x01">
   <class name="ObjectPosEvt" superclass="qpc::QEvt">
@@ -20,13 +22,13 @@
   </class>
  </package>
  <package name="AOs" stereotype="0x02">
-  <class name="Tunnel" superclass="qpc::QActive">
+  <class name="Tunnel" superclass="qpc::QMActive">
    <documentation>Tunnel Active Object</documentation>
    <attribute name="blinkTimeEvt" type="QTimeEvt" visibility="0x02" properties="0x00"/>
    <attribute name="screenTimeEvt" type="QTimeEvt" visibility="0x02" properties="0x00"/>
-   <attribute name="mines[GAME_MINES_MAX]" type="QHsm *" visibility="0x02" properties="0x00"/>
-   <attribute name="mine1_pool[GAME_MINES_MAX]" type="QHsm *" visibility="0x02" properties="0x00"/>
-   <attribute name="mine2_pool[GAME_MINES_MAX]" type="QHsm *" visibility="0x02" properties="0x00"/>
+   <attribute name="mines[GAME_MINES_MAX]" type="QMsm *" visibility="0x02" properties="0x00"/>
+   <attribute name="mine1_pool[GAME_MINES_MAX]" type="QMsm *" visibility="0x02" properties="0x00"/>
+   <attribute name="mine2_pool[GAME_MINES_MAX]" type="QMsm *" visibility="0x02" properties="0x00"/>
    <attribute name="blink_ctr" type="uint8_t" visibility="0x02" properties="0x00"/>
    <attribute name="last_mine_x" type="uint8_t" visibility="0x02" properties="0x00"/>
    <attribute name="last_mine_y" type="uint8_t" visibility="0x02" properties="0x00"/>
@@ -100,7 +102,7 @@ if ((me-&gt;last_mine_x + GAME_MINES_DIST_MIN &lt; GAME_SCREEN_WIDTH)
 {
     uint8_t n;
     for (n = 0U; n &lt; Q_DIM(me-&gt;mines); ++n) { /*look for disabled mines */
-        if (me-&gt;mines[n] == (QHsm *)0) {
+        if (me-&gt;mines[n] == (QMsm *)0) {
             break;
         }
     }
@@ -127,7 +129,7 @@ if ((me-&gt;last_mine_x + GAME_MINES_DIST_MIN &lt; GAME_SCREEN_WIDTH)
         ope.super.sig = MINE_PLANT_SIG;
         ope.x = me-&gt;last_mine_x;
         ope.y = me-&gt;last_mine_y;
-        QHsm_dispatch(me-&gt;mines[n], (QEvt *)&amp;ope); /* direct dispatch */
+        QMSM_DISPATCH(me-&gt;mines[n], (QEvt *)&amp;ope); /* direct dispatch */
     }
 }
 </code>
@@ -163,8 +165,8 @@ for (x = 0U; x &lt; w; ++x) {
     <code>uint8_t n;
 
 for (n = 0U; n &lt; GAME_MINES_MAX; ++n) {
-    if (me-&gt;mines[n] != (QHsm *)0) { /* is the mine used? */
-        QHsm_dispatch(me-&gt;mines[n], e);
+    if (me-&gt;mines[n] != (QMsm *)0) { /* is the mine used? */
+        QMSM_DISPATCH(me-&gt;mines[n], e);
     }
 }</code>
    </operation>
@@ -197,8 +199,8 @@ return (uint8_t)0;</code>
     <initial target="../1/2">
      <action>uint8_t n;
 for (n = 0U; n &lt; GAME_MINES_MAX; ++n) {
-    QHsm_init(me-&gt;mine1_pool[n], (QEvt *)0);/*initial tran. for Mine1 */
-    QHsm_init(me-&gt;mine2_pool[n], (QEvt *)0);/*initial tran. for Mine2 */
+    QMSM_INIT(me-&gt;mine1_pool[n], (QEvt *)0);/*initial tran. for Mine1 */
+    QMSM_INIT(me-&gt;mine2_pool[n], (QEvt *)0);/*initial tran. for Mine2 */
 }
 randomSeed(1234); /* seed the pseudo-random generator */
 
@@ -241,8 +243,8 @@ QS_SIG_DICTIONARY(SCORE_SIG,          &amp;l_tunnel);
     <state name="active">
      <tran trig="MINE_DISABLED">
       <action>Q_ASSERT((Q_EVT_CAST(MineEvt)-&gt;id &lt; GAME_MINES_MAX)
-         &amp;&amp; (me-&gt;mines[Q_EVT_CAST(MineEvt)-&gt;id] != (QHsm *)0));
-me-&gt;mines[Q_EVT_CAST(MineEvt)-&gt;id] = (QHsm *)0;</action>
+         &amp;&amp; (me-&gt;mines[Q_EVT_CAST(MineEvt)-&gt;id] != (QMsm *)0));
+me-&gt;mines[Q_EVT_CAST(MineEvt)-&gt;id] = (QMsm *)0;</action>
       <tran_glyph conn="2,9,3,-1,14">
        <action box="0,-2,14,2"/>
       </tran_glyph>
@@ -253,10 +255,9 @@ me-&gt;mines[Q_EVT_CAST(MineEvt)-&gt;id] = (QHsm *)0;</action>
       </tran_glyph>
      </tran>
      <state name="show_logo">
-      <entry>QTimeEvt_postEvery(&amp;me-&gt;blinkTimeEvt, (QActive *)me,
-                   BSP_TICKS_PER_SEC/2U); /* 1/2 sec */
-QTimeEvt_postIn(&amp;me-&gt;screenTimeEvt, (QActive *)me,
-                BSP_TICKS_PER_SEC*5U); /* 5 sec timeout */
+      <entry>QTimeEvt_armX(&amp;me-&gt;blinkTimeEvt, BSP_TICKS_PER_SEC/2U,
+              BSP_TICKS_PER_SEC/2U);
+QTimeEvt_armX(&amp;me-&gt;screenTimeEvt, BSP_TICKS_PER_SEC*5U, 0U);
 me-&gt;blink_ctr = 0U;
 BSP_drawNString(0U, 0U, &quot; Quantum  LeAps &quot;);
 BSP_drawNString(0U, 1U, &quot;state-machine.co&quot;);</entry>
@@ -306,10 +307,9 @@ me-&gt;minimal_gap = GAME_SCREEN_HEIGHT - 3U;
 memset(l_walls, (uint8_t)0,
       (GAME_SCREEN_WIDTH * GAME_SCREEN_HEIGHT/8U));
 
-QTimeEvt_postEvery(&amp;me-&gt;blinkTimeEvt, (QActive *)me,
-                   BSP_TICKS_PER_SEC/2U); /* every 1/2 sec */
-QTimeEvt_postIn(&amp;me-&gt;screenTimeEvt, (QActive *)me,
-                BSP_TICKS_PER_SEC*20U); /* 20s timeout */
+QTimeEvt_armX(&amp;me-&gt;blinkTimeEvt,  BSP_TICKS_PER_SEC/2U,
+              BSP_TICKS_PER_SEC/2U);
+QTimeEvt_armX(&amp;me-&gt;screenTimeEvt, BSP_TICKS_PER_SEC*20U, 0U);
 
 me-&gt;blink_ctr = 0U; /* init the blink counter */</entry>
       <exit>QTimeEvt_disarm(&amp;me-&gt;blinkTimeEvt);
@@ -457,10 +457,9 @@ BSP_drawNString((GAME_SCREEN_WIDTH - 6U*10U)/2U + 6U*6U, 1U, str);</action>
       </state_glyph>
      </state>
      <state name="game_over">
-      <entry>QTimeEvt_postEvery(&amp;me-&gt;blinkTimeEvt, (QActive *)me,
-                   BSP_TICKS_PER_SEC/2U); /* 1/2 sec */
-QTimeEvt_postIn(&amp;me-&gt;screenTimeEvt, (QActive *)me,
-                BSP_TICKS_PER_SEC*5U); /* 5 sec timeout */
+      <entry>QTimeEvt_armX(&amp;me-&gt;blinkTimeEvt, BSP_TICKS_PER_SEC/2U,
+              BSP_TICKS_PER_SEC/2U);
+QTimeEvt_armX(&amp;me-&gt;screenTimeEvt, BSP_TICKS_PER_SEC*5U, 0U);
 me-&gt;blink_ctr = 0U;
 BSP_drawNString((GAME_SCREEN_WIDTH - 6U*9U)/2U, 0U, &quot;Game Over&quot;);</entry>
       <exit>QTimeEvt_disarm(&amp;me-&gt;blinkTimeEvt);
@@ -499,8 +498,7 @@ BSP_drawNString((GAME_SCREEN_WIDTH - 6U*9U)/2, 0U,
       </tran>
       <state name="screen_saver_hide">
        <entry>BSP_displayOff(); /* power down the display */
-QTimeEvt_postIn(&amp;me-&gt;screenTimeEvt, (QActive *)me,
-                BSP_TICKS_PER_SEC*3U); /* 3s timeout */</entry>
+QTimeEvt_armX(&amp;me-&gt;screenTimeEvt, BSP_TICKS_PER_SEC*3U, 0U);</entry>
        <exit>QTimeEvt_disarm(&amp;me-&gt;screenTimeEvt);
 BSP_displayOn(); /* power up the display */</exit>
        <tran trig="SCREEN_TIMEOUT" target="../../3">
@@ -523,8 +521,7 @@ Tunnel_addImageAt(me,
         (uint8_t)(rnd % (GAME_SCREEN_WIDTH - 55U)),
         (int8_t) (rnd % (GAME_SCREEN_HEIGHT - 8U)));
 BSP_drawBitmap(l_frame);
-QTimeEvt_postIn(&amp;me-&gt;screenTimeEvt, (QActive *)me,
-                BSP_TICKS_PER_SEC/3U); /* 1/3 sec timeout */</entry>
+QTimeEvt_armX(&amp;me-&gt;screenTimeEvt, BSP_TICKS_PER_SEC/2U, 0U);</entry>
        <exit>QTimeEvt_disarm(&amp;me-&gt;screenTimeEvt);
 /* clear the screen frame buffer */
 memset(l_frame, (uint8_t)0,
@@ -557,7 +554,7 @@ QF_stop(); /* stop QF and cleanup */</entry>
     <state_diagram size="68,94"/>
    </statechart>
   </class>
-  <class name="Ship" superclass="qpc::QActive">
+  <class name="Ship" superclass="qpc::QMActive">
    <documentation>Ship Active Object</documentation>
    <attribute name="x" type="uint8_t" visibility="0x02" properties="0x00"/>
    <attribute name="y" type="uint8_t" visibility="0x02" properties="0x00"/>
@@ -701,7 +698,7 @@ QACTIVE_POST(AO_Tunnel, (QEvt *)gameOver, me);</action>
     <state_diagram size="41,67"/>
    </statechart>
   </class>
-  <class name="Missile" superclass="qpc::QActive">
+  <class name="Missile" superclass="qpc::QMActive">
    <documentation>Missile Active Object</documentation>
    <attribute name="x" type="uint8_t" visibility="0x02" properties="0x00"/>
    <attribute name="y" type="uint8_t" visibility="0x02" properties="0x00"/>
@@ -811,7 +808,7 @@ QACTIVE_POST(AO_Tunnel, (QEvt *)oie, me);</action>
     <state_diagram size="46,55"/>
    </statechart>
   </class>
-  <class name="Mine1" superclass="qpc::QHsm">
+  <class name="Mine1" superclass="qpc::QMsm">
    <documentation>The Mine1 orthogonal component</documentation>
    <attribute name="x" type="uint8_t" visibility="0x02" properties="0x00"/>
    <attribute name="y" type="uint8_t" visibility="0x02" properties="0x00"/>
@@ -975,7 +972,7 @@ QACTIVE_POST(AO_Missile, (QEvt *)&amp;mine1_destroyed, me);</action>
     <state_diagram size="53,68"/>
    </statechart>
   </class>
-  <class name="Mine2" superclass="qpc::QHsm">
+  <class name="Mine2" superclass="qpc::QMsm">
    <documentation>The Mine2 orthogonal component</documentation>
    <attribute name="x" type="uint8_t" visibility="0x02" properties="0x00"/>
    <attribute name="y" type="uint8_t" visibility="0x02" properties="0x00"/>
@@ -1150,55 +1147,55 @@ QACTIVE_POST(AO_Tunnel, (QEvt *)oie, me);</action>
   <attribute name="AO_Tunnel" type="QActive * const" visibility="0x00" properties="0x00"/>
   <attribute name="AO_Ship" type="QActive * const" visibility="0x00" properties="0x00"/>
   <attribute name="AO_Missile" type="QActive * const" visibility="0x00" properties="0x00"/>
-  <operation name="do_bitmaps_overlap" type="uint8_t" visibility="0x00" properties="0x00">
-   <parameter name="bmp_id1" type="uint8_t"/>
-   <parameter name="x1" type="uint8_t"/>
-   <parameter name="y1" type="uint8_t"/>
-   <parameter name="bmp_id2" type="uint8_t"/>
-   <parameter name="x2" type="uint8_t"/>
-   <parameter name="y2" type="uint8_t"/>
-  </operation>
   <operation name="Tunnel_ctor" type="void" visibility="0x00" properties="0x01">
    <code>uint8_t n;
 Tunnel *me = &amp;l_tunnel;
-QActive_ctor(&amp;me-&gt;super, (QStateHandler)&amp;Tunnel_initial);
-QTimeEvt_ctor(&amp;me-&gt;blinkTimeEvt,  BLINK_TIMEOUT_SIG);
-QTimeEvt_ctor(&amp;me-&gt;screenTimeEvt, SCREEN_TIMEOUT_SIG);
+QMActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Tunnel_initial));
+QTimeEvt_ctorX(&amp;me-&gt;blinkTimeEvt,  &amp;me-&gt;super, BLINK_TIMEOUT_SIG,  0U);
+QTimeEvt_ctorX(&amp;me-&gt;screenTimeEvt, &amp;me-&gt;super, SCREEN_TIMEOUT_SIG, 0U);
 for (n = 0; n &lt; GAME_MINES_MAX; ++n) {
     me-&gt;mine1_pool[n] = Mine1_ctor(n); /* instantiate Mine1 in the pool */
     me-&gt;mine2_pool[n] = Mine2_ctor(n); /* instantiate Mine2 in the pool */
-    me-&gt;mines[n] = (QHsm *)0; /* mine 'n' is unused */
+    me-&gt;mines[n] = (QMsm *)0; /* mine 'n' is unused */
 }
 me-&gt;last_mine_x = 0; /* the last mine at the right edge of the tunnel */
 me-&gt;last_mine_y = 0;</code>
   </operation>
   <operation name="Ship_ctor" type="void" visibility="0x00" properties="0x01">
    <code>Ship *me = &amp;l_ship;
-QActive_ctor(&amp;me-&gt;super, (QStateHandler)&amp;Ship_initial);
+QMActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Ship_initial));
 me-&gt;x = GAME_SHIP_X;
 me-&gt;y = GAME_SHIP_Y;</code>
   </operation>
   <operation name="Missile_ctor" type="void" visibility="0x00" properties="0x01">
    <code>Missile *me = &amp;l_missile;
-QActive_ctor(&amp;me-&gt;super, (QStateHandler)&amp;Missile_initial);</code>
+QMActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Missile_initial));</code>
   </operation>
-  <operation name="Mine1_ctor" type="QHsm *" visibility="0x00" properties="0x01">
+  <operation name="Mine1_ctor" type="QMsm *" visibility="0x00" properties="0x01">
    <parameter name="id" type="uint8_t"/>
    <code>Mine1 *me;
 Q_REQUIRE(id &lt; GAME_MINES_MAX);
 me = &amp;l_mine1[id];
 /* superclass' ctor */
-QHsm_ctor(&amp;me-&gt;super, (QStateHandler)&amp;Mine1_initial);
-return (QHsm *)me;</code>
+QMsm_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Mine1_initial));
+return (QMsm *)me;</code>
   </operation>
-  <operation name="Mine2_ctor" type="QHsm *" visibility="0x00" properties="0x01">
+  <operation name="Mine2_ctor" type="QMsm *" visibility="0x00" properties="0x01">
    <parameter name="id" type="uint8_t"/>
    <code>Mine2 *me;
 Q_REQUIRE(id &lt; GAME_MINES_MAX);
 me = &amp;l_mine2[id];
 /* superclass' ctor */
-QHsm_ctor(&amp;me-&gt;super, (QStateHandler)&amp;Mine2_initial);
-return (QHsm *)me;</code>
+QMsm_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Mine2_initial));
+return (QMsm *)me;</code>
+  </operation>
+  <operation name="do_bitmaps_overlap" type="uint8_t" visibility="0x00" properties="0x00">
+   <parameter name="bmp_id1" type="uint8_t"/>
+   <parameter name="x1" type="uint8_t"/>
+   <parameter name="y1" type="uint8_t"/>
+   <parameter name="bmp_id2" type="uint8_t"/>
+   <parameter name="x2" type="uint8_t"/>
+   <parameter name="y2" type="uint8_t"/>
   </operation>
  </package>
  <directory name=".">
@@ -1658,17 +1655,17 @@ int main() {
     QS_SIG_DICTIONARY(GAME_OVER_SIG,      (void *)0);
 
                                              /* start the active objects... */
-    QActive_start(AO_Missile,
+    QACTIVE_START(AO_Missile,
                   1U,                                           /* priority */
                   l_missileQueueSto, Q_DIM(l_missileQueueSto), /* evt queue */
                   (void *)0, 0U,                     /* no per-thread stack */
                   (QEvt *)0);                    /* no initialization event */
-    QActive_start(AO_Ship,
+    QACTIVE_START(AO_Ship,
                   2U,                                           /* priority */
                   l_shipQueueSto,    Q_DIM(l_shipQueueSto),    /* evt queue */
                   (void *)0, 0U,                     /* no per-thread stack */
                   (QEvt *)0);                    /* no initialization event */
-    QActive_start(AO_Tunnel,
+    QACTIVE_START(AO_Tunnel,
                   3U,                                           /* priority */
                   l_tunnelQueueSto,  Q_DIM(l_tunnelQueueSto),  /* evt queue */
                   (void *)0, 0U,                     /* no per-thread stack */

+ 3 - 3
examples/arm-cm/qk/arm_keil/game-qk_ek-lm3s811/main.c

@@ -62,17 +62,17 @@ int main() {
     QS_SIG_DICTIONARY(GAME_OVER_SIG,      (void *)0);
 
                                              /* start the active objects... */
-    QActive_start(AO_Missile,
+    QACTIVE_START(AO_Missile,
                   1U,                                           /* priority */
                   l_missileQueueSto, Q_DIM(l_missileQueueSto), /* evt queue */
                   (void *)0, 0U,                     /* no per-thread stack */
                   (QEvt *)0);                    /* no initialization event */
-    QActive_start(AO_Ship,
+    QACTIVE_START(AO_Ship,
                   2U,                                           /* priority */
                   l_shipQueueSto,    Q_DIM(l_shipQueueSto),    /* evt queue */
                   (void *)0, 0U,                     /* no per-thread stack */
                   (QEvt *)0);                    /* no initialization event */
-    QActive_start(AO_Tunnel,
+    QACTIVE_START(AO_Tunnel,
                   3U,                                           /* priority */
                   l_tunnelQueueSto,  Q_DIM(l_tunnelQueueSto),  /* evt queue */
                   (void *)0, 0U,                     /* no per-thread stack */

+ 77 - 39
examples/arm-cm/qk/arm_keil/game-qk_ek-lm3s811/mine1.c

@@ -25,7 +25,7 @@ Q_DEFINE_THIS_FILE
 /* @(/2/3) .................................................................*/
 typedef struct Mine1Tag {
 /* protected: */
-    QHsm super;
+    QMsm super;
 
 /* private: */
     uint8_t x;
@@ -37,10 +37,32 @@ typedef struct Mine1Tag {
 
 /* protected: */
 static QState Mine1_initial(Mine1 * const me, QEvt const * const e);
-static QState Mine1_unused(Mine1 * const me, QEvt const * const e);
-static QState Mine1_used(Mine1 * const me, QEvt const * const e);
-static QState Mine1_exploding(Mine1 * const me, QEvt const * const e);
-static QState Mine1_planted(Mine1 * const me, QEvt const * const e);
+static QState Mine1_unused  (Mine1 * const me, QEvt const * const e);
+static QMState const Mine1_unused_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Mine1_unused),
+    Q_ACTION_CAST(0)
+};
+static QState Mine1_used  (Mine1 * const me, QEvt const * const e);
+static QState Mine1_used_x(Mine1 * const me);
+static QMState const Mine1_used_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Mine1_used),
+    Q_ACTION_CAST(&Mine1_used_x)
+};
+static QState Mine1_exploding  (Mine1 * const me, QEvt const * const e);
+static QState Mine1_exploding_e(Mine1 * const me);
+static QMState const Mine1_exploding_s = {
+    &Mine1_used_s,
+    Q_STATE_CAST(&Mine1_exploding),
+    Q_ACTION_CAST(0)
+};
+static QState Mine1_planted  (Mine1 * const me, QEvt const * const e);
+static QMState const Mine1_planted_s = {
+    &Mine1_used_s,
+    Q_STATE_CAST(&Mine1_planted),
+    Q_ACTION_CAST(0)
+};
 
 
 /* local objects -----------------------------------------------------------*/
@@ -50,14 +72,14 @@ static Mine1 l_mine1[GAME_MINES_MAX];             /* a pool of type-1 mines */
 #define MINE_ID(me_)    ((uint8_t)((me_) - l_mine1))
 
 /* Mine1 class definition --------------------------------------------------*/
-/* @(/2/12) ................................................................*/
-QHsm * Mine1_ctor(uint8_t id) {
+/* @(/2/11) ................................................................*/
+QMsm * Mine1_ctor(uint8_t id) {
     Mine1 *me;
     Q_REQUIRE(id < GAME_MINES_MAX);
     me = &l_mine1[id];
     /* superclass' ctor */
-    QHsm_ctor(&me->super, (QStateHandler)&Mine1_initial);
-    return (QHsm *)me;
+    QMsm_ctor(&me->super, Q_STATE_CAST(&Mine1_initial));
+    return (QMsm *)me;
 }
 /* @(/2/3) .................................................................*/
 /* @(/2/3/3) ...............................................................*/
@@ -88,7 +110,7 @@ static QState Mine1_initial(Mine1 * const me, QEvt const * const e) {
     QS_SIG_DICTIONARY(MISSILE_IMG_SIG,   me);
 
     (void)e; /* avoid the "unreferenced parameter" warning */
-    return Q_TRAN(&Mine1_unused);
+    return QM_INITIAL(&Mine1_unused_s, QMsm_emptyAction_);
 }
 /* @(/2/3/3/1) .............................................................*/
 static QState Mine1_unused(Mine1 * const me, QEvt const * const e) {
@@ -98,51 +120,51 @@ static QState Mine1_unused(Mine1 * const me, QEvt const * const e) {
         case MINE_PLANT_SIG: {
             me->x = Q_EVT_CAST(ObjectPosEvt)->x;
             me->y = Q_EVT_CAST(ObjectPosEvt)->y;
-            status_ = Q_TRAN(&Mine1_planted);
+            status_ = QM_TRAN(&Mine1_planted_s, QMsm_emptyAction_);
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/3/3/2) .............................................................*/
+static QState Mine1_used_x(Mine1 * const me) {
+    /* tell the Tunnel that this mine is becoming disabled */
+    MineEvt *mev = Q_NEW(MineEvt, MINE_DISABLED_SIG);
+    mev->id = MINE_ID(me);
+    QACTIVE_POST(AO_Tunnel, (QEvt *)mev, me);
+    return QM_EXIT(&Mine1_used_s);
+}
 static QState Mine1_used(Mine1 * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/3/3/2) */
-        case Q_EXIT_SIG: {
-            /* tell the Tunnel that this mine is becoming disabled */
-            MineEvt *mev = Q_NEW(MineEvt, MINE_DISABLED_SIG);
-            mev->id = MINE_ID(me);
-            QACTIVE_POST(AO_Tunnel, (QEvt *)mev, me);
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/3/3/2/0) */
         case MINE_RECYCLE_SIG: {
-            status_ = Q_TRAN(&Mine1_unused);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Mine1_used_x),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Mine1_unused_s, act_);
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/3/3/2/1) ...........................................................*/
+static QState Mine1_exploding_e(Mine1 * const me) {
+    me->exp_ctr = 0U;
+    return QM_ENTRY(&Mine1_exploding_s);
+}
 static QState Mine1_exploding(Mine1 * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/3/3/2/1) */
-        case Q_ENTRY_SIG: {
-            me->exp_ctr = 0U;
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/3/3/2/1/0) */
         case TIME_TICK_SIG: {
             /* @(/2/3/3/2/1/0/0) */
@@ -157,16 +179,20 @@ static QState Mine1_exploding(Mine1 * const me, QEvt const * const e) {
                 oie->y   = (int8_t)((int)me->y - 4 + 2); /* y of explosion */
                 oie->bmp = EXPLOSION0_BMP + (me->exp_ctr >> 2);
                 QACTIVE_POST(AO_Tunnel, (QEvt *)oie, me);
-                status_ = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             /* @(/2/3/3/2/1/0/1) */
             else {
-                status_ = Q_TRAN(&Mine1_unused);
+                static QActionHandler const act_[] = {
+                    Q_ACTION_CAST(&Mine1_used_x),
+                    Q_ACTION_CAST(0)
+                };
+                status_ = QM_TRAN(&Mine1_unused_s, act_);
             }
             break;
         }
         default: {
-            status_ = Q_SUPER(&Mine1_used);
+            status_ = QM_SUPER();
             break;
         }
     }
@@ -188,11 +214,15 @@ static QState Mine1_planted(Mine1 * const me, QEvt const * const e) {
                 oie->y   = me->y;
                 oie->bmp = MINE1_BMP;
                 QACTIVE_POST(AO_Tunnel, (QEvt *)oie, me);
-                status_ = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             /* @(/2/3/3/2/2/0/1) */
             else {
-                status_ = Q_TRAN(&Mine1_unused);
+                static QActionHandler const act_[] = {
+                    Q_ACTION_CAST(&Mine1_used_x),
+                    Q_ACTION_CAST(0)
+                };
+                status_ = QM_TRAN(&Mine1_unused_s, act_);
             }
             break;
         }
@@ -203,6 +233,10 @@ static QState Mine1_planted(Mine1 * const me, QEvt const * const e) {
             uint8_t bmp = Q_EVT_CAST(ObjectImageEvt)->bmp;
             /* @(/2/3/3/2/2/1/0) */
             if (do_bitmaps_overlap(MINE1_BMP, me->x, me->y, bmp, x, y)) {
+                static QActionHandler const act_[] = {
+                    Q_ACTION_CAST(&Mine1_used_x),
+                    Q_ACTION_CAST(0)
+                };
                 static MineEvt const mine1_hit = {
                     { HIT_MINE_SIG, 0U, 0U }, /* the QEvt base instance */
                     1U  /* type of the mine (1 for Mine type-1) */
@@ -210,10 +244,10 @@ static QState Mine1_planted(Mine1 * const me, QEvt const * const e) {
                 QACTIVE_POST(AO_Ship, (QEvt *)&mine1_hit, me);
                 /* go straight to 'disabled' and let the Ship do
                  * the exploding */
-                status_ = Q_TRAN(&Mine1_unused);
+                status_ = QM_TRAN(&Mine1_unused_s, act_);
             }
             else {
-                status_ = Q_UNHANDLED();
+                status_ = QM_UNHANDLED();
             }
             break;
         }
@@ -224,20 +258,24 @@ static QState Mine1_planted(Mine1 * const me, QEvt const * const e) {
             uint8_t bmp = Q_EVT_CAST(ObjectImageEvt)->bmp;
             /* @(/2/3/3/2/2/2/0) */
             if (do_bitmaps_overlap(MINE1_BMP, me->x, me->y, bmp, x, y)) {
+                static QActionHandler const act_[] = {
+                    Q_ACTION_CAST(&Mine1_exploding_e),
+                    Q_ACTION_CAST(0)
+                };
                 static ScoreEvt const mine1_destroyed = {
                     { DESTROYED_MINE_SIG, 0U, 0U },  /* the QEvt base instance */
                     25U  /* score for destroying Mine type-1 */
                 };
                 QACTIVE_POST(AO_Missile, (QEvt *)&mine1_destroyed, me);
-                status_ = Q_TRAN(&Mine1_exploding);
+                status_ = QM_TRAN(&Mine1_exploding_s, act_);
             }
             else {
-                status_ = Q_UNHANDLED();
+                status_ = QM_UNHANDLED();
             }
             break;
         }
         default: {
-            status_ = Q_SUPER(&Mine1_used);
+            status_ = QM_SUPER();
             break;
         }
     }

+ 77 - 39
examples/arm-cm/qk/arm_keil/game-qk_ek-lm3s811/mine2.c

@@ -25,7 +25,7 @@ Q_DEFINE_THIS_FILE
 /* @(/2/4) .................................................................*/
 typedef struct Mine2Tag {
 /* protected: */
-    QHsm super;
+    QMsm super;
 
 /* private: */
     uint8_t x;
@@ -37,10 +37,32 @@ typedef struct Mine2Tag {
 
 /* protected: */
 static QState Mine2_initial(Mine2 * const me, QEvt const * const e);
-static QState Mine2_unused(Mine2 * const me, QEvt const * const e);
-static QState Mine2_used(Mine2 * const me, QEvt const * const e);
-static QState Mine2_planted(Mine2 * const me, QEvt const * const e);
-static QState Mine2_exploding(Mine2 * const me, QEvt const * const e);
+static QState Mine2_unused  (Mine2 * const me, QEvt const * const e);
+static QMState const Mine2_unused_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Mine2_unused),
+    Q_ACTION_CAST(0)
+};
+static QState Mine2_used  (Mine2 * const me, QEvt const * const e);
+static QState Mine2_used_x(Mine2 * const me);
+static QMState const Mine2_used_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Mine2_used),
+    Q_ACTION_CAST(&Mine2_used_x)
+};
+static QState Mine2_planted  (Mine2 * const me, QEvt const * const e);
+static QMState const Mine2_planted_s = {
+    &Mine2_used_s,
+    Q_STATE_CAST(&Mine2_planted),
+    Q_ACTION_CAST(0)
+};
+static QState Mine2_exploding  (Mine2 * const me, QEvt const * const e);
+static QState Mine2_exploding_e(Mine2 * const me);
+static QMState const Mine2_exploding_s = {
+    &Mine2_used_s,
+    Q_STATE_CAST(&Mine2_exploding),
+    Q_ACTION_CAST(0)
+};
 
 
 /* local objects -----------------------------------------------------------*/
@@ -50,14 +72,14 @@ static Mine2 l_mine2[GAME_MINES_MAX];             /* a pool of type-2 mines */
 #define MINE_ID(me_)    ((uint8_t)((me_) - l_mine2))
 
 /* Mine2 class definition --------------------------------------------------*/
-/* @(/2/13) ................................................................*/
-QHsm * Mine2_ctor(uint8_t id) {
+/* @(/2/12) ................................................................*/
+QMsm * Mine2_ctor(uint8_t id) {
     Mine2 *me;
     Q_REQUIRE(id < GAME_MINES_MAX);
     me = &l_mine2[id];
     /* superclass' ctor */
-    QHsm_ctor(&me->super, (QStateHandler)&Mine2_initial);
-    return (QHsm *)me;
+    QMsm_ctor(&me->super, Q_STATE_CAST(&Mine2_initial));
+    return (QMsm *)me;
 }
 /* @(/2/4) .................................................................*/
 /* @(/2/4/3) ...............................................................*/
@@ -90,7 +112,7 @@ static QState Mine2_initial(Mine2 * const me, QEvt const * const e) {
     QS_SIG_DICTIONARY(MISSILE_IMG_SIG,   me);
 
     (void)e; /* avoid the "unreferenced parameter" warning */
-    return Q_TRAN(&Mine2_unused);
+    return QM_INITIAL(&Mine2_unused_s, QMsm_emptyAction_);
 }
 /* @(/2/4/3/1) .............................................................*/
 static QState Mine2_unused(Mine2 * const me, QEvt const * const e) {
@@ -100,36 +122,38 @@ static QState Mine2_unused(Mine2 * const me, QEvt const * const e) {
         case MINE_PLANT_SIG: {
             me->x = Q_EVT_CAST(ObjectPosEvt)->x;
             me->y = Q_EVT_CAST(ObjectPosEvt)->y;
-            status_ = Q_TRAN(&Mine2_planted);
+            status_ = QM_TRAN(&Mine2_planted_s, QMsm_emptyAction_);
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/4/3/2) .............................................................*/
+static QState Mine2_used_x(Mine2 * const me) {
+    /* tell the Tunnel that this mine is becoming disabled */
+    MineEvt *mev = Q_NEW(MineEvt, MINE_DISABLED_SIG);
+    mev->id = MINE_ID(me);
+    QACTIVE_POST(AO_Tunnel, (QEvt *)mev, me);
+    return QM_EXIT(&Mine2_used_s);
+}
 static QState Mine2_used(Mine2 * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/4/3/2) */
-        case Q_EXIT_SIG: {
-            /* tell the Tunnel that this mine is becoming disabled */
-            MineEvt *mev = Q_NEW(MineEvt, MINE_DISABLED_SIG);
-            mev->id = MINE_ID(me);
-            QACTIVE_POST(AO_Tunnel, (QEvt *)mev, me);
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/4/3/2/0) */
         case MINE_RECYCLE_SIG: {
-            status_ = Q_TRAN(&Mine2_unused);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Mine2_used_x),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Mine2_unused_s, act_);
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
@@ -151,11 +175,15 @@ static QState Mine2_planted(Mine2 * const me, QEvt const * const e) {
                 oie->y   = me->y;
                 oie->bmp = MINE2_BMP;
                 QACTIVE_POST(AO_Tunnel, (QEvt *)oie, me);
-                status_ = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             /* @(/2/4/3/2/1/0/1) */
             else {
-                status_ = Q_TRAN(&Mine2_unused);
+                static QActionHandler const act_[] = {
+                    Q_ACTION_CAST(&Mine2_used_x),
+                    Q_ACTION_CAST(0)
+                };
+                status_ = QM_TRAN(&Mine2_unused_s, act_);
             }
             break;
         }
@@ -166,6 +194,10 @@ static QState Mine2_planted(Mine2 * const me, QEvt const * const e) {
             uint8_t bmp = Q_EVT_CAST(ObjectImageEvt)->bmp;
             /* @(/2/4/3/2/1/1/0) */
             if (do_bitmaps_overlap(MINE2_BMP, me->x, me->y, bmp, x, y)) {
+                static QActionHandler const act_[] = {
+                    Q_ACTION_CAST(&Mine2_used_x),
+                    Q_ACTION_CAST(0)
+                };
                 static MineEvt const mine1_hit = {
                     { HIT_MINE_SIG, 0U, 0U }, /* the QEvt base instance */
                     2U  /* type of the mine (2 for Mine type-2) */
@@ -173,10 +205,10 @@ static QState Mine2_planted(Mine2 * const me, QEvt const * const e) {
                  QACTIVE_POST(AO_Ship, (QEvt *)&mine1_hit, me);
                  /* go straight to 'disabled' and let the Ship do
                  * the exploding */
-                status_ = Q_TRAN(&Mine2_unused);
+                status_ = QM_TRAN(&Mine2_unused_s, act_);
             }
             else {
-                status_ = Q_UNHANDLED();
+                status_ = QM_UNHANDLED();
             }
             break;
         }
@@ -187,6 +219,10 @@ static QState Mine2_planted(Mine2 * const me, QEvt const * const e) {
             uint8_t bmp = Q_EVT_CAST(ObjectImageEvt)->bmp;
             /* @(/2/4/3/2/1/2/0) */
             if (do_bitmaps_overlap(MINE2_MISSILE_BMP, me->x, me->y, bmp, x, y)) {
+                static QActionHandler const act_[] = {
+                    Q_ACTION_CAST(&Mine2_exploding_e),
+                    Q_ACTION_CAST(0)
+                };
                 /* NOTE: Mine type-2 is nastier than Mine type-1.
                 * The type-2 mine can hit the Ship with any of its
                 * "tentacles". However, it can be destroyed by the
@@ -198,30 +234,28 @@ static QState Mine2_planted(Mine2 * const me, QEvt const * const e) {
                     45U  /* score for destroying Mine type-2 */
                 };
                 QACTIVE_POST(AO_Missile, (QEvt *)&mine2_destroyed, me);
-                status_ = Q_TRAN(&Mine2_exploding);
+                status_ = QM_TRAN(&Mine2_exploding_s, act_);
             }
             else {
-                status_ = Q_UNHANDLED();
+                status_ = QM_UNHANDLED();
             }
             break;
         }
         default: {
-            status_ = Q_SUPER(&Mine2_used);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/4/3/2/2) ...........................................................*/
+static QState Mine2_exploding_e(Mine2 * const me) {
+    me->exp_ctr = 0U;
+    return QM_ENTRY(&Mine2_exploding_s);
+}
 static QState Mine2_exploding(Mine2 * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/4/3/2/2) */
-        case Q_ENTRY_SIG: {
-            me->exp_ctr = 0U;
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/4/3/2/2/0) */
         case TIME_TICK_SIG: {
             /* @(/2/4/3/2/2/0/0) */
@@ -236,16 +270,20 @@ static QState Mine2_exploding(Mine2 * const me, QEvt const * const e) {
                 oie->y   = (int8_t)((int)me->y - 4 + 2); /* y of explosion */
                 oie->bmp = EXPLOSION0_BMP + (me->exp_ctr >> 2);
                 QACTIVE_POST(AO_Tunnel, (QEvt *)oie, me);
-                status_ = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             /* @(/2/4/3/2/2/0/1) */
             else {
-                status_ = Q_TRAN(&Mine2_unused);
+                static QActionHandler const act_[] = {
+                    Q_ACTION_CAST(&Mine2_used_x),
+                    Q_ACTION_CAST(0)
+                };
+                status_ = QM_TRAN(&Mine2_unused_s, act_);
             }
             break;
         }
         default: {
-            status_ = Q_SUPER(&Mine2_used);
+            status_ = QM_SUPER();
             break;
         }
     }

+ 41 - 23
examples/arm-cm/qk/arm_keil/game-qk_ek-lm3s811/missile.c

@@ -25,7 +25,7 @@
 /* @(/2/2) .................................................................*/
 typedef struct MissileTag {
 /* protected: */
-    QActive super;
+    QMActive super;
 
 /* private: */
     uint8_t x;
@@ -35,9 +35,25 @@ typedef struct MissileTag {
 
 /* protected: */
 static QState Missile_initial(Missile * const me, QEvt const * const e);
-static QState Missile_armed(Missile * const me, QEvt const * const e);
-static QState Missile_flying(Missile * const me, QEvt const * const e);
-static QState Missile_exploding(Missile * const me, QEvt const * const e);
+static QState Missile_armed  (Missile * const me, QEvt const * const e);
+static QMState const Missile_armed_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Missile_armed),
+    Q_ACTION_CAST(0)
+};
+static QState Missile_flying  (Missile * const me, QEvt const * const e);
+static QMState const Missile_flying_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Missile_flying),
+    Q_ACTION_CAST(0)
+};
+static QState Missile_exploding  (Missile * const me, QEvt const * const e);
+static QState Missile_exploding_e(Missile * const me);
+static QMState const Missile_exploding_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Missile_exploding),
+    Q_ACTION_CAST(0)
+};
 
 static Missile l_missile; /* the sole instance of the Missile active object */
 
@@ -45,10 +61,10 @@ static Missile l_missile; /* the sole instance of the Missile active object */
 QActive * const AO_Missile = (QActive *)&l_missile;       /* opaque pointer */
 
 /* Active object definition ------------------------------------------------*/
-/* @(/2/11) ................................................................*/
+/* @(/2/10) ................................................................*/
 void Missile_ctor(void) {
     Missile *me = &l_missile;
-    QActive_ctor(&me->super, (QStateHandler)&Missile_initial);
+    QMActive_ctor(&me->super, Q_STATE_CAST(&Missile_initial));
 }
 /* @(/2/2) .................................................................*/
 /* @(/2/2/3) ...............................................................*/
@@ -67,7 +83,7 @@ static QState Missile_initial(Missile * const me, QEvt const * const e) {
     QS_SIG_DICTIONARY(MISSILE_FIRE_SIG,   &l_missile);     /* local signals */
     QS_SIG_DICTIONARY(HIT_WALL_SIG,       &l_missile);
     QS_SIG_DICTIONARY(DESTROYED_MINE_SIG, &l_missile);
-    return Q_TRAN(&Missile_armed);
+    return QM_INITIAL(&Missile_armed_s, QMsm_emptyAction_);
 }
 /* @(/2/2/3/1) .............................................................*/
 static QState Missile_armed(Missile * const me, QEvt const * const e) {
@@ -77,11 +93,11 @@ static QState Missile_armed(Missile * const me, QEvt const * const e) {
         case MISSILE_FIRE_SIG: {
             me->x = Q_EVT_CAST(ObjectPosEvt)->x;
             me->y = Q_EVT_CAST(ObjectPosEvt)->y;
-            status_ = Q_TRAN(&Missile_flying);
+            status_ = QM_TRAN(&Missile_flying_s, QMsm_emptyAction_);
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
@@ -103,42 +119,44 @@ static QState Missile_flying(Missile * const me, QEvt const * const e) {
                 oie->y   = me->y;
                 oie->bmp = MISSILE_BMP;
                 QACTIVE_POST(AO_Tunnel, (QEvt *)oie, me);
-                status_ = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             /* @(/2/2/3/2/0/1) */
             else {
-                status_ = Q_TRAN(&Missile_armed);
+                status_ = QM_TRAN(&Missile_armed_s, QMsm_emptyAction_);
             }
             break;
         }
         /* @(/2/2/3/2/1) */
         case HIT_WALL_SIG: {
-            status_ = Q_TRAN(&Missile_exploding);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Missile_exploding_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Missile_exploding_s, act_);
             break;
         }
         /* @(/2/2/3/2/2) */
         case DESTROYED_MINE_SIG: {
             QACTIVE_POST(AO_Ship, e, me);
-            status_ = Q_TRAN(&Missile_armed);
+            status_ = QM_TRAN(&Missile_armed_s, QMsm_emptyAction_);
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/2/3/3) .............................................................*/
+static QState Missile_exploding_e(Missile * const me) {
+    me->exp_ctr = 0U;
+    return QM_ENTRY(&Missile_exploding_s);
+}
 static QState Missile_exploding(Missile * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/2/3/3) */
-        case Q_ENTRY_SIG: {
-            me->exp_ctr = 0U;
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/2/3/3/0) */
         case TIME_TICK_SIG: {
             /* @(/2/2/3/3/0/0) */
@@ -154,16 +172,16 @@ static QState Missile_exploding(Missile * const me, QEvt const * const e) {
                 oie->y   = (int8_t)((int)me->y - 4U); /* y-pos */
                 oie->bmp = EXPLOSION0_BMP + (me->exp_ctr >> 2);
                 QACTIVE_POST(AO_Tunnel, (QEvt *)oie, me);
-                status_ = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             /* @(/2/2/3/3/0/1) */
             else {
-                status_ = Q_TRAN(&Missile_armed);
+                status_ = QM_TRAN(&Missile_armed_s, QMsm_emptyAction_);
             }
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }

+ 75 - 42
examples/arm-cm/qk/arm_keil/game-qk_ek-lm3s811/ship.c

@@ -28,7 +28,7 @@
 /* @(/2/1) .................................................................*/
 typedef struct ShipTag {
 /* protected: */
-    QActive super;
+    QMActive super;
 
 /* private: */
     uint8_t x;
@@ -39,10 +39,33 @@ typedef struct ShipTag {
 
 /* protected: */
 static QState Ship_initial(Ship * const me, QEvt const * const e);
-static QState Ship_active(Ship * const me, QEvt const * const e);
-static QState Ship_parked(Ship * const me, QEvt const * const e);
-static QState Ship_flying(Ship * const me, QEvt const * const e);
-static QState Ship_exploding(Ship * const me, QEvt const * const e);
+static QState Ship_active  (Ship * const me, QEvt const * const e);
+static QState Ship_active_i(Ship * const me);
+static QMState const Ship_active_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Ship_active),
+    Q_ACTION_CAST(0)
+};
+static QState Ship_parked  (Ship * const me, QEvt const * const e);
+static QMState const Ship_parked_s = {
+    &Ship_active_s,
+    Q_STATE_CAST(&Ship_parked),
+    Q_ACTION_CAST(0)
+};
+static QState Ship_flying  (Ship * const me, QEvt const * const e);
+static QState Ship_flying_e(Ship * const me);
+static QMState const Ship_flying_s = {
+    &Ship_active_s,
+    Q_STATE_CAST(&Ship_flying),
+    Q_ACTION_CAST(0)
+};
+static QState Ship_exploding  (Ship * const me, QEvt const * const e);
+static QState Ship_exploding_e(Ship * const me);
+static QMState const Ship_exploding_s = {
+    &Ship_active_s,
+    Q_STATE_CAST(&Ship_exploding),
+    Q_ACTION_CAST(0)
+};
 
 
 /* local objects -----------------------------------------------------------*/
@@ -52,10 +75,10 @@ static Ship l_ship; /* the sole instance of the Ship active object */
 QActive * const AO_Ship = (QActive *)&l_ship; /* opaque pointer */
 
 /* Active object definition ------------------------------------------------*/
-/* @(/2/10) ................................................................*/
+/* @(/2/9) .................................................................*/
 void Ship_ctor(void) {
     Ship *me = &l_ship;
-    QActive_ctor(&me->super, (QStateHandler)&Ship_initial);
+    QMActive_ctor(&me->super, Q_STATE_CAST(&Ship_initial));
     me->x = GAME_SHIP_X;
     me->y = GAME_SHIP_Y;
 }
@@ -63,6 +86,10 @@ void Ship_ctor(void) {
 /* @(/2/1/4) ...............................................................*/
 /* @(/2/1/4/0) */
 static QState Ship_initial(Ship * const me, QEvt const * const e) {
+    static QActionHandler const act_[] = {
+        Q_ACTION_CAST(&Ship_active_i),
+        Q_ACTION_CAST(0)
+    };
     (void)e; /* avoid the compiler warning 'usused parameter' */
     QActive_subscribe((QActive *)me, TIME_TICK_SIG);
     QActive_subscribe((QActive *)me, PLAYER_TRIGGER_SIG);
@@ -80,26 +107,24 @@ static QState Ship_initial(Ship * const me, QEvt const * const e) {
     QS_SIG_DICTIONARY(HIT_WALL_SIG,         &l_ship);
     QS_SIG_DICTIONARY(HIT_MINE_SIG,         &l_ship);
     QS_SIG_DICTIONARY(DESTROYED_MINE_SIG,   &l_ship);
-    return Q_TRAN(&Ship_active);
+    return QM_INITIAL(&Ship_active_s, act_);
 }
 /* @(/2/1/4/1) .............................................................*/
+static QState Ship_active_i(Ship * const me) {
+    return QM_INITIAL(&Ship_parked_s, QMsm_emptyAction_);
+}
 static QState Ship_active(Ship * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/1/4/1/0) */
-        case Q_INIT_SIG: {
-            status_ = Q_TRAN(&Ship_parked);
-            break;
-        }
         /* @(/2/1/4/1/1) */
         case PLAYER_SHIP_MOVE_SIG: {
             me->x = Q_EVT_CAST(ObjectPosEvt)->x;
             me->y = Q_EVT_CAST(ObjectPosEvt)->y;
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
@@ -111,30 +136,32 @@ static QState Ship_parked(Ship * const me, QEvt const * const e) {
     switch (e->sig) {
         /* @(/2/1/4/1/2/0) */
         case TAKE_OFF_SIG: {
-            status_ = Q_TRAN(&Ship_flying);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Ship_flying_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Ship_flying_s, act_);
             break;
         }
         default: {
-            status_ = Q_SUPER(&Ship_active);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/1/4/1/3) ...........................................................*/
+static QState Ship_flying_e(Ship * const me) {
+    ScoreEvt *sev;
+    me->score = 0U; /* reset the score */
+    sev = Q_NEW(ScoreEvt, SCORE_SIG);
+    sev->score = me->score;
+    QACTIVE_POST(AO_Tunnel, (QEvt *)sev, me);
+    return QM_ENTRY(&Ship_flying_s);
+}
 static QState Ship_flying(Ship * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/1/4/1/3) */
-        case Q_ENTRY_SIG: {
-            ScoreEvt *sev;
-            me->score = 0U; /* reset the score */
-            sev = Q_NEW(ScoreEvt, SCORE_SIG);
-            sev->score = me->score;
-            QACTIVE_POST(AO_Tunnel, (QEvt *)sev, me);
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/1/4/1/3/0) */
         case TIME_TICK_SIG: {
             /* tell the Tunnel to draw the Ship and test for hits */
@@ -151,7 +178,7 @@ static QState Ship_flying(Ship * const me, QEvt const * const e) {
                 sev->score = me->score;
                 QACTIVE_POST(AO_Tunnel, (QEvt *)sev, me);
             }
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/4/1/3/1) */
@@ -160,43 +187,49 @@ static QState Ship_flying(Ship * const me, QEvt const * const e) {
             ope->x = me->x;
             ope->y = me->y + SHIP_HEIGHT - 1U;
             QACTIVE_POST(AO_Missile, (QEvt *)ope, me);
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/4/1/3/2) */
         case DESTROYED_MINE_SIG: {
             me->score += Q_EVT_CAST(ScoreEvt)->score;
             /* the score will be sent to the Tunnel by the next TIME_TICK */
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/4/1/3/3) */
         case HIT_WALL_SIG: {
-            status_ = Q_TRAN(&Ship_exploding);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Ship_exploding_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Ship_exploding_s, act_);
             break;
         }
         /* @(/2/1/4/1/3/4) */
         case HIT_MINE_SIG: {
-            status_ = Q_TRAN(&Ship_exploding);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Ship_exploding_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Ship_exploding_s, act_);
             break;
         }
         default: {
-            status_ = Q_SUPER(&Ship_active);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/1/4/1/4) ...........................................................*/
+static QState Ship_exploding_e(Ship * const me) {
+    me->exp_ctr = 0U;
+    return QM_ENTRY(&Ship_exploding_s);
+}
 static QState Ship_exploding(Ship * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/1/4/1/4) */
-        case Q_ENTRY_SIG: {
-            me->exp_ctr = 0U;
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/1/4/1/4/0) */
         case TIME_TICK_SIG: {
             /* @(/2/1/4/1/4/0/0) */
@@ -209,19 +242,19 @@ static QState Ship_exploding(Ship * const me, QEvt const * const e) {
                 oie->x   = me->x; /* x of explosion */
                 oie->y   = (int8_t)((int)me->y - 4U + SHIP_HEIGHT);
                 QACTIVE_POST(AO_Tunnel, (QEvt *)oie, me);
-                status_ = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             /* @(/2/1/4/1/4/0/1) */
             else {
                 ScoreEvt *gameOver = Q_NEW(ScoreEvt, GAME_OVER_SIG);
                 gameOver->score = me->score;
                 QACTIVE_POST(AO_Tunnel, (QEvt *)gameOver, me);
-                status_ = Q_TRAN(&Ship_parked);
+                status_ = QM_TRAN(&Ship_parked_s, QMsm_emptyAction_);
             }
             break;
         }
         default: {
-            status_ = Q_SUPER(&Ship_active);
+            status_ = QM_SUPER();
             break;
         }
     }

+ 276 - 199
examples/arm-cm/qk/arm_keil/game-qk_ek-lm3s811/tunnel.c

@@ -26,14 +26,14 @@ Q_DEFINE_THIS_FILE
 /* @(/2/0) .................................................................*/
 typedef struct TunnelTag {
 /* protected: */
-    QActive super;
+    QMActive super;
 
 /* private: */
     QTimeEvt blinkTimeEvt;
     QTimeEvt screenTimeEvt;
-    QHsm * mines[GAME_MINES_MAX];
-    QHsm * mine1_pool[GAME_MINES_MAX];
-    QHsm * mine2_pool[GAME_MINES_MAX];
+    QMsm * mines[GAME_MINES_MAX];
+    QMsm * mine1_pool[GAME_MINES_MAX];
+    QMsm * mine2_pool[GAME_MINES_MAX];
     uint8_t blink_ctr;
     uint8_t last_mine_x;
     uint8_t last_mine_y;
@@ -59,15 +59,74 @@ static uint8_t Tunnel_isWallHit(
 
 /* protected: */
 static QState Tunnel_initial(Tunnel * const me, QEvt const * const e);
-static QState Tunnel_active(Tunnel * const me, QEvt const * const e);
-static QState Tunnel_show_logo(Tunnel * const me, QEvt const * const e);
-static QState Tunnel_demo(Tunnel * const me, QEvt const * const e);
-static QState Tunnel_playing(Tunnel * const me, QEvt const * const e);
-static QState Tunnel_game_over(Tunnel * const me, QEvt const * const e);
-static QState Tunnel_screen_saver(Tunnel * const me, QEvt const * const e);
-static QState Tunnel_screen_saver_hide(Tunnel * const me, QEvt const * const e);
-static QState Tunnel_screen_saver_show(Tunnel * const me, QEvt const * const e);
-static QState Tunnel_final(Tunnel * const me, QEvt const * const e);
+static QState Tunnel_active  (Tunnel * const me, QEvt const * const e);
+static QMState const Tunnel_active_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Tunnel_active),
+    Q_ACTION_CAST(0)
+};
+static QState Tunnel_show_logo  (Tunnel * const me, QEvt const * const e);
+static QState Tunnel_show_logo_e(Tunnel * const me);
+static QState Tunnel_show_logo_x(Tunnel * const me);
+static QMState const Tunnel_show_logo_s = {
+    &Tunnel_active_s,
+    Q_STATE_CAST(&Tunnel_show_logo),
+    Q_ACTION_CAST(&Tunnel_show_logo_x)
+};
+static QState Tunnel_demo  (Tunnel * const me, QEvt const * const e);
+static QState Tunnel_demo_e(Tunnel * const me);
+static QState Tunnel_demo_x(Tunnel * const me);
+static QMState const Tunnel_demo_s = {
+    &Tunnel_active_s,
+    Q_STATE_CAST(&Tunnel_demo),
+    Q_ACTION_CAST(&Tunnel_demo_x)
+};
+static QState Tunnel_playing  (Tunnel * const me, QEvt const * const e);
+static QState Tunnel_playing_e(Tunnel * const me);
+static QState Tunnel_playing_x(Tunnel * const me);
+static QMState const Tunnel_playing_s = {
+    &Tunnel_active_s,
+    Q_STATE_CAST(&Tunnel_playing),
+    Q_ACTION_CAST(&Tunnel_playing_x)
+};
+static QState Tunnel_game_over  (Tunnel * const me, QEvt const * const e);
+static QState Tunnel_game_over_e(Tunnel * const me);
+static QState Tunnel_game_over_x(Tunnel * const me);
+static QMState const Tunnel_game_over_s = {
+    &Tunnel_active_s,
+    Q_STATE_CAST(&Tunnel_game_over),
+    Q_ACTION_CAST(&Tunnel_game_over_x)
+};
+static QState Tunnel_screen_saver  (Tunnel * const me, QEvt const * const e);
+static QState Tunnel_screen_saver_i(Tunnel * const me);
+static QMState const Tunnel_screen_saver_s = {
+    &Tunnel_active_s,
+    Q_STATE_CAST(&Tunnel_screen_saver),
+    Q_ACTION_CAST(0)
+};
+static QState Tunnel_screen_saver_hide  (Tunnel * const me, QEvt const * const e);
+static QState Tunnel_screen_saver_hide_e(Tunnel * const me);
+static QState Tunnel_screen_saver_hide_x(Tunnel * const me);
+static QMState const Tunnel_screen_saver_hide_s = {
+    &Tunnel_screen_saver_s,
+    Q_STATE_CAST(&Tunnel_screen_saver_hide),
+    Q_ACTION_CAST(&Tunnel_screen_saver_hide_x)
+};
+static QState Tunnel_screen_saver_show  (Tunnel * const me, QEvt const * const e);
+static QState Tunnel_screen_saver_show_e(Tunnel * const me);
+static QState Tunnel_screen_saver_show_x(Tunnel * const me);
+static QMState const Tunnel_screen_saver_show_s = {
+    &Tunnel_screen_saver_s,
+    Q_STATE_CAST(&Tunnel_screen_saver_show),
+    Q_ACTION_CAST(&Tunnel_screen_saver_show_x)
+};
+static QState Tunnel_final  (Tunnel * const me, QEvt const * const e);
+static QState Tunnel_final_e(Tunnel * const me);
+static QMState const Tunnel_final_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Tunnel_final),
+    Q_ACTION_CAST(0)
+};
 
 static Tunnel l_tunnel;    /* the sole instance of the Tunnel active object */
 
@@ -237,17 +296,17 @@ static Bitmap const l_bitmap[MAX_BMP] = {
 };
 
 /* Active object definition ================================================*/
-/* @(/2/9) .................................................................*/
+/* @(/2/8) .................................................................*/
 void Tunnel_ctor(void) {
     uint8_t n;
     Tunnel *me = &l_tunnel;
-    QActive_ctor(&me->super, (QStateHandler)&Tunnel_initial);
-    QTimeEvt_ctor(&me->blinkTimeEvt,  BLINK_TIMEOUT_SIG);
-    QTimeEvt_ctor(&me->screenTimeEvt, SCREEN_TIMEOUT_SIG);
+    QMActive_ctor(&me->super, Q_STATE_CAST(&Tunnel_initial));
+    QTimeEvt_ctorX(&me->blinkTimeEvt,  &me->super, BLINK_TIMEOUT_SIG,  0U);
+    QTimeEvt_ctorX(&me->screenTimeEvt, &me->super, SCREEN_TIMEOUT_SIG, 0U);
     for (n = 0; n < GAME_MINES_MAX; ++n) {
         me->mine1_pool[n] = Mine1_ctor(n); /* instantiate Mine1 in the pool */
         me->mine2_pool[n] = Mine2_ctor(n); /* instantiate Mine2 in the pool */
-        me->mines[n] = (QHsm *)0; /* mine 'n' is unused */
+        me->mines[n] = (QMsm *)0; /* mine 'n' is unused */
     }
     me->last_mine_x = 0; /* the last mine at the right edge of the tunnel */
     me->last_mine_y = 0;
@@ -322,7 +381,7 @@ static void Tunnel_plantMine(Tunnel * const me) {
     {
         uint8_t n;
         for (n = 0U; n < Q_DIM(me->mines); ++n) { /*look for disabled mines */
-            if (me->mines[n] == (QHsm *)0) {
+            if (me->mines[n] == (QMsm *)0) {
                 break;
             }
         }
@@ -349,7 +408,7 @@ static void Tunnel_plantMine(Tunnel * const me) {
             ope.super.sig = MINE_PLANT_SIG;
             ope.x = me->last_mine_x;
             ope.y = me->last_mine_y;
-            QHsm_dispatch(me->mines[n], (QEvt *)&ope); /* direct dispatch */
+            QMSM_DISPATCH(me->mines[n], (QEvt *)&ope); /* direct dispatch */
         }
     }
 
@@ -388,8 +447,8 @@ static void Tunnel_dispatchToAllMines(Tunnel * const me, QEvt const * e) {
     uint8_t n;
 
     for (n = 0U; n < GAME_MINES_MAX; ++n) {
-        if (me->mines[n] != (QHsm *)0) { /* is the mine used? */
-            QHsm_dispatch(me->mines[n], e);
+        if (me->mines[n] != (QMsm *)0) { /* is the mine used? */
+            QMSM_DISPATCH(me->mines[n], e);
         }
     }
 }
@@ -424,10 +483,14 @@ static uint8_t Tunnel_isWallHit(
 /* @(/2/0/16) ..............................................................*/
 /* @(/2/0/16/0) */
 static QState Tunnel_initial(Tunnel * const me, QEvt const * const e) {
+    static QActionHandler const act_[] = {
+        Q_ACTION_CAST(&Tunnel_show_logo_e),
+        Q_ACTION_CAST(0)
+    };
     uint8_t n;
     for (n = 0U; n < GAME_MINES_MAX; ++n) {
-        QHsm_init(me->mine1_pool[n], (QEvt *)0);/*initial tran. for Mine1 */
-        QHsm_init(me->mine2_pool[n], (QEvt *)0);/*initial tran. for Mine2 */
+        QMSM_INIT(me->mine1_pool[n], (QEvt *)0);/*initial tran. for Mine1 */
+        QMSM_INIT(me->mine2_pool[n], (QEvt *)0);/*initial tran. for Mine2 */
     }
     randomSeed(1234); /* seed the pseudo-random generator */
 
@@ -463,7 +526,7 @@ static QState Tunnel_initial(Tunnel * const me, QEvt const * const e) {
     QS_SIG_DICTIONARY(SCORE_SIG,          &l_tunnel);
 
     (void)e;  /* avoid the "unreferenced parameter" warning */
-    return Q_TRAN(&Tunnel_show_logo);
+    return QM_INITIAL(&Tunnel_show_logo_s, act_);
 }
 /* @(/2/0/16/1) ............................................................*/
 static QState Tunnel_active(Tunnel * const me, QEvt const * const e) {
@@ -472,49 +535,53 @@ static QState Tunnel_active(Tunnel * const me, QEvt const * const e) {
         /* @(/2/0/16/1/0) */
         case MINE_DISABLED_SIG: {
             Q_ASSERT((Q_EVT_CAST(MineEvt)->id < GAME_MINES_MAX)
-                     && (me->mines[Q_EVT_CAST(MineEvt)->id] != (QHsm *)0));
-            me->mines[Q_EVT_CAST(MineEvt)->id] = (QHsm *)0;
-            status_ = Q_HANDLED();
+                     && (me->mines[Q_EVT_CAST(MineEvt)->id] != (QMsm *)0));
+            me->mines[Q_EVT_CAST(MineEvt)->id] = (QMsm *)0;
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/0/16/1/1) */
         case PLAYER_QUIT_SIG: {
-            status_ = Q_TRAN(&Tunnel_final);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Tunnel_final_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Tunnel_final_s, act_);
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/0/16/1/2) ..........................................................*/
+static QState Tunnel_show_logo_e(Tunnel * const me) {
+    QTimeEvt_armX(&me->blinkTimeEvt, BSP_TICKS_PER_SEC/2U,
+                  BSP_TICKS_PER_SEC/2U);
+    QTimeEvt_armX(&me->screenTimeEvt, BSP_TICKS_PER_SEC*5U, 0U);
+    me->blink_ctr = 0U;
+    BSP_drawNString(0U, 0U, " Quantum  LeAps ");
+    BSP_drawNString(0U, 1U, "state-machine.co");
+    return QM_ENTRY(&Tunnel_show_logo_s);
+}
+static QState Tunnel_show_logo_x(Tunnel * const me) {
+    QTimeEvt_disarm(&me->blinkTimeEvt);
+    QTimeEvt_disarm(&me->screenTimeEvt);
+    return QM_EXIT(&Tunnel_show_logo_s);
+}
 static QState Tunnel_show_logo(Tunnel * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/0/16/1/2) */
-        case Q_ENTRY_SIG: {
-            QTimeEvt_postEvery(&me->blinkTimeEvt, (QActive *)me,
-                               BSP_TICKS_PER_SEC/2U); /* 1/2 sec */
-            QTimeEvt_postIn(&me->screenTimeEvt, (QActive *)me,
-                            BSP_TICKS_PER_SEC*5U); /* 5 sec timeout */
-            me->blink_ctr = 0U;
-            BSP_drawNString(0U, 0U, " Quantum  LeAps ");
-            BSP_drawNString(0U, 1U, "state-machine.co");
-            status_ = Q_HANDLED();
-            break;
-        }
-        /* @(/2/0/16/1/2) */
-        case Q_EXIT_SIG: {
-            QTimeEvt_disarm(&me->blinkTimeEvt);
-            QTimeEvt_disarm(&me->screenTimeEvt);
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/0/16/1/2/0) */
         case SCREEN_TIMEOUT_SIG: {
-            status_ = Q_TRAN(&Tunnel_demo);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Tunnel_show_logo_x),
+                Q_ACTION_CAST(&Tunnel_demo_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Tunnel_demo_s, act_);
             break;
         }
         /* @(/2/0/16/1/2/1) */
@@ -524,65 +591,65 @@ static QState Tunnel_show_logo(Tunnel * const me, QEvt const * const e) {
             if (me->blink_ctr == 0U) {
                 BSP_drawNString(6U*9U, 0U,         " LeAps");
                 BSP_drawNString(0U,    1U, "state-machine.co");
-                status_ = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             /* @(/2/0/16/1/2/1/1) */
             else {
                 BSP_drawNString(6U*9U, 0U,         "LeaPs ");
                 BSP_drawNString(0U,    1U, "tate-machine.com");
-                status_ = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             break;
         }
         default: {
-            status_ = Q_SUPER(&Tunnel_active);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/0/16/1/3) ..........................................................*/
+static QState Tunnel_demo_e(Tunnel * const me) {
+    me->last_mine_x = 0U; /* last mine at right edge of the tunnel */
+    me->last_mine_y = 0U;
+    /* set the tunnel properties... */
+    me->wall_thickness_top = 0U;
+    me->wall_thickness_bottom = 0U;
+    me->minimal_gap = GAME_SCREEN_HEIGHT - 3U;
+
+    /* erase the tunnel walls */
+    memset(l_walls, (uint8_t)0,
+          (GAME_SCREEN_WIDTH * GAME_SCREEN_HEIGHT/8U));
+
+    QTimeEvt_armX(&me->blinkTimeEvt,  BSP_TICKS_PER_SEC/2U,
+                  BSP_TICKS_PER_SEC/2U);
+    QTimeEvt_armX(&me->screenTimeEvt, BSP_TICKS_PER_SEC*20U, 0U);
+
+    me->blink_ctr = 0U; /* init the blink counter */
+    return QM_ENTRY(&Tunnel_demo_s);
+}
+static QState Tunnel_demo_x(Tunnel * const me) {
+    QTimeEvt_disarm(&me->blinkTimeEvt);
+    QTimeEvt_disarm(&me->screenTimeEvt);
+    return QM_EXIT(&Tunnel_demo_s);
+}
 static QState Tunnel_demo(Tunnel * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/0/16/1/3) */
-        case Q_ENTRY_SIG: {
-            me->last_mine_x = 0U; /* last mine at right edge of the tunnel */
-            me->last_mine_y = 0U;
-            /* set the tunnel properties... */
-            me->wall_thickness_top = 0U;
-            me->wall_thickness_bottom = 0U;
-            me->minimal_gap = GAME_SCREEN_HEIGHT - 3U;
-
-            /* erase the tunnel walls */
-            memset(l_walls, (uint8_t)0,
-                  (GAME_SCREEN_WIDTH * GAME_SCREEN_HEIGHT/8U));
-
-            QTimeEvt_postEvery(&me->blinkTimeEvt, (QActive *)me,
-                               BSP_TICKS_PER_SEC/2U); /* every 1/2 sec */
-            QTimeEvt_postIn(&me->screenTimeEvt, (QActive *)me,
-                            BSP_TICKS_PER_SEC*20U); /* 20s timeout */
-
-            me->blink_ctr = 0U; /* init the blink counter */
-            status_ = Q_HANDLED();
-            break;
-        }
-        /* @(/2/0/16/1/3) */
-        case Q_EXIT_SIG: {
-            QTimeEvt_disarm(&me->blinkTimeEvt);
-            QTimeEvt_disarm(&me->screenTimeEvt);
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/0/16/1/3/0) */
         case BLINK_TIMEOUT_SIG: {
             me->blink_ctr ^= 1U; /* toggle the blink cunter */
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/0/16/1/3/1) */
         case SCREEN_TIMEOUT_SIG: {
-            status_ = Q_TRAN(&Tunnel_screen_saver);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Tunnel_demo_x),
+                Q_ACTION_CAST(&Tunnel_screen_saver_i),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Tunnel_screen_saver_s, act_);
             break;
         }
         /* @(/2/0/16/1/3/2) */
@@ -596,44 +663,45 @@ static QState Tunnel_demo(Tunnel * const me, QEvt const * const e) {
                     (GAME_SCREEN_HEIGHT - 8U)/2U);
             }
             BSP_drawBitmap(l_frame);
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/0/16/1/3/3) */
         case PLAYER_TRIGGER_SIG: {
-            status_ = Q_TRAN(&Tunnel_playing);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Tunnel_demo_x),
+                Q_ACTION_CAST(&Tunnel_playing_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Tunnel_playing_s, act_);
             break;
         }
         default: {
-            status_ = Q_SUPER(&Tunnel_active);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/0/16/1/4) ..........................................................*/
+static QState Tunnel_playing_e(Tunnel * const me) {
+    static QEvt const takeoff = { TAKE_OFF_SIG, 0U, 0U };
+    me->minimal_gap = GAME_SCREEN_HEIGHT - 3u;
+    /* erase the walls */
+    memset(l_walls, (uint8_t)0,
+          (GAME_SCREEN_WIDTH * GAME_SCREEN_HEIGHT/8U));
+    QACTIVE_POST(AO_Ship, &takeoff, me); /* post the TAKEOFF sig */
+    return QM_ENTRY(&Tunnel_playing_s);
+}
+static QState Tunnel_playing_x(Tunnel * const me) {
+    QEvt recycle;
+    recycle.sig = MINE_RECYCLE_SIG;
+    Tunnel_dispatchToAllMines(me, &recycle); /* recycle all Mines */
+    return QM_EXIT(&Tunnel_playing_s);
+}
 static QState Tunnel_playing(Tunnel * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/0/16/1/4) */
-        case Q_ENTRY_SIG: {
-            static QEvt const takeoff = { TAKE_OFF_SIG, 0U, 0U };
-            me->minimal_gap = GAME_SCREEN_HEIGHT - 3u;
-            /* erase the walls */
-            memset(l_walls, (uint8_t)0,
-                  (GAME_SCREEN_WIDTH * GAME_SCREEN_HEIGHT/8U));
-            QACTIVE_POST(AO_Ship, &takeoff, me); /* post the TAKEOFF sig */
-            status_ = Q_HANDLED();
-            break;
-        }
-        /* @(/2/0/16/1/4) */
-        case Q_EXIT_SIG: {
-            QEvt recycle;
-            recycle.sig = MINE_RECYCLE_SIG;
-            Tunnel_dispatchToAllMines(me, &recycle); /* recycle all Mines */
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/0/16/1/4/0) */
         case TIME_TICK_SIG: {
             /* render this frame on the display */
@@ -641,7 +709,7 @@ static QState Tunnel_playing(Tunnel * const me, QEvt const * const e) {
             Tunnel_advance(me);
             Tunnel_plantMine(me);
             Tunnel_dispatchToAllMines(me, e);
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/0/16/1/4/1) */
@@ -657,7 +725,7 @@ static QState Tunnel_playing(Tunnel * const me, QEvt const * const e) {
             }
             Tunnel_addImageAt(me, bmp, x, y);
             Tunnel_dispatchToAllMines(me, e); /* let Mines check for hits */
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/0/16/1/4/2) */
@@ -673,7 +741,7 @@ static QState Tunnel_playing(Tunnel * const me, QEvt const * const e) {
             }
             Tunnel_addImageAt(me, bmp, x, y);
             Tunnel_dispatchToAllMines(me, e); /* let Mines check for hits */
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/0/16/1/4/3) */
@@ -682,7 +750,7 @@ static QState Tunnel_playing(Tunnel * const me, QEvt const * const e) {
                               Q_EVT_CAST(ObjectImageEvt)->bmp,
                               Q_EVT_CAST(ObjectImageEvt)->x,
                               Q_EVT_CAST(ObjectImageEvt)->y);
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/0/16/1/4/4) */
@@ -691,7 +759,7 @@ static QState Tunnel_playing(Tunnel * const me, QEvt const * const e) {
                               Q_EVT_CAST(ObjectImageEvt)->bmp,
                               Q_EVT_CAST(ObjectImageEvt)->x,
                               Q_EVT_CAST(ObjectImageEvt)->y);
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/0/16/1/4/5) */
@@ -702,11 +770,16 @@ static QState Tunnel_playing(Tunnel * const me, QEvt const * const e) {
             */
             me->minimal_gap = (uint8_t)(GAME_SCREEN_HEIGHT - 3U
                               - Q_EVT_CAST(ScoreEvt)->score/2000U);
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/0/16/1/4/6) */
         case GAME_OVER_SIG: {
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Tunnel_playing_x),
+                Q_ACTION_CAST(&Tunnel_game_over_e),
+                Q_ACTION_CAST(0)
+            };
             uint16_t score = Q_EVT_CAST(ScoreEvt)->score;
             char str[5];
             BSP_updateScore(score);
@@ -723,39 +796,34 @@ static QState Tunnel_playing(Tunnel * const me, QEvt const * const e) {
             str[1] = '0' + (score % 10U); score /= 10U;
             str[0] = '0' + (score % 10U);
             BSP_drawNString((GAME_SCREEN_WIDTH - 6U*10U)/2U + 6U*6U, 1U, str);
-            status_ = Q_TRAN(&Tunnel_game_over);
+            status_ = QM_TRAN(&Tunnel_game_over_s, act_);
             break;
         }
         default: {
-            status_ = Q_SUPER(&Tunnel_active);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/0/16/1/5) ..........................................................*/
+static QState Tunnel_game_over_e(Tunnel * const me) {
+    QTimeEvt_armX(&me->blinkTimeEvt, BSP_TICKS_PER_SEC/2U,
+                  BSP_TICKS_PER_SEC/2U);
+    QTimeEvt_armX(&me->screenTimeEvt, BSP_TICKS_PER_SEC*5U, 0U);
+    me->blink_ctr = 0U;
+    BSP_drawNString((GAME_SCREEN_WIDTH - 6U*9U)/2U, 0U, "Game Over");
+    return QM_ENTRY(&Tunnel_game_over_s);
+}
+static QState Tunnel_game_over_x(Tunnel * const me) {
+    QTimeEvt_disarm(&me->blinkTimeEvt);
+    QTimeEvt_disarm(&me->screenTimeEvt);
+    BSP_updateScore(0); /* update the score on the display */
+    return QM_EXIT(&Tunnel_game_over_s);
+}
 static QState Tunnel_game_over(Tunnel * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/0/16/1/5) */
-        case Q_ENTRY_SIG: {
-            QTimeEvt_postEvery(&me->blinkTimeEvt, (QActive *)me,
-                               BSP_TICKS_PER_SEC/2U); /* 1/2 sec */
-            QTimeEvt_postIn(&me->screenTimeEvt, (QActive *)me,
-                            BSP_TICKS_PER_SEC*5U); /* 5 sec timeout */
-            me->blink_ctr = 0U;
-            BSP_drawNString((GAME_SCREEN_WIDTH - 6U*9U)/2U, 0U, "Game Over");
-            status_ = Q_HANDLED();
-            break;
-        }
-        /* @(/2/0/16/1/5) */
-        case Q_EXIT_SIG: {
-            QTimeEvt_disarm(&me->blinkTimeEvt);
-            QTimeEvt_disarm(&me->screenTimeEvt);
-            BSP_updateScore(0); /* update the score on the display */
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/0/16/1/5/0) */
         case BLINK_TIMEOUT_SIG: {
             me->blink_ctr ^= 1U; /* toggle the blink couner */
@@ -763,131 +831,140 @@ static QState Tunnel_game_over(Tunnel * const me, QEvt const * const e) {
                             ((me->blink_ctr == 0U)
                             ? "Game Over"
                             : "         "));
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/0/16/1/5/1) */
         case SCREEN_TIMEOUT_SIG: {
-            status_ = Q_TRAN(&Tunnel_demo);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Tunnel_game_over_x),
+                Q_ACTION_CAST(&Tunnel_demo_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Tunnel_demo_s, act_);
             break;
         }
         default: {
-            status_ = Q_SUPER(&Tunnel_active);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/0/16/1/6) ..........................................................*/
+static QState Tunnel_screen_saver_i(Tunnel * const me) {
+    static QActionHandler const act_[] = {
+        Q_ACTION_CAST(&Tunnel_screen_saver_hide_e),
+        Q_ACTION_CAST(0)
+    };
+    return QM_INITIAL(&Tunnel_screen_saver_hide_s, act_);
+}
 static QState Tunnel_screen_saver(Tunnel * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/0/16/1/6/0) */
-        case Q_INIT_SIG: {
-            status_ = Q_TRAN(&Tunnel_screen_saver_hide);
-            break;
-        }
         /* @(/2/0/16/1/6/1) */
         case PLAYER_TRIGGER_SIG: {
-            status_ = Q_TRAN(&Tunnel_demo);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Tunnel_demo_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Tunnel_demo_s, act_);
             break;
         }
         default: {
-            status_ = Q_SUPER(&Tunnel_active);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/0/16/1/6/2) ........................................................*/
+static QState Tunnel_screen_saver_hide_e(Tunnel * const me) {
+    BSP_displayOff(); /* power down the display */
+    QTimeEvt_armX(&me->screenTimeEvt, BSP_TICKS_PER_SEC*3U, 0U);
+    return QM_ENTRY(&Tunnel_screen_saver_hide_s);
+}
+static QState Tunnel_screen_saver_hide_x(Tunnel * const me) {
+    QTimeEvt_disarm(&me->screenTimeEvt);
+    BSP_displayOn(); /* power up the display */
+    return QM_EXIT(&Tunnel_screen_saver_hide_s);
+}
 static QState Tunnel_screen_saver_hide(Tunnel * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/0/16/1/6/2) */
-        case Q_ENTRY_SIG: {
-            BSP_displayOff(); /* power down the display */
-            QTimeEvt_postIn(&me->screenTimeEvt, (QActive *)me,
-                            BSP_TICKS_PER_SEC*3U); /* 3s timeout */
-            status_ = Q_HANDLED();
-            break;
-        }
-        /* @(/2/0/16/1/6/2) */
-        case Q_EXIT_SIG: {
-            QTimeEvt_disarm(&me->screenTimeEvt);
-            BSP_displayOn(); /* power up the display */
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/0/16/1/6/2/0) */
         case SCREEN_TIMEOUT_SIG: {
-            status_ = Q_TRAN(&Tunnel_screen_saver_show);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Tunnel_screen_saver_hide_x),
+                Q_ACTION_CAST(&Tunnel_screen_saver_show_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Tunnel_screen_saver_show_s, act_);
             break;
         }
         default: {
-            status_ = Q_SUPER(&Tunnel_screen_saver);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/0/16/1/6/3) ........................................................*/
+static QState Tunnel_screen_saver_show_e(Tunnel * const me) {
+    uint32_t rnd = random();
+    /* clear the screen frame buffer */
+    memset(l_frame, (uint8_t)0,
+           (GAME_SCREEN_WIDTH * GAME_SCREEN_HEIGHT/8U));
+    Tunnel_addImageAt(me,
+            PRESS_BUTTON_BMP,
+            (uint8_t)(rnd % (GAME_SCREEN_WIDTH - 55U)),
+            (int8_t) (rnd % (GAME_SCREEN_HEIGHT - 8U)));
+    BSP_drawBitmap(l_frame);
+    QTimeEvt_armX(&me->screenTimeEvt, BSP_TICKS_PER_SEC/2U, 0U);
+    return QM_ENTRY(&Tunnel_screen_saver_show_s);
+}
+static QState Tunnel_screen_saver_show_x(Tunnel * const me) {
+    QTimeEvt_disarm(&me->screenTimeEvt);
+    /* clear the screen frame buffer */
+    memset(l_frame, (uint8_t)0,
+           (GAME_SCREEN_WIDTH * GAME_SCREEN_HEIGHT/8U));
+    BSP_drawBitmap(l_frame);
+    return QM_EXIT(&Tunnel_screen_saver_show_s);
+}
 static QState Tunnel_screen_saver_show(Tunnel * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/0/16/1/6/3) */
-        case Q_ENTRY_SIG: {
-            uint32_t rnd = random();
-            /* clear the screen frame buffer */
-            memset(l_frame, (uint8_t)0,
-                   (GAME_SCREEN_WIDTH * GAME_SCREEN_HEIGHT/8U));
-            Tunnel_addImageAt(me,
-                    PRESS_BUTTON_BMP,
-                    (uint8_t)(rnd % (GAME_SCREEN_WIDTH - 55U)),
-                    (int8_t) (rnd % (GAME_SCREEN_HEIGHT - 8U)));
-            BSP_drawBitmap(l_frame);
-            QTimeEvt_postIn(&me->screenTimeEvt, (QActive *)me,
-                            BSP_TICKS_PER_SEC/3U); /* 1/3 sec timeout */
-            status_ = Q_HANDLED();
-            break;
-        }
-        /* @(/2/0/16/1/6/3) */
-        case Q_EXIT_SIG: {
-            QTimeEvt_disarm(&me->screenTimeEvt);
-            /* clear the screen frame buffer */
-            memset(l_frame, (uint8_t)0,
-                   (GAME_SCREEN_WIDTH * GAME_SCREEN_HEIGHT/8U));
-            BSP_drawBitmap(l_frame);
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/0/16/1/6/3/0) */
         case SCREEN_TIMEOUT_SIG: {
-            status_ = Q_TRAN(&Tunnel_screen_saver_hide);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Tunnel_screen_saver_show_x),
+                Q_ACTION_CAST(&Tunnel_screen_saver_hide_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Tunnel_screen_saver_hide_s, act_);
             break;
         }
         default: {
-            status_ = Q_SUPER(&Tunnel_screen_saver);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/0/16/2) ............................................................*/
+static QState Tunnel_final_e(Tunnel * const me) {
+    /* clear the screen */
+    memset(l_frame, (uint8_t)0,
+          (GAME_SCREEN_WIDTH * GAME_SCREEN_HEIGHT/8));
+    BSP_drawBitmap(l_frame);
+    QF_stop(); /* stop QF and cleanup */
+    return QM_ENTRY(&Tunnel_final_s);
+}
 static QState Tunnel_final(Tunnel * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/0/16/2) */
-        case Q_ENTRY_SIG: {
-            /* clear the screen */
-            memset(l_frame, (uint8_t)0,
-                  (GAME_SCREEN_WIDTH * GAME_SCREEN_HEIGHT/8));
-            BSP_drawBitmap(l_frame);
-            QF_stop(); /* stop QF and cleanup */
-            status_ = Q_HANDLED();
-            break;
-        }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }

+ 0 - 54
examples/arm-cm/qk/gnu/dpp-qk_ek-lm3s811-lint/.dpp

@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<session version="2.3.0">
- <item name="license"></item>
- <group name="locked"/>
- <group name="settings">
-  <item name="tabs">1</item>
-  <item name="windows">0</item>
-  <item name="grid">3</item>
- </group>
- <group name="windows"/>
- <group name="vars"/>
- <group name="tools">
-  <group name="tool">
-   <item name="icon">0</item>
-   <item name="title"></item>
-   <item name="command"></item>
-   <item name="args"></item>
-   <item name="initial"></item>
-   <item name="options">0</item>
-  </group>
-  <group name="tool">
-   <item name="icon">0</item>
-   <item name="title"></item>
-   <item name="command"></item>
-   <item name="args"></item>
-   <item name="initial"></item>
-   <item name="options">0</item>
-  </group>
-  <group name="tool">
-   <item name="icon">0</item>
-   <item name="title"></item>
-   <item name="command"></item>
-   <item name="args"></item>
-   <item name="initial"></item>
-   <item name="options">0</item>
-  </group>
-  <group name="tool">
-   <item name="icon">0</item>
-   <item name="title"></item>
-   <item name="command"></item>
-   <item name="args"></item>
-   <item name="initial"></item>
-   <item name="options">0</item>
-  </group>
-  <group name="tool">
-   <item name="icon">0</item>
-   <item name="title"></item>
-   <item name="command"></item>
-   <item name="args"></item>
-   <item name="initial"></item>
-   <item name="options">0</item>
-  </group>
- </group>
-</session>

+ 35 - 30
examples/arm-cm/qk/gnu/dpp-qk_ek-lm3s811-lint/Makefile

@@ -1,7 +1,7 @@
 ##############################################################################
-# Product: Makefile for DPP EK-LM3811, QK kernel, GNU/Sourcery G++
-# Last Updated for Version: 5.0.0
-# Date of the Last Update:  Sep 07, 2013
+# Product: Makefile for EK-LM3811, QK kernel, GNU/Sourcery G++
+# Last Updated for Version: 5.2.0
+# Date of the Last Update:  Dec 17, 2013
 #
 #                    Q u a n t u m     L e a P s
 #                    ---------------------------
@@ -43,27 +43,6 @@
 # make CONF=rel clean
 # make CONF=spy clean
 
-PROJECT := dpp-qk
-
-#-----------------------------------------------------------------------------
-# GNU ARM compiler
-#
-ifeq ($(GNU_ARM),)
-GNU_ARM = C:/tools/CodeSourcery
-endif
-
-##############################################################################
-# Typically, you should not need to change anything below this line
-
-CC    := $(GNU_ARM)/bin/arm-none-eabi-gcc
-CPP   := $(GNU_ARM)/bin/arm-none-eabi-g++
-AS    := $(GNU_ARM)/bin/arm-none-eabi-as
-LINK  := $(GNU_ARM)/bin/arm-none-eabi-gcc
-BIN   := $(GNU_ARM)/bin/arm-none-eabi-objcopy
-RM    := rm -rf
-MKDIR := mkdir
-RM    := rm
-
 #-----------------------------------------------------------------------------
 # NOTE: the Makefile expects that the QPC environment variable is defined
 # and points to the QP/C installation directory
@@ -75,6 +54,9 @@ endif
 #-----------------------------------------------------------------------------
 # directories
 #
+
+PROJECT := dpp-qk
+
 QP_PORT_DIR := $(QPC)/ports/arm-cm/qk/gnu
 CMSIS_DIR   := $(QPC)/ports/arm-cm/cmsis
 APP_DIR     := .
@@ -87,7 +69,7 @@ VPATH = $(APP_DIR) \
 OUTPUT := $(PROJECT)
 
 # include directories
-INCLUDES  = -I$(QPC)/include	\
+INCLUDES  = -I$(QPC)/include \
 	-I$(QP_PORT_DIR) \
 	-I. \
 	-I$(CMSIS_DIR)
@@ -96,6 +78,29 @@ INCLUDES  = -I$(QPC)/include	\
 DEFINES =
 
 ARM_CORE = cortex-m3
+ARM_FPU  =
+
+LD_SCRIPT := $(PROJECT).ld
+LIBS      := -lqp_$(ARM_CORE)_cs
+
+#-----------------------------------------------------------------------------
+# GNU ARM compiler
+#
+ifeq ($(GNU_ARM),)
+GNU_ARM = C:/tools/CodeSourcery
+endif
+
+##############################################################################
+# Typically, you should not need to change anything below this line
+
+CC    := $(GNU_ARM)/bin/arm-none-eabi-gcc
+CPP   := $(GNU_ARM)/bin/arm-none-eabi-g++
+AS    := $(GNU_ARM)/bin/arm-none-eabi-as
+LINK  := $(GNU_ARM)/bin/arm-none-eabi-gcc
+BIN   := $(GNU_ARM)/bin/arm-none-eabi-objcopy
+RM    := rm -rf
+MKDIR := mkdir
+RM    := rm
 
 #-----------------------------------------------------------------------------
 # files
@@ -110,15 +115,10 @@ C_SRCS := $(wildcard *.c)
 # C++ source files
 CPP_SRCS :=	$(wildcard *.cpp)
 
-LD_SCRIPT := lm3s811.ld
-LIBS    := -lqp_$(ARM_CORE)_cs
-
 #-----------------------------------------------------------------------------
 # build options for various configurations
 #
 
-ARM_CORE = cortex-m3
-
 ifeq (rel, $(CONF))       # Release configuration ............................
 
 BIN_DIR := rel
@@ -217,7 +217,12 @@ $(BIN_DIR)/%.o : %.c
 $(BIN_DIR)/%.o : %.cpp
 	$(CPP) $(CPPFLAGS) -c $< -o $@
 
+# include dependency files only if our goal depends on their existence
+ifneq ($(MAKECMDGOALS),clean)
+  ifneq ($(MAKECMDGOALS),show)
 -include $(C_DEPS_EXT) $(CPP_DEPS_EXT)
+  endif
+endif
 
 
 .PHONY : clean

+ 9 - 12
examples/arm-cm/qk/gnu/dpp-qk_ek-lm3s811-lint/bsp.c

@@ -1,7 +1,7 @@
 /*****************************************************************************
 * Product: "Dining Philosophers Problem" example, preemptive QK kernel
-* Last Updated for Version: 5.1.0
-* Date of the Last Update:  Sep 19, 2013
+* Last Updated for Version: 5.2.0
+* Date of the Last Update:  Dec 25, 2013
 *
 *                    Q u a n t u m     L e a P s
 *                    ---------------------------
@@ -64,7 +64,6 @@ Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
 /* ISRs defined in this BSP ------------------------------------------------*/
 void SysTick_Handler(void);
 void GPIOPortA_IRQHandler(void);
-void assert_failed(char const *file, int line);
 
 /* Local-scope objects -----------------------------------------------------*/
 static unsigned  l_rnd;                                      /* random seed */
@@ -104,7 +103,7 @@ void SysTick_Handler(void) {
     }
 #endif
 
-    QF_TICK(&l_SysTick_Handler);           /* process all armed time events */
+    QF_TICK_X(0U, &l_SysTick_Handler);    /* process time events for rate 0 */
 
                                              /* debounce the USER button... */
     btn = GPIOC->DATA_Bits[PUSH_BUTTON];               /* read the push btn */
@@ -186,7 +185,6 @@ void BSP_init(void) {
     if (QS_INIT((void *)0) == 0) {    /* initialize the QS software tracing */
         Q_ERROR();
     }
-    QS_RESET();
     QS_OBJ_DICTIONARY(&l_SysTick_Handler);
     QS_OBJ_DICTIONARY(&l_GPIOPortA_IRQHandler);
 }
@@ -279,17 +277,16 @@ void QK_onIdle(void) {
 }
 
 /*..........................................................................*/
-void Q_onAssert(char_t const Q_ROM * const Q_ROM_VAR file, int_t line) {
-    (void)file;                                   /* avoid compiler warning */
-    (void)line;                                   /* avoid compiler warning */
-    QF_INT_DISABLE();         /* make sure that all interrupts are disabled */
-    for (;;) {       /* NOTE: replace the loop with reset for final version */
-    }
+void Q_onAssert(char const Q_ROM * const file, int_t line) {
+    assert_failed(file, line);
 }
 /*..........................................................................*/
 /* error routine that is called if the CMSIS library encounters an error    */
 void assert_failed(char const *file, int line) {
-    Q_onAssert(file, line);
+    (void)file;                                   /* avoid compiler warning */
+    (void)line;                                   /* avoid compiler warning */
+    QF_INT_DISABLE();         /* make sure that all interrupts are disabled */
+    NVIC_SystemReset();                             /* perform system reset */
 }
 
 /*--------------------------------------------------------------------------*/

+ 20 - 37
examples/arm-cm/vanilla/gnu/lwip_ek-lm3s6965/lm3s6965.ld → examples/arm-cm/qk/gnu/dpp-qk_ek-lm3s811-lint/dpp-qk.ld

@@ -1,42 +1,26 @@
 /*****************************************************************************
-* Product: GNU linker script for Stellaris LM3S6965 MCUs
-* Last Updated for Version: 4.1.03
-* Date of the Last Update:  Mar 11, 2010
+* Product: Makefile for EK-TM4C123GXL, GNU/Sourcery
+* Date of the Last Update: Dec 13, 2013
 *
-*                    Q u a n t u m     L e a P s
-*                    ---------------------------
-*                    innovating embedded systems
+* Copyright (C) 2002-2013 Quantum Leaps, www.state-machine.com
 *
-* Copyright (C) 2002-2010 Quantum Leaps, LLC. All rights reserved.
-*
-* 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 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.
-*
-* Contact information:
-* Quantum Leaps Web site:  http://www.quantum-leaps.com
-* e-mail:                  info@quantum-leaps.com
+* This program is free software. It comes without any warranty, to the extent
+* permitted by applicable law. You can redistribute it and/or modify it under
+* the terms of the WTFPL, Version 2, as published by Sam Hocevar. See
+* http://www.wtfpl.net/ for more details.
 *****************************************************************************/
 
 OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
 OUTPUT_ARCH(arm)
 ENTRY(Reset_Handler)                                         /* entry Point */
 
-MEMORY {                                          /* memory map of LM3S6965 */
+MEMORY {                                 /* memory map of Tiva TM4C123GH6PM */
     ROM (rx)  : ORIGIN = 0x00000000, LENGTH = 256K
-    RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
+    RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K
 }
 
 /* The size of the stack used by the application. NOTE: you need to adjust  */
-STACK_SIZE = 1024;
+STACK_SIZE = 1000;
 
 /* The size of the heap used by the application. NOTE: you need to adjust   */
 HEAP_SIZE = 0;
@@ -83,6 +67,13 @@ SECTIONS {
 
     _etext = .;                            /* global symbols at end of code */
 
+    .stack : {
+        __stack_start__ = .;
+        . = . + STACK_SIZE;
+        . = ALIGN(4);
+        __stack_end__ = .;
+    } >RAM
+
     .data :  AT (_etext) {
         __data_load = LOADADDR (.data);
         __data_start = .;
@@ -94,7 +85,7 @@ SECTIONS {
     } >RAM
 
     .bss : {
-        __bss_start__ = . ;
+        __bss_start__ = .;
         *(.bss)
         *(.bss*)
         *(COMMON)
@@ -108,18 +99,10 @@ SECTIONS {
     PROVIDE ( __end__ = _ebss );
 
     .heap : {
-        __heap_start__ = . ;
+        __heap_start__ = .;
         . = . + HEAP_SIZE;
         . = ALIGN(4);
-        __heap_end__ = . ;
-    } >RAM
-
-    .stack : {
-        __stack_start__ = . ;
-        . = . + STACK_SIZE;
-        . = ALIGN(4);
-        __c_stack_top__ = . ;
-        __stack_end__ = . ;
+        __heap_end__ = .;
     } >RAM
 
     /* Remove information from the standard libraries */

+ 12 - 3
examples/arm-cm/qk/gnu/dpp-qk_ek-lm3s811-lint/dpp.h

@@ -2,10 +2,17 @@
 * Model: dpp.qm
 * File:  ./dpp.h
 *
-* This file has been generated automatically by QP Modeler (QM).
-* DO NOT EDIT THIS FILE MANUALLY.
+* This code has been generated by QM tool (see state-machine.com/qm).
+* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
 *
-* Please visit www.state-machine.com/qm for more information.
+* 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.
+*
+* 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.
 *****************************************************************************/
 /* @(/3/0) .................................................................*/
 #ifndef dpp_h
@@ -43,6 +50,8 @@ void Table_ctor(void);
 
 
 extern QActive * const AO_Philo[N_PHILO];
+
 extern QActive * const AO_Table;
 
+
 #endif                    /* dpp_h */

+ 57 - 9
examples/arm-cm/qk/gnu/dpp-qk_ek-lm3s811-lint/dpp.qm

@@ -1,6 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<model version="2.3.0">
- <documentation>Dining Philosopher Problem example</documentation>
+<model version="3.0.0">
+ <documentation>Dining Philosopher Problem example
+
+NOTE: Requries QP 5.</documentation>
  <framework name="qpc"/>
  <package name="Events" stereotype="0x01">
   <class name="TableEvt" superclass="qpc::QEvt">
@@ -8,7 +10,7 @@
   </class>
  </package>
  <package name="AOs" stereotype="0x02">
-  <class name="Philo" superclass="qpc::QActive">
+  <class name="Philo" superclass="qpc::QMActive">
    <attribute name="timeEvt" type="QTimeEvt" visibility="0x02" properties="0x00"/>
    <statechart>
     <initial target="../1">
@@ -42,7 +44,7 @@ QActive_subscribe(&amp;me-&gt;super, EAT_SIG);</action>
      </initial_glyph>
     </initial>
     <state name="thinking">
-     <entry>QTimeEvt_postIn(&amp;me-&gt;timeEvt, &amp;me-&gt;super, THINK_TIME);</entry>
+     <entry>QTimeEvt_armX(&amp;me-&gt;timeEvt, THINK_TIME, 0U);</entry>
      <tran trig="TIMEOUT" target="../../2">
       <tran_glyph conn="2,12,3,1,20,13,-3">
        <action box="0,-2,6,2"/>
@@ -86,7 +88,7 @@ Q_ASSERT(Q_EVT_CAST(TableEvt)-&gt;philoNum != PHILO_ID(me));</action>
      </state_glyph>
     </state>
     <state name="eating">
-     <entry>QTimeEvt_postIn(&amp;me-&gt;timeEvt, &amp;me-&gt;super, EAT_TIME);</entry>
+     <entry>QTimeEvt_armX(&amp;me-&gt;timeEvt, EAT_TIME, 0U);</entry>
      <exit>TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
 pe-&gt;philoNum = PHILO_ID(me);
 QF_PUBLISH(&amp;pe-&gt;super, me);</exit>
@@ -110,7 +112,7 @@ Q_ASSERT(Q_EVT_CAST(TableEvt)-&gt;philoNum != PHILO_ID(me));</action>
     <state_diagram size="37,61"/>
    </statechart>
   </class>
-  <class name="Table" superclass="qpc::QActive">
+  <class name="Table" superclass="qpc::QMActive">
    <attribute name="fork[N_PHILO]" type="uint8_t" visibility="0x02" properties="0x00"/>
    <attribute name="isHungry[N_PHILO]" type="uint8_t" visibility="0x02" properties="0x00"/>
    <statechart>
@@ -316,15 +318,15 @@ me-&gt;fork[n] = FREE;</action>
 Philo *me;
 for (n = 0U; n &lt; N_PHILO; ++n) {
     me = &amp;l_philo[n];
-    QActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Philo_initial));
-    QTimeEvt_ctor(&amp;me-&gt;timeEvt, TIMEOUT_SIG);
+    QMActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Philo_initial));
+    QTimeEvt_ctorX(&amp;me-&gt;timeEvt, &amp;me-&gt;super, TIMEOUT_SIG, 0U);
 }</code>
   </operation>
   <operation name="Table_ctor" type="void" visibility="0x00" properties="0x00">
    <code>uint8_t n;
 Table *me = &amp;l_table;
 
-QActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Table_initial));
+QMActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Table_initial));
 
 for (n = 0U; n &lt; N_PHILO; ++n) {
     me-&gt;fork[n] = FREE;
@@ -424,5 +426,51 @@ QActive * const AO_Table = &amp;l_table.super; /* &quot;opaque&quot; AO pointer
 $define(AOs::Table_ctor)
 $define(AOs::Table)</text>
   </file>
+  <file name="main.c">
+   <text>#include &quot;qp_port.h&quot;
+#include &quot;dpp.h&quot;
+#include &quot;bsp.h&quot;
+
+/*..........................................................................*/
+int main() {
+    static QEvt const *tableQueueSto[N_PHILO];
+    static QEvt const *philoQueueSto[N_PHILO][N_PHILO];
+    static QSubscrList subscrSto[MAX_PUB_SIG];
+    static QF_MPOOL_EL(TableEvt) smlPoolSto[2*N_PHILO];       /* small pool */
+    uint8_t n;
+
+    Philo_ctor();             /* instantiate all Philosopher active objects */
+    Table_ctor();                    /* instantiate the Table active object */
+
+    QF_init();     /* initialize the framework and the underlying RT kernel */
+    BSP_init();                     /* initialize the Board Support Package */
+
+                                                  /* object dictionaries... */
+    QS_OBJ_DICTIONARY(smlPoolSto);
+    QS_OBJ_DICTIONARY(tableQueueSto);
+    QS_OBJ_DICTIONARY(philoQueueSto[0]);
+    QS_OBJ_DICTIONARY(philoQueueSto[1]);
+    QS_OBJ_DICTIONARY(philoQueueSto[2]);
+    QS_OBJ_DICTIONARY(philoQueueSto[3]);
+    QS_OBJ_DICTIONARY(philoQueueSto[4]);
+
+    QF_psInit(subscrSto, Q_DIM(subscrSto));       /* init publish-subscribe */
+
+                                               /* initialize event pools... */
+    QF_poolInit(smlPoolSto, sizeof(smlPoolSto), sizeof(smlPoolSto[0]));
+
+    for (n = 0U; n &lt; N_PHILO; ++n) {         /* start the active objects... */
+        QACTIVE_START(AO_Philo[n], (uint8_t)(n + 1),
+                      philoQueueSto[n], Q_DIM(philoQueueSto[n]),
+                      (void *)0, 0U, (QEvt *)0);
+    }
+    QACTIVE_START(AO_Table, (uint8_t)(N_PHILO + 1),
+                  tableQueueSto, Q_DIM(tableQueueSto),
+                  (void *)0, 0U, (QEvt *)0);
+
+    return QF_run();                              /* run the QF application */
+}
+</text>
+  </file>
  </directory>
 </model>

+ 31 - 51
examples/arm-cm/qk/gnu/dpp-qk_ek-lm3s811-lint/main.c

@@ -1,81 +1,61 @@
 /*****************************************************************************
-* Product: DPP example
-* Last Updated for Version: 4.5.02
-* Date of the Last Update:  Jul 04, 2012
+* Model: dpp.qm
+* File:  ./main.c
 *
-*                    Q u a n t u m     L e a P s
-*                    ---------------------------
-*                    innovating embedded systems
-*
-* Copyright (C) 2002-2012 Quantum Leaps, LLC. All rights reserved.
+* This code has been generated by QM tool (see state-machine.com/qm).
+* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
 *
 * 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 3 of the License, or
-* (at your option) any later version.
-*
-* 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.
-*
-* 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/>.
+* by the Free Software Foundation.
 *
-* Contact information:
-* Quantum Leaps Web sites: http://www.quantum-leaps.com
-*                          http://www.state-machine.com
-* e-mail:                  info@quantum-leaps.com
+* 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.
 *****************************************************************************/
+/* @(/3/3) .................................................................*/
 #include "qp_port.h"
 #include "dpp.h"
 #include "bsp.h"
 
-/* Local-scope objects -----------------------------------------------------*/
-static QEvt const *l_tableQueueSto[N_PHILO];
-static QEvt const *l_philoQueueSto[N_PHILO][N_PHILO];
-static QSubscrList l_subscrSto[MAX_PUB_SIG];
-
-/* storage for event pools... */
-static QF_MPOOL_EL(TableEvt) l_smlPoolSto[2*N_PHILO];         /* small pool */
-
 /*..........................................................................*/
-int main(void) {
+int main() {
+    static QEvt const *tableQueueSto[N_PHILO];
+    static QEvt const *philoQueueSto[N_PHILO][N_PHILO];
+    static QSubscrList subscrSto[MAX_PUB_SIG];
+    static QF_MPOOL_EL(TableEvt) smlPoolSto[2*N_PHILO];       /* small pool */
     uint8_t n;
 
     Philo_ctor();             /* instantiate all Philosopher active objects */
     Table_ctor();                    /* instantiate the Table active object */
 
     QF_init();     /* initialize the framework and the underlying RT kernel */
-    BSP_init();                                       /* initialize the BSP */
+    BSP_init();                     /* initialize the Board Support Package */
 
                                                   /* object dictionaries... */
-    QS_OBJ_DICTIONARY(l_smlPoolSto);
-    QS_OBJ_DICTIONARY(l_tableQueueSto);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[0]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[1]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[2]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[3]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[4]);
+    QS_OBJ_DICTIONARY(smlPoolSto);
+    QS_OBJ_DICTIONARY(tableQueueSto);
+    QS_OBJ_DICTIONARY(philoQueueSto[0]);
+    QS_OBJ_DICTIONARY(philoQueueSto[1]);
+    QS_OBJ_DICTIONARY(philoQueueSto[2]);
+    QS_OBJ_DICTIONARY(philoQueueSto[3]);
+    QS_OBJ_DICTIONARY(philoQueueSto[4]);
 
-    QF_psInit(l_subscrSto, Q_DIM(l_subscrSto));   /* init publish-subscribe */
+    QF_psInit(subscrSto, Q_DIM(subscrSto));       /* init publish-subscribe */
 
                                                /* initialize event pools... */
-    QF_poolInit(l_smlPoolSto, sizeof(l_smlPoolSto), sizeof(l_smlPoolSto[0]));
+    QF_poolInit(smlPoolSto, sizeof(smlPoolSto), sizeof(smlPoolSto[0]));
 
-    for (n = 0; n < N_PHILO; ++n) {          /* start the active objects... */
-        QActive_start(AO_Philo[n], (uint8_t)(n + 1),
-                      l_philoQueueSto[n], Q_DIM(l_philoQueueSto[n]),
+    for (n = 0U; n < N_PHILO; ++n) {         /* start the active objects... */
+        QACTIVE_START(AO_Philo[n], (uint8_t)(n + 1),
+                      philoQueueSto[n], Q_DIM(philoQueueSto[n]),
                       (void *)0, 0U, (QEvt *)0);
     }
-    QActive_start(AO_Table, (uint8_t)(N_PHILO + 1),
-                  l_tableQueueSto, Q_DIM(l_tableQueueSto),
+    QACTIVE_START(AO_Table, (uint8_t)(N_PHILO + 1),
+                  tableQueueSto, Q_DIM(tableQueueSto),
                   (void *)0, 0U, (QEvt *)0);
 
     return QF_run();                              /* run the QF application */
 }
+

+ 83 - 48
examples/arm-cm/qk/gnu/dpp-qk_ek-lm3s811-lint/philo.c

@@ -2,10 +2,17 @@
 * Model: dpp.qm
 * File:  ./philo.c
 *
-* This file has been generated automatically by QP Modeler (QM).
-* DO NOT EDIT THIS FILE MANUALLY.
+* This code has been generated by QM tool (see state-machine.com/qm).
+* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
 *
-* Please visit www.state-machine.com/qm for more information.
+* 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.
+*
+* 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.
 *****************************************************************************/
 /* @(/3/1) .................................................................*/
 #include "qp_port.h"
@@ -18,7 +25,7 @@ Q_DEFINE_THIS_FILE
 /* @(/2/0) .................................................................*/
 typedef struct PhiloTag {
 /* protected: */
-    QActive super;
+    QMActive super;
 
 /* private: */
     QTimeEvt timeEvt;
@@ -26,9 +33,28 @@ typedef struct PhiloTag {
 
 /* protected: */
 static QState Philo_initial(Philo * const me, QEvt const * const e);
-static QState Philo_thinking(Philo * const me, QEvt const * const e);
-static QState Philo_hungry(Philo * const me, QEvt const * const e);
-static QState Philo_eating(Philo * const me, QEvt const * const e);
+static QState Philo_thinking  (Philo * const me, QEvt const * const e);
+static QState Philo_thinking_e(Philo * const me);
+static QMState const Philo_thinking_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Philo_thinking),
+    Q_ACTION_CAST(0)
+};
+static QState Philo_hungry  (Philo * const me, QEvt const * const e);
+static QState Philo_hungry_e(Philo * const me);
+static QMState const Philo_hungry_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Philo_hungry),
+    Q_ACTION_CAST(0)
+};
+static QState Philo_eating  (Philo * const me, QEvt const * const e);
+static QState Philo_eating_e(Philo * const me);
+static QState Philo_eating_x(Philo * const me);
+static QMState const Philo_eating_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Philo_eating),
+    Q_ACTION_CAST(&Philo_eating_x)
+};
 
 
 /* Local objects -----------------------------------------------------------*/
@@ -62,14 +88,18 @@ void Philo_ctor(void) {
     Philo *me;
     for (n = 0U; n < N_PHILO; ++n) {
         me = &l_philo[n];
-        QActive_ctor(&me->super, Q_STATE_CAST(&Philo_initial));
-        QTimeEvt_ctor(&me->timeEvt, TIMEOUT_SIG);
+        QMActive_ctor(&me->super, Q_STATE_CAST(&Philo_initial));
+        QTimeEvt_ctorX(&me->timeEvt, &me->super, TIMEOUT_SIG, 0U);
     }
 }
 /* @(/2/0) .................................................................*/
 /* @(/2/0/1) ...............................................................*/
 /* @(/2/0/1/0) */
 static QState Philo_initial(Philo * const me, QEvt const * const e) {
+    static QActionHandler const act_[] = {
+        Q_ACTION_CAST(&Philo_thinking_e),
+        Q_ACTION_CAST(0)
+    };
     static uint8_t registered = (uint8_t)0; /* starts off with 0, per C-standard */
     (void)e; /* suppress the compiler warning about unused parameter */
     if (registered == (uint8_t)0) {
@@ -95,21 +125,23 @@ static QState Philo_initial(Philo * const me, QEvt const * const e) {
     QS_SIG_DICTIONARY(TIMEOUT_SIG, me); /* signal for each Philos */
 
     QActive_subscribe(&me->super, EAT_SIG);
-    return Q_TRAN(&Philo_thinking);
+    return QM_INITIAL(&Philo_thinking_s, act_);
 }
 /* @(/2/0/1/1) .............................................................*/
+static QState Philo_thinking_e(Philo * const me) {
+    QTimeEvt_armX(&me->timeEvt, THINK_TIME, 0U);
+    return QM_ENTRY(&Philo_thinking_s);
+}
 static QState Philo_thinking(Philo * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/0/1/1) */
-        case Q_ENTRY_SIG: {
-            QTimeEvt_postIn(&me->timeEvt, &me->super, THINK_TIME);
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/0/1/1/0) */
         case TIMEOUT_SIG: {
-            status_ = Q_TRAN(&Philo_hungry);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Philo_hungry_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Philo_hungry_s, act_);
             break;
         }
         /* @(/2/0/1/1/1) */
@@ -117,36 +149,38 @@ static QState Philo_thinking(Philo * const me, QEvt const * const e) {
         case DONE_SIG: {
             /* EAT or DONE must be for other Philos than this one */
             Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/0/1/2) .............................................................*/
+static QState Philo_hungry_e(Philo * const me) {
+    TableEvt *pe = Q_NEW(TableEvt, HUNGRY_SIG);
+    pe->philoNum = PHILO_ID(me);
+    QACTIVE_POST(AO_Table, &pe->super, me);
+    return QM_ENTRY(&Philo_hungry_s);
+}
 static QState Philo_hungry(Philo * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/0/1/2) */
-        case Q_ENTRY_SIG: {
-            TableEvt *pe = Q_NEW(TableEvt, HUNGRY_SIG);
-            pe->philoNum = PHILO_ID(me);
-            QACTIVE_POST(AO_Table, &pe->super, me);
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/0/1/2/0) */
         case EAT_SIG: {
             /* @(/2/0/1/2/0/0) */
             if (Q_EVT_CAST(TableEvt)->philoNum == PHILO_ID(me)) {
-                status_ = Q_TRAN(&Philo_eating);
+                static QActionHandler const act_[] = {
+                    Q_ACTION_CAST(&Philo_eating_e),
+                    Q_ACTION_CAST(0)
+                };
+                status_ = QM_TRAN(&Philo_eating_s, act_);
             }
             else {
-                status_ = Q_UNHANDLED();
+                status_ = QM_UNHANDLED();
             }
             break;
         }
@@ -154,37 +188,38 @@ static QState Philo_hungry(Philo * const me, QEvt const * const e) {
         case DONE_SIG: {
             /* DONE must be for other Philos than this one */
             Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/0/1/3) .............................................................*/
+static QState Philo_eating_e(Philo * const me) {
+    QTimeEvt_armX(&me->timeEvt, EAT_TIME, 0U);
+    return QM_ENTRY(&Philo_eating_s);
+}
+static QState Philo_eating_x(Philo * const me) {
+    TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
+    pe->philoNum = PHILO_ID(me);
+    QF_PUBLISH(&pe->super, me);
+    return QM_EXIT(&Philo_eating_s);
+}
 static QState Philo_eating(Philo * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/0/1/3) */
-        case Q_ENTRY_SIG: {
-            QTimeEvt_postIn(&me->timeEvt, &me->super, EAT_TIME);
-            status_ = Q_HANDLED();
-            break;
-        }
-        /* @(/2/0/1/3) */
-        case Q_EXIT_SIG: {
-            TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
-            pe->philoNum = PHILO_ID(me);
-            QF_PUBLISH(&pe->super, me);
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/0/1/3/0) */
         case TIMEOUT_SIG: {
-            status_ = Q_TRAN(&Philo_thinking);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Philo_eating_x),
+                Q_ACTION_CAST(&Philo_thinking_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Philo_thinking_s, act_);
             break;
         }
         /* @(/2/0/1/3/1) */
@@ -192,11 +227,11 @@ static QState Philo_eating(Philo * const me, QEvt const * const e) {
         case DONE_SIG: {
             /* EAT or DONE must be for other Philos than this one */
             Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }

+ 181 - 148
examples/arm-cm/qk/gnu/dpp-qk_ek-lm3s811-lint/startup_lm3s.c

@@ -1,103 +1,115 @@
 /*****************************************************************************
-* Purpose: CMSIS-compliant startup code for LM3S Cortex-M3 devices, GNU
-* Last Updated for Version: 4.1.03
-* Date of the Last Update:  Mar 03, 2010
+* Purpose: CMSIS-compliant startup code for LM3S Cortex-M3 devices, GNU-ARM
+* Last Updated for Version: 5.2.0
+* Date of the Last Update:  Dec 24, 2013
 *
 *                    Q u a n t u m     L e a P s
 *                    ---------------------------
 *                    innovating embedded systems
 *
-* Copyright (C) 2002-2010 Quantum Leaps, LLC. All rights reserved.
+* Copyright (C) 2002-2013 Quantum Leaps, LLC. All rights reserved.
 *
-* 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").
+* 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 3 of the License, or
+* (at your option) any later version.
 *
-* Alternatively, this software may be distributed and modified under the
+* Alternatively, this program 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.
+* the GNU General Public License 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
 *****************************************************************************/
-void __attribute__ ((weak)) Reset_Handler(void);
-void __attribute__ ((weak)) NMI_Handler(void);
-void __attribute__ ((weak)) HardFault_Handler(void);
-void __attribute__ ((weak)) MemManage_Handler(void);
-void __attribute__ ((weak)) BusFault_Handler(void);
-void __attribute__ ((weak)) UsageFault_Handler(void);
-void __attribute__ ((weak)) MemManage_Handler(void);
-void __attribute__ ((weak)) SVC_Handler(void);
-void __attribute__ ((weak)) DebugMon_Handler(void);
-void __attribute__ ((weak)) PendSV_Handler(void);
-void __attribute__ ((weak)) SysTick_Handler(void);
 
-                                                  /* external interrupts... */
-void __attribute__ ((weak)) GPIOPortA_IRQHandler(void);
-void __attribute__ ((weak)) GPIOPortB_IRQHandler(void);
-void __attribute__ ((weak)) GPIOPortC_IRQHandler(void);
-void __attribute__ ((weak)) GPIOPortD_IRQHandler(void);
-void __attribute__ ((weak)) GPIOPortE_IRQHandler(void);
-void __attribute__ ((weak)) UART0_IRQHandler(void);
-void __attribute__ ((weak)) UART1_IRQHandler(void);
-void __attribute__ ((weak)) SSI0_IRQHandler(void);
-void __attribute__ ((weak)) I2C0_IRQHandler(void);
-void __attribute__ ((weak)) PWMFault_IRQHandler(void);
-void __attribute__ ((weak)) PWMGen0_IRQHandler(void);
-void __attribute__ ((weak)) PWMGen1_IRQHandler(void);
-void __attribute__ ((weak)) PWMGen2_IRQHandler(void);
-void __attribute__ ((weak)) QEI0_IRQHandler(void);
-void __attribute__ ((weak)) ADCSeq0_IRQHandler(void);
-void __attribute__ ((weak)) ADCSeq1_IRQHandler(void);
-void __attribute__ ((weak)) ADCSeq2_IRQHandler(void);
-void __attribute__ ((weak)) ADCSeq3_IRQHandler(void);
-void __attribute__ ((weak)) Watchdog_IRQHandler(void);
-void __attribute__ ((weak)) Timer0A_IRQHandler(void);
-void __attribute__ ((weak)) Timer0B_IRQHandler(void);
-void __attribute__ ((weak)) Timer1A_IRQHandler(void);
-void __attribute__ ((weak)) Timer1B_IRQHandler(void);
-void __attribute__ ((weak)) Timer2A_IRQHandler(void);
-void __attribute__ ((weak)) Timer2B_IRQHandler(void);
-void __attribute__ ((weak)) Comp0_IRQHandler(void);
-void __attribute__ ((weak)) Comp1_IRQHandler(void);
-void __attribute__ ((weak)) Comp2_IRQHandler(void);
-void __attribute__ ((weak)) SysCtrl_IRQHandler(void);
-void __attribute__ ((weak)) FlashCtrl_IRQHandler(void);
-void __attribute__ ((weak)) GPIOPortF_IRQHandler(void);
-void __attribute__ ((weak)) GPIOPortG_IRQHandler(void);
-void __attribute__ ((weak)) GPIOPortH_IRQHandler(void);
-void __attribute__ ((weak)) UART2_IRQHandler(void);
-void __attribute__ ((weak)) SSI1_IRQHandler(void);
-void __attribute__ ((weak)) Timer3A_IRQHandler(void);
-void __attribute__ ((weak)) Timer3B_IRQHandler(void);
-void __attribute__ ((weak)) I2C1_IRQHandler(void);
-void __attribute__ ((weak)) QEI1_IRQHandler(void);
-void __attribute__ ((weak)) CAN0_IRQHandler(void);
-void __attribute__ ((weak)) CAN1_IRQHandler(void);
-void __attribute__ ((weak)) CAN2_IRQHandler(void);
-void __attribute__ ((weak)) Ethernet_IRQHandler(void);
-void __attribute__ ((weak)) Hibernate_IRQHandler(void);
+/* Function prototypes -----------------------------------------------------*/
+void Reset_Handler(void);
+void NMI_Handler(void);
+void HardFault_Handler(void);
+void MemManage_Handler(void);
+void BusFault_Handler(void);
+void UsageFault_Handler(void);
+void HardFault_Handler(void);
+void Spurious_Handler(void);
+
+void assert_failed(char const *file, int line);       /* defined in the BSP */
+
+/*----------------------------------------------------------------------------
+* weak aliases for each Exception handler to the Spurious_Handler.
+* Any function with the same name will override these definitions.
+*/
+__attribute__ ((weak)) void SVC_Handler(void);
+__attribute__ ((weak)) void DebugMon_Handler(void);
+__attribute__ ((weak)) void PendSV_Handler(void);
+__attribute__ ((weak)) void SysTick_Handler(void);
+__attribute__ ((weak)) void Spurious_Handler(void);
+
+/* external interrupts... */
+__attribute__ ((weak)) void GPIOPortA_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortB_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortC_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortD_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortE_IRQHandler(void);
+__attribute__ ((weak)) void UART0_IRQHandler(void);
+__attribute__ ((weak)) void UART1_IRQHandler(void);
+__attribute__ ((weak)) void SSI0_IRQHandler(void);
+__attribute__ ((weak)) void I2C0_IRQHandler(void);
+__attribute__ ((weak)) void PWMFault_IRQHandler(void);
+__attribute__ ((weak)) void PWMGen0_IRQHandler(void);
+__attribute__ ((weak)) void PWMGen1_IRQHandler(void);
+__attribute__ ((weak)) void PWMGen2_IRQHandler(void);
+__attribute__ ((weak)) void QEI0_IRQHandler(void);
+__attribute__ ((weak)) void ADCSeq0_IRQHandler(void);
+__attribute__ ((weak)) void ADCSeq1_IRQHandler(void);
+__attribute__ ((weak)) void ADCSeq2_IRQHandler(void);
+__attribute__ ((weak)) void ADCSeq3_IRQHandler(void);
+__attribute__ ((weak)) void Watchdog_IRQHandler(void);
+__attribute__ ((weak)) void Timer0A_IRQHandler(void);
+__attribute__ ((weak)) void Timer0B_IRQHandler(void);
+__attribute__ ((weak)) void Timer1A_IRQHandler(void);
+__attribute__ ((weak)) void Timer1B_IRQHandler(void);
+__attribute__ ((weak)) void Timer2A_IRQHandler(void);
+__attribute__ ((weak)) void Timer2B_IRQHandler(void);
+__attribute__ ((weak)) void Comp0_IRQHandler(void);
+__attribute__ ((weak)) void Comp1_IRQHandler(void);
+__attribute__ ((weak)) void Comp2_IRQHandler(void);
+__attribute__ ((weak)) void SysCtrl_IRQHandler(void);
+__attribute__ ((weak)) void FlashCtrl_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortF_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortG_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortH_IRQHandler(void);
+__attribute__ ((weak)) void UART2_IRQHandler(void);
+__attribute__ ((weak)) void SSI1_IRQHandler(void);
+__attribute__ ((weak)) void Timer3A_IRQHandler(void);
+__attribute__ ((weak)) void Timer3B_IRQHandler(void);
+__attribute__ ((weak)) void I2C1_IRQHandler(void);
+__attribute__ ((weak)) void QEI1_IRQHandler(void);
+__attribute__ ((weak)) void CAN0_IRQHandler(void);
+__attribute__ ((weak)) void CAN1_IRQHandler(void);
+__attribute__ ((weak)) void CAN2_IRQHandler(void);
+__attribute__ ((weak)) void Ethernet_IRQHandler(void);
+__attribute__ ((weak)) void Hibernate_IRQHandler(void);
 
-void __attribute__ ((weak)) Spurious_Handler(void);
 
 /*----------------------------------------------------------------------------
 * weak aliases for each Exception handler to the Spurious_Handler.
 * Any function with the same name will override these definitions.
 */
-#pragma weak NMI_Handler            = Spurious_Handler
-#pragma weak MemManage_Handler      = Spurious_Handler
-#pragma weak BusFault_Handler       = Spurious_Handler
-#pragma weak UsageFault_Handler     = Spurious_Handler
 #pragma weak SVC_Handler            = Spurious_Handler
 #pragma weak DebugMon_Handler       = Spurious_Handler
 #pragma weak PendSV_Handler         = Spurious_Handler
 #pragma weak SysTick_Handler        = Spurious_Handler
-
 #pragma weak GPIOPortA_IRQHandler   = Spurious_Handler
 #pragma weak GPIOPortB_IRQHandler   = Spurious_Handler
 #pragma weak GPIOPortC_IRQHandler   = Spurious_Handler
@@ -143,20 +155,21 @@ void __attribute__ ((weak)) Spurious_Handler(void);
 #pragma weak Ethernet_IRQHandler    = Spurious_Handler
 #pragma weak Hibernate_IRQHandler   = Spurious_Handler
 
+
+/* start and end of stack defined in the linker script ---------------------*/
+extern unsigned __stack_start__;
+extern unsigned __stack_end__;
+
 /* exception and interrupt vector table ------------------------------------*/
-typedef void (*ExceptionHandler)(void);
-typedef union {
-    ExceptionHandler handler;
-    void            *pointer;
+typedef union VectorTableEntryTag {
+    void *pointer;                 /* used only to initialize the stack top */
+    void (*handler)(void); /* used for all exception and interrupt handlers */
 } VectorTableEntry;
 
-                               /* top of stack defined in the linker script */
-extern unsigned __c_stack_top__;
-
 /*..........................................................................*/
 __attribute__ ((section(".isr_vector")))
 VectorTableEntry const g_pfnVectors[] = {
-    { .pointer = &__c_stack_top__        }, /* initial stack pointer        */
+    { .pointer = &__stack_end__          }, /* initial stack pointer        */
     { .handler = &Reset_Handler          }, /* Reset Handler                */
     { .handler = &NMI_Handler            }, /* NMI Handler                  */
     { .handler = &HardFault_Handler      }, /* Hard Fault Handler           */
@@ -173,57 +186,55 @@ VectorTableEntry const g_pfnVectors[] = {
     { .handler = &PendSV_Handler         }, /* PendSV Handler               */
     { .handler = &SysTick_Handler        }, /* SysTick Handler              */
     /* external interrupts (IRQs) ... */
-    { .handler = GPIOPortA_IRQHandler    }, /* GPIO Port A                  */
-    { .handler = GPIOPortB_IRQHandler    }, /* GPIO Port B                  */
-    { .handler = GPIOPortC_IRQHandler    }, /* GPIO Port C                  */
-    { .handler = GPIOPortD_IRQHandler    }, /* GPIO Port D                  */
-    { .handler = GPIOPortE_IRQHandler    }, /* GPIO Port E                  */
-    { .handler = UART0_IRQHandler        }, /* UART0 Rx and Tx              */
-    { .handler = UART1_IRQHandler        }, /* UART1 Rx and Tx              */
-    { .handler = SSI0_IRQHandler         }, /* SSI0 Rx and Tx               */
-    { .handler = I2C0_IRQHandler         }, /* I2C0 Master and Slave        */
-    { .handler = PWMFault_IRQHandler     }, /* PWM Fault                    */
-    { .handler = PWMGen0_IRQHandler      }, /* PWM Generator 0              */
-    { .handler = PWMGen1_IRQHandler      }, /* PWM Generator 1              */
-    { .handler = PWMGen2_IRQHandler      }, /* PWM Generator 2              */
-    { .handler = QEI0_IRQHandler         }, /* Quadrature Encoder 0         */
-    { .handler = ADCSeq0_IRQHandler      }, /* ADC Sequence 0               */
-    { .handler = ADCSeq1_IRQHandler      }, /* ADC Sequence 1               */
-    { .handler = ADCSeq2_IRQHandler      }, /* ADC Sequence 2               */
-    { .handler = ADCSeq3_IRQHandler      }, /* ADC Sequence 3               */
-    { .handler = Watchdog_IRQHandler     }, /* Watchdog timer               */
-    { .handler = Timer0A_IRQHandler      }, /* Timer 0 subtimer A           */
-    { .handler = Timer0B_IRQHandler      }, /* Timer 0 subtimer B           */
-    { .handler = Timer1A_IRQHandler      }, /* Timer 1 subtimer A           */
-    { .handler = Timer1B_IRQHandler      }, /* Timer 1 subtimer B           */
-    { .handler = Timer2A_IRQHandler      }, /* Timer 2 subtimer A           */
-    { .handler = Timer2B_IRQHandler      }, /* Timer 2 subtimer B           */
-    { .handler = Comp0_IRQHandler        }, /* Analog Comparator 0          */
-    { .handler = Comp1_IRQHandler        }, /* Analog Comparator 1          */
-    { .handler = Comp2_IRQHandler        }, /* Analog Comparator 2          */
-    { .handler = SysCtrl_IRQHandler      }, /* System Control (PLL,OSC,BO)  */
-    { .handler = FlashCtrl_IRQHandler    }, /* FLASH Control                */
-    { .handler = GPIOPortF_IRQHandler    }, /* GPIO Port F                  */
-    { .handler = GPIOPortG_IRQHandler    }, /* GPIO Port G                  */
-    { .handler = GPIOPortH_IRQHandler    }, /* GPIO Port H                  */
-    { .handler = UART2_IRQHandler        }, /* UART2 Rx and Tx              */
-    { .handler = SSI1_IRQHandler         }, /* SSI1 Rx and Tx               */
-    { .handler = Timer3A_IRQHandler      }, /* Timer 3 subtimer A           */
-    { .handler = Timer3B_IRQHandler      }, /* Timer 3 subtimer B           */
-    { .handler = I2C1_IRQHandler         }, /* I2C1 Master and Slave        */
-    { .handler = QEI1_IRQHandler         }, /* Quadrature Encoder 1         */
-    { .handler = CAN0_IRQHandler         }, /* CAN0                         */
-    { .handler = CAN1_IRQHandler         }, /* CAN1                         */
-    { .handler = CAN2_IRQHandler         }, /* CAN2                         */
-    { .handler = Ethernet_IRQHandler     }, /* Ethernet                     */
-    { .handler = Hibernate_IRQHandler    }, /* Hibernate                    */
+    { .handler = &GPIOPortA_IRQHandler   }, /* GPIO Port A                  */
+    { .handler = &GPIOPortB_IRQHandler   }, /* GPIO Port B                  */
+    { .handler = &GPIOPortC_IRQHandler   }, /* GPIO Port C                  */
+    { .handler = &GPIOPortD_IRQHandler   }, /* GPIO Port D                  */
+    { .handler = &GPIOPortE_IRQHandler   }, /* GPIO Port E                  */
+    { .handler = &UART0_IRQHandler       }, /* UART0 Rx and Tx              */
+    { .handler = &UART1_IRQHandler       }, /* UART1 Rx and Tx              */
+    { .handler = &SSI0_IRQHandler        }, /* SSI0 Rx and Tx               */
+    { .handler = &I2C0_IRQHandler        }, /* I2C0 Master and Slave        */
+    { .handler = &PWMFault_IRQHandler    }, /* PWM Fault                    */
+    { .handler = &PWMGen0_IRQHandler     }, /* PWM Generator 0              */
+    { .handler = &PWMGen1_IRQHandler     }, /* PWM Generator 1              */
+    { .handler = &PWMGen2_IRQHandler     }, /* PWM Generator 2              */
+    { .handler = &QEI0_IRQHandler        }, /* Quadrature Encoder 0         */
+    { .handler = &ADCSeq0_IRQHandler     }, /* ADC Sequence 0               */
+    { .handler = &ADCSeq1_IRQHandler     }, /* ADC Sequence 1               */
+    { .handler = &ADCSeq2_IRQHandler     }, /* ADC Sequence 2               */
+    { .handler = &ADCSeq3_IRQHandler     }, /* ADC Sequence 3               */
+    { .handler = &Watchdog_IRQHandler    }, /* Watchdog timer               */
+    { .handler = &Timer0A_IRQHandler     }, /* Timer 0 subtimer A           */
+    { .handler = &Timer0B_IRQHandler     }, /* Timer 0 subtimer B           */
+    { .handler = &Timer1A_IRQHandler     }, /* Timer 1 subtimer A           */
+    { .handler = &Timer1B_IRQHandler     }, /* Timer 1 subtimer B           */
+    { .handler = &Timer2A_IRQHandler     }, /* Timer 2 subtimer A           */
+    { .handler = &Timer2B_IRQHandler     }, /* Timer 2 subtimer B           */
+    { .handler = &Comp0_IRQHandler       }, /* Analog Comparator 0          */
+    { .handler = &Comp1_IRQHandler       }, /* Analog Comparator 1          */
+    { .handler = &Comp2_IRQHandler       }, /* Analog Comparator 2          */
+    { .handler = &SysCtrl_IRQHandler     }, /* System Control (PLL,OSC,BO)  */
+    { .handler = &FlashCtrl_IRQHandler   }, /* FLASH Control                */
+    { .handler = &GPIOPortF_IRQHandler   }, /* GPIO Port F                  */
+    { .handler = &GPIOPortG_IRQHandler   }, /* GPIO Port G                  */
+    { .handler = &GPIOPortH_IRQHandler   }, /* GPIO Port H                  */
+    { .handler = &UART2_IRQHandler       }, /* UART2 Rx and Tx              */
+    { .handler = &SSI1_IRQHandler        }, /* SSI1 Rx and Tx               */
+    { .handler = &Timer3A_IRQHandler     }, /* Timer 3 subtimer A           */
+    { .handler = &Timer3B_IRQHandler     }, /* Timer 3 subtimer B           */
+    { .handler = &I2C1_IRQHandler        }, /* I2C1 Master and Slave        */
+    { .handler = &QEI1_IRQHandler        }, /* Quadrature Encoder 1         */
+    { .handler = &CAN0_IRQHandler        }, /* CAN0                         */
+    { .handler = &CAN1_IRQHandler        }, /* CAN1                         */
+    { .handler = &CAN2_IRQHandler        }, /* CAN2                         */
+    { .handler = &Ethernet_IRQHandler    }, /* Ethernet                     */
+    { .handler = &Hibernate_IRQHandler   }, /* Hibernate                    */
 };
 
-/* function prototypes -----------------------------------------------------*/
-void assert_failed(char const *file, int line);
 
-/*..........................................................................*/
-void Reset_Handler(void)    __attribute__((__interrupt__));
+/* exception handlers ------------------------------------------------------*/
+__attribute__((naked)) void Reset_Handler(void);
 void Reset_Handler(void) {
     extern int main(void);
     extern int __libc_init_array(void);
@@ -240,7 +251,6 @@ void Reset_Handler(void) {
     for (dst = &__data_start; dst < &__data_end__; ++dst, ++src) {
         *dst = *src;
     }
-
                                            /* zero fill the .bss segment... */
     for (dst = &__bss_start__; dst < &__bss_end__; ++dst) {
         *dst = 0;
@@ -248,26 +258,49 @@ void Reset_Handler(void) {
              /* call all static construcors in C++ (harmless in C programs) */
     __libc_init_array();
 
-                                      /* call the application's entry point */
-    main();
-
-    /* in a bare-metal system main() has nothing to return to and it should
-    * never return. Just in case main() returns, the assert_failed() gives
-    * the last opportunity to catch this problem.
-    */
-    assert_failed("startup_stm32f10x_cl", __LINE__);
+    (void)main();  /* application's entry point, which should never return! */
 }
 /*..........................................................................*/
-void Spurious_Handler(void) __attribute__((__interrupt__));
-void Spurious_Handler(void) {
-    assert_failed("startup_stm32f10x_cl", __LINE__);
-    /* assert_failed() should not return, but just in case the following
-    * enless loop will tie up the CPU.
-    */
-    for (;;) {
+__attribute__((naked)) void NMI_Handler(void);
+void NMI_Handler(void) {
+    assert_failed("NMI", __LINE__);                 /* should never return! */
+}
+/*..........................................................................*/
+__attribute__((naked)) void MemManage_Handler(void);
+void MemManage_Handler(void) {
+    assert_failed("MemManage", __LINE__);           /* should never return! */
+}
+/*..........................................................................*/
+__attribute__((naked)) void HardFault_Handler(void);
+void HardFault_Handler(void) {
+    unsigned old_sp;
+    __asm volatile ("mov %0,sp" : "=r" (old_sp));
+    if (old_sp < (unsigned)&__stack_start__) {           /* stack overflow? */
+        unsigned new_sp = (unsigned)&__stack_end__;
+        __asm volatile ("mov sp,%0" :: "r" (new_sp));
+        assert_failed("StackOverflow", old_sp);     /* should never return! */
+    }
+    else {
+        assert_failed("HardFault", __LINE__);       /* should never return! */
     }
 }
 /*..........................................................................*/
+__attribute__((naked)) void BusFault_Handler(void);
+void BusFault_Handler(void) {
+    assert_failed("BusFault", __LINE__);            /* should never return! */
+}
+/*..........................................................................*/
+__attribute__((naked)) void UsageFault_Handler(void);
+void UsageFault_Handler(void) {
+    assert_failed("UsageFault", __LINE__);          /* should never return! */
+}
+/*..........................................................................*/
+__attribute__((naked)) void Spurious_Handler(void);
+void Spurious_Handler(void) {
+    assert_failed("Spurious", __LINE__);            /* should never return! */
+}
+/*..........................................................................*/
 void _init() {
 }
 
+

+ 88 - 56
examples/arm-cm/qk/gnu/dpp-qk_ek-lm3s811-lint/table.c

@@ -2,10 +2,17 @@
 * Model: dpp.qm
 * File:  ./table.c
 *
-* This file has been generated automatically by QP Modeler (QM).
-* DO NOT EDIT THIS FILE MANUALLY.
+* This code has been generated by QM tool (see state-machine.com/qm).
+* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
 *
-* Please visit www.state-machine.com/qm for more information.
+* 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.
+*
+* 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.
 *****************************************************************************/
 /* @(/3/2) .................................................................*/
 #include "qp_port.h"
@@ -18,7 +25,7 @@ Q_DEFINE_THIS_FILE
 /* @(/2/1) .................................................................*/
 typedef struct TableTag {
 /* protected: */
-    QActive super;
+    QMActive super;
 
 /* private: */
     uint8_t fork[N_PHILO];
@@ -27,9 +34,27 @@ typedef struct TableTag {
 
 /* protected: */
 static QState Table_initial(Table * const me, QEvt const * const e);
-static QState Table_active(Table * const me, QEvt const * const e);
-static QState Table_serving(Table * const me, QEvt const * const e);
-static QState Table_paused(Table * const me, QEvt const * const e);
+static QState Table_active  (Table * const me, QEvt const * const e);
+static QMState const Table_active_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Table_active),
+    Q_ACTION_CAST(0)
+};
+static QState Table_serving  (Table * const me, QEvt const * const e);
+static QState Table_serving_e(Table * const me);
+static QMState const Table_serving_s = {
+    &Table_active_s,
+    Q_STATE_CAST(&Table_serving),
+    Q_ACTION_CAST(0)
+};
+static QState Table_paused  (Table * const me, QEvt const * const e);
+static QState Table_paused_e(Table * const me);
+static QState Table_paused_x(Table * const me);
+static QMState const Table_paused_s = {
+    &Table_active_s,
+    Q_STATE_CAST(&Table_paused),
+    Q_ACTION_CAST(&Table_paused_x)
+};
 
 
 #define RIGHT(n_) ((uint8_t)(((n_) + (N_PHILO - 1U)) % N_PHILO))
@@ -49,7 +74,7 @@ void Table_ctor(void) {
     uint8_t n;
     Table *me = &l_table;
 
-    QActive_ctor(&me->super, Q_STATE_CAST(&Table_initial));
+    QMActive_ctor(&me->super, Q_STATE_CAST(&Table_initial));
 
     for (n = 0U; n < N_PHILO; ++n) {
         me->fork[n] = FREE;
@@ -60,6 +85,10 @@ void Table_ctor(void) {
 /* @(/2/1/2) ...............................................................*/
 /* @(/2/1/2/0) */
 static QState Table_initial(Table * const me, QEvt const * const e) {
+    static QActionHandler const act_[] = {
+        Q_ACTION_CAST(&Table_serving_e),
+        Q_ACTION_CAST(0)
+    };
     uint8_t n;
     (void)e; /* suppress the compiler warning about unused parameter */
 
@@ -84,7 +113,7 @@ static QState Table_initial(Table * const me, QEvt const * const e) {
         me->isHungry[n] = 0U;
         BSP_displayPhilStat(n, "thinking");
     }
-    return Q_TRAN(&Table_serving);
+    return QM_INITIAL(&Table_serving_s, act_);
 }
 /* @(/2/1/2/1) .............................................................*/
 static QState Table_active(Table * const me, QEvt const * const e) {
@@ -93,48 +122,46 @@ static QState Table_active(Table * const me, QEvt const * const e) {
         /* @(/2/1/2/1/0) */
         case TERMINATE_SIG: {
             BSP_terminate(0);
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/1) */
         case EAT_SIG: {
             Q_ERROR();
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/1/2/1/2) ...........................................................*/
+static QState Table_serving_e(Table * const me) {
+    uint8_t n;
+    for (n = 0U; n < N_PHILO; ++n) { /* give permissions to eat... */
+        if ((me->isHungry[n] != 0U)
+            && (me->fork[LEFT(n)] == FREE)
+            && (me->fork[n] == FREE))
+        {
+            TableEvt *te;
+
+            me->fork[LEFT(n)] = USED;
+            me->fork[n] = USED;
+            te = Q_NEW(TableEvt, EAT_SIG);
+            te->philoNum = n;
+            QF_PUBLISH(&te->super, me);
+            me->isHungry[n] = 0U;
+            BSP_displayPhilStat(n, "eating  ");
+        }
+    }
+    return QM_ENTRY(&Table_serving_s);
+}
 static QState Table_serving(Table * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/1/2/1/2) */
-        case Q_ENTRY_SIG: {
-            uint8_t n;
-            for (n = 0U; n < N_PHILO; ++n) { /* give permissions to eat... */
-                if ((me->isHungry[n] != 0U)
-                    && (me->fork[LEFT(n)] == FREE)
-                    && (me->fork[n] == FREE))
-                {
-                    TableEvt *te;
-
-                    me->fork[LEFT(n)] = USED;
-                    me->fork[n] = USED;
-                    te = Q_NEW(TableEvt, EAT_SIG);
-                    te->philoNum = n;
-                    QF_PUBLISH(&te->super, me);
-                    me->isHungry[n] = 0U;
-                    BSP_displayPhilStat(n, "eating  ");
-                }
-            }
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/1/2/1/2/0) */
         case HUNGRY_SIG: {
             uint8_t n, m;
@@ -154,12 +181,12 @@ static QState Table_serving(Table * const me, QEvt const * const e) {
                 pe->philoNum = n;
                 QF_PUBLISH(&pe->super, me);
                 BSP_displayPhilStat(n, "eating  ");
-                status_ = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             /* @(/2/1/2/1/2/0/1) */
             else {
                 me->isHungry[n] = 1U;
-                status_ = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             break;
         }
@@ -201,46 +228,51 @@ static QState Table_serving(Table * const me, QEvt const * const e) {
                 QF_PUBLISH(&pe->super, me);
                 BSP_displayPhilStat(m, "eating  ");
             }
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/2/2) */
         case EAT_SIG: {
             Q_ERROR();
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/2/3) */
         case PAUSE_SIG: {
-            status_ = Q_TRAN(&Table_paused);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Table_paused_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Table_paused_s, act_);
             break;
         }
         default: {
-            status_ = Q_SUPER(&Table_active);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/1/2/1/3) ...........................................................*/
+static QState Table_paused_e(Table * const me) {
+    BSP_displayPaused(1U);
+    return QM_ENTRY(&Table_paused_s);
+}
+static QState Table_paused_x(Table * const me) {
+    BSP_displayPaused(0U);
+    return QM_EXIT(&Table_paused_s);
+}
 static QState Table_paused(Table * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/1/2/1/3) */
-        case Q_ENTRY_SIG: {
-            BSP_displayPaused(1U);
-            status_ = Q_HANDLED();
-            break;
-        }
-        /* @(/2/1/2/1/3) */
-        case Q_EXIT_SIG: {
-            BSP_displayPaused(0U);
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/1/2/1/3/0) */
         case PAUSE_SIG: {
-            status_ = Q_TRAN(&Table_serving);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Table_paused_x),
+                Q_ACTION_CAST(&Table_serving_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Table_serving_s, act_);
             break;
         }
         /* @(/2/1/2/1/3/1) */
@@ -250,7 +282,7 @@ static QState Table_paused(Table * const me, QEvt const * const e) {
             Q_ASSERT((n < N_PHILO) && (me->isHungry[n] == 0U));
             me->isHungry[n] = 1U;
             BSP_displayPhilStat(n, "hungry  ");
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/3/2) */
@@ -268,11 +300,11 @@ static QState Table_paused(Table * const me, QEvt const * const e) {
 
             me->fork[m] = FREE;
             me->fork[n] = FREE;
-            status_ = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status_ = Q_SUPER(&Table_active);
+            status_ = QM_SUPER();
             break;
         }
     }

+ 34 - 28
examples/arm-cm/qk/gnu/dpp-qk_ek-tm4c123gxl/Makefile

@@ -1,7 +1,7 @@
 ##############################################################################
-# Product: Makefile for EK-TM4C123XL, QK kernel, GNU/Sourcery
-# Last Updated for Version: 5.0.0
-# Date of the Last Update:  Sep 07, 2013
+# Product: Makefile for EK-TM4C123GXL, QK kernel, GNU/Sourcery
+# Last Updated for Version: 5.2.0
+# Date of the Last Update:  Dec 17, 2013
 #
 #                    Q u a n t u m     L e a P s
 #                    ---------------------------
@@ -43,27 +43,6 @@
 # make CONF=rel clean
 # make CONF=spy clean
 
-PROJECT := dpp-qk
-
-#-----------------------------------------------------------------------------
-# GNU ARM compiler
-#
-ifeq ($(GNU_ARM),)
-GNU_ARM = C:/tools/CodeSourcery
-endif
-
-##############################################################################
-# Typically, you should not need to change anything below this line
-
-CC    := $(GNU_ARM)/bin/arm-none-eabi-gcc
-CPP   := $(GNU_ARM)/bin/arm-none-eabi-g++
-AS    := $(GNU_ARM)/bin/arm-none-eabi-as
-LINK  := $(GNU_ARM)/bin/arm-none-eabi-gcc
-BIN   := $(GNU_ARM)/bin/arm-none-eabi-objcopy
-RM    := rm -rf
-MKDIR := mkdir
-RM    := rm
-
 #-----------------------------------------------------------------------------
 # NOTE: the Makefile expects that the QPC environment variable is defined
 # and points to the QP/C installation directory
@@ -75,6 +54,9 @@ endif
 #-----------------------------------------------------------------------------
 # directories
 #
+
+PROJECT := dpp-qk
+
 QP_PORT_DIR := $(QPC)/ports/arm-cm/qk/gnu
 CMSIS_DIR   := $(QPC)/ports/arm-cm/cmsis
 APP_DIR     := .
@@ -87,7 +69,7 @@ VPATH = $(APP_DIR) \
 OUTPUT := $(PROJECT)
 
 # include directories
-INCLUDES  = -I$(QPC)/include	\
+INCLUDES  = -I$(QPC)/include \
 	-I$(QP_PORT_DIR) \
 	-I. \
 	-I$(CMSIS_DIR)
@@ -98,6 +80,28 @@ DEFINES = -DTARGET_IS_BLIZZARD_RA1 -D__VFP_FP__ -D__FPU_PRESENT
 ARM_CORE = cortex-m4
 ARM_FPU  = vfp
 
+LD_SCRIPT := $(PROJECT).ld
+LIBS      := -lqp_$(ARM_CORE)f_cs
+
+#-----------------------------------------------------------------------------
+# GNU ARM compiler
+#
+ifeq ($(GNU_ARM),)
+GNU_ARM = C:/tools/CodeSourcery
+endif
+
+##############################################################################
+# Typically, you should not need to change anything below this line
+
+CC    := $(GNU_ARM)/bin/arm-none-eabi-gcc
+CPP   := $(GNU_ARM)/bin/arm-none-eabi-g++
+AS    := $(GNU_ARM)/bin/arm-none-eabi-as
+LINK  := $(GNU_ARM)/bin/arm-none-eabi-gcc
+BIN   := $(GNU_ARM)/bin/arm-none-eabi-objcopy
+RM    := rm -rf
+MKDIR := mkdir
+RM    := rm
+
 #-----------------------------------------------------------------------------
 # files
 #
@@ -111,9 +115,6 @@ C_SRCS := $(wildcard *.c)
 # C++ source files
 CPP_SRCS :=	$(wildcard *.cpp)
 
-LD_SCRIPT := tm4c123gh6pm.ld
-LIBS      := -lqp_$(ARM_CORE)f_cs
-
 #-----------------------------------------------------------------------------
 # build options for various configurations
 #
@@ -219,7 +220,12 @@ $(BIN_DIR)/%.o : %.c
 $(BIN_DIR)/%.o : %.cpp
 	$(CPP) $(CPPFLAGS) -c $< -o $@
 
+# include dependency files only if our goal depends on their existence
+ifneq ($(MAKECMDGOALS),clean)
+  ifneq ($(MAKECMDGOALS),show)
 -include $(C_DEPS_EXT) $(CPP_DEPS_EXT)
+  endif
+endif
 
 
 .PHONY : clean

+ 9 - 11
examples/arm-cm/qk/gnu/dpp-qk_ek-tm4c123gxl/bsp.c

@@ -1,7 +1,7 @@
 /*****************************************************************************
 * Product: "Dining Philosophers Problem" example, preemptive QK kernel
-* Last Updated for Version: 5.1.0
-* Date of the Last Update:  Oct 06, 2013
+* Last Updated for Version: 5.2.0
+* Date of the Last Update:  Dec 25, 2013
 *
 *                    Q u a n t u m     L e a P s
 *                    ---------------------------
@@ -109,7 +109,7 @@ void SysTick_Handler(void) {
     }
 #endif
 
-    QF_TICK_X(0U, &l_SysTick_Handler);     /* process all armed time events */
+    QF_TICK_X(0U, &l_SysTick_Handler);    /* process time events for rate 0 */
 
                                               /* debounce the SW1 button... */
     btn = GPIOF->DATA_Bits[USR_SW1];                   /* read the push btn */
@@ -202,7 +202,6 @@ void BSP_init(void) {
     if (QS_INIT((void *)0) == 0) {    /* initialize the QS software tracing */
         Q_ERROR();
     }
-    QS_RESET();
     QS_OBJ_DICTIONARY(&l_SysTick_Handler);
     QS_OBJ_DICTIONARY(&l_GPIOPortA_IRQHandler);
 }
@@ -300,17 +299,16 @@ void QK_onIdle(void) {
 }
 
 /*..........................................................................*/
-void Q_onAssert(char const Q_ROM * const Q_ROM_VAR file, int line) {
-    (void)file;                                   /* avoid compiler warning */
-    (void)line;                                   /* avoid compiler warning */
-    QF_INT_DISABLE();         /* make sure that all interrupts are disabled */
-    for (;;) {       /* NOTE: replace the loop with reset for final version */
-    }
+void Q_onAssert(char const Q_ROM * const file, int_t line) {
+    assert_failed(file, line);
 }
 /*..........................................................................*/
 /* error routine that is called if the CMSIS library encounters an error    */
 void assert_failed(char const *file, int line) {
-    Q_onAssert(file, line);
+    (void)file;                                   /* avoid compiler warning */
+    (void)line;                                   /* avoid compiler warning */
+    QF_INT_DISABLE();         /* make sure that all interrupts are disabled */
+    ROM_SysCtlReset();                                  /* reset the system */
 }
 
 /*--------------------------------------------------------------------------*/

+ 14 - 16
examples/arm-cm/vanilla/gnu/dpp_ek-tm4c123gxl/tm4c123gh6pm.ld → examples/arm-cm/qk/gnu/dpp-qk_ek-tm4c123gxl/dpp-qk.ld

@@ -1,7 +1,7 @@
 /*****************************************************************************
-* Product: GNU linker script for Tiva TM4C123GH6PM MCUs
-* Last Updated for Version: 5.0.0
-* Date of the Last Update:  Aug 26, 2013
+* Product: Linker script for for EK-TM4C123GXL, GNU-ARM (Sourcery CodeBench)
+* Last Updated for Version: 5.2.0
+* Date of the Last Update:  Dec 17, 2013
 *
 *                    Q u a n t u m     L e a P s
 *                    ---------------------------
@@ -11,7 +11,7 @@
 *
 * 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
+* by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Alternatively, this program may be distributed and modified under the
@@ -32,7 +32,6 @@
 *                          http://www.state-machine.com
 * e-mail:                  info@quantum-leaps.com
 *****************************************************************************/
-
 OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
 OUTPUT_ARCH(arm)
 ENTRY(Reset_Handler)                                         /* entry Point */
@@ -90,6 +89,13 @@ SECTIONS {
 
     _etext = .;                            /* global symbols at end of code */
 
+    .stack : {
+        __stack_start__ = .;
+        . = . + STACK_SIZE;
+        . = ALIGN(4);
+        __stack_end__ = .;
+    } >RAM
+
     .data :  AT (_etext) {
         __data_load = LOADADDR (.data);
         __data_start = .;
@@ -101,7 +107,7 @@ SECTIONS {
     } >RAM
 
     .bss : {
-        __bss_start__ = . ;
+        __bss_start__ = .;
         *(.bss)
         *(.bss*)
         *(COMMON)
@@ -115,18 +121,10 @@ SECTIONS {
     PROVIDE ( __end__ = _ebss );
 
     .heap : {
-        __heap_start__ = . ;
+        __heap_start__ = .;
         . = . + HEAP_SIZE;
         . = ALIGN(4);
-        __heap_end__ = . ;
-    } >RAM
-
-    .stack : {
-        __stack_start__ = . ;
-        . = . + STACK_SIZE;
-        . = ALIGN(4);
-        __c_stack_top__ = . ;
-        __stack_end__ = . ;
+        __heap_end__ = .;
     } >RAM
 
     /* Remove information from the standard libraries */

+ 13 - 3
examples/arm-cm/qk/gnu/dpp-qk_ek-tm4c123gxl/dpp.h

@@ -2,11 +2,19 @@
 * Model: dpp.qm
 * File:  ./dpp.h
 *
-* This file has been generated automatically by QP Modeler (QM).
-* DO NOT EDIT THIS FILE MANUALLY.
+* This code has been generated by QM tool (see state-machine.com/qm).
+* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
 *
-* Please visit www.state-machine.com/qm for more information.
+* 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.
+*
+* 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.
 *****************************************************************************/
+/* @(/3/0) .................................................................*/
 #ifndef dpp_h
 #define dpp_h
 
@@ -42,6 +50,8 @@ void Table_ctor(void);
 
 
 extern QActive * const AO_Philo[N_PHILO];
+
 extern QActive * const AO_Table;
 
+
 #endif                    /* dpp_h */

+ 57 - 9
examples/arm-cm/qk/gnu/dpp-qk_ek-tm4c123gxl/dpp.qm

@@ -1,6 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<model version="2.3.0">
- <documentation>Dining Philosopher Problem example</documentation>
+<model version="3.0.0">
+ <documentation>Dining Philosopher Problem example
+
+NOTE: Requries QP 5.</documentation>
  <framework name="qpc"/>
  <package name="Events" stereotype="0x01">
   <class name="TableEvt" superclass="qpc::QEvt">
@@ -8,7 +10,7 @@
   </class>
  </package>
  <package name="AOs" stereotype="0x02">
-  <class name="Philo" superclass="qpc::QActive">
+  <class name="Philo" superclass="qpc::QMActive">
    <attribute name="timeEvt" type="QTimeEvt" visibility="0x02" properties="0x00"/>
    <statechart>
     <initial target="../1">
@@ -42,7 +44,7 @@ QActive_subscribe(&amp;me-&gt;super, EAT_SIG);</action>
      </initial_glyph>
     </initial>
     <state name="thinking">
-     <entry>QTimeEvt_postIn(&amp;me-&gt;timeEvt, &amp;me-&gt;super, THINK_TIME);</entry>
+     <entry>QTimeEvt_armX(&amp;me-&gt;timeEvt, THINK_TIME, 0U);</entry>
      <tran trig="TIMEOUT" target="../../2">
       <tran_glyph conn="2,12,3,1,20,13,-3">
        <action box="0,-2,6,2"/>
@@ -86,7 +88,7 @@ Q_ASSERT(Q_EVT_CAST(TableEvt)-&gt;philoNum != PHILO_ID(me));</action>
      </state_glyph>
     </state>
     <state name="eating">
-     <entry>QTimeEvt_postIn(&amp;me-&gt;timeEvt, &amp;me-&gt;super, EAT_TIME);</entry>
+     <entry>QTimeEvt_armX(&amp;me-&gt;timeEvt, EAT_TIME, 0U);</entry>
      <exit>TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
 pe-&gt;philoNum = PHILO_ID(me);
 QF_PUBLISH(&amp;pe-&gt;super, me);</exit>
@@ -110,7 +112,7 @@ Q_ASSERT(Q_EVT_CAST(TableEvt)-&gt;philoNum != PHILO_ID(me));</action>
     <state_diagram size="37,61"/>
    </statechart>
   </class>
-  <class name="Table" superclass="qpc::QActive">
+  <class name="Table" superclass="qpc::QMActive">
    <attribute name="fork[N_PHILO]" type="uint8_t" visibility="0x02" properties="0x00"/>
    <attribute name="isHungry[N_PHILO]" type="uint8_t" visibility="0x02" properties="0x00"/>
    <statechart>
@@ -316,15 +318,15 @@ me-&gt;fork[n] = FREE;</action>
 Philo *me;
 for (n = 0U; n &lt; N_PHILO; ++n) {
     me = &amp;l_philo[n];
-    QActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Philo_initial));
-    QTimeEvt_ctor(&amp;me-&gt;timeEvt, TIMEOUT_SIG);
+    QMActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Philo_initial));
+    QTimeEvt_ctorX(&amp;me-&gt;timeEvt, &amp;me-&gt;super, TIMEOUT_SIG, 0U);
 }</code>
   </operation>
   <operation name="Table_ctor" type="void" visibility="0x00" properties="0x00">
    <code>uint8_t n;
 Table *me = &amp;l_table;
 
-QActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Table_initial));
+QMActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Table_initial));
 
 for (n = 0U; n &lt; N_PHILO; ++n) {
     me-&gt;fork[n] = FREE;
@@ -424,5 +426,51 @@ QActive * const AO_Table = &amp;l_table.super; /* &quot;opaque&quot; AO pointer
 $define(AOs::Table_ctor)
 $define(AOs::Table)</text>
   </file>
+  <file name="main.c">
+   <text>#include &quot;qp_port.h&quot;
+#include &quot;dpp.h&quot;
+#include &quot;bsp.h&quot;
+
+/*..........................................................................*/
+int main() {
+    static QEvt const *tableQueueSto[N_PHILO];
+    static QEvt const *philoQueueSto[N_PHILO][N_PHILO];
+    static QSubscrList subscrSto[MAX_PUB_SIG];
+    static QF_MPOOL_EL(TableEvt) smlPoolSto[2*N_PHILO];       /* small pool */
+    uint8_t n;
+
+    Philo_ctor();             /* instantiate all Philosopher active objects */
+    Table_ctor();                    /* instantiate the Table active object */
+
+    QF_init();     /* initialize the framework and the underlying RT kernel */
+    BSP_init();                     /* initialize the Board Support Package */
+
+                                                  /* object dictionaries... */
+    QS_OBJ_DICTIONARY(smlPoolSto);
+    QS_OBJ_DICTIONARY(tableQueueSto);
+    QS_OBJ_DICTIONARY(philoQueueSto[0]);
+    QS_OBJ_DICTIONARY(philoQueueSto[1]);
+    QS_OBJ_DICTIONARY(philoQueueSto[2]);
+    QS_OBJ_DICTIONARY(philoQueueSto[3]);
+    QS_OBJ_DICTIONARY(philoQueueSto[4]);
+
+    QF_psInit(subscrSto, Q_DIM(subscrSto));       /* init publish-subscribe */
+
+                                               /* initialize event pools... */
+    QF_poolInit(smlPoolSto, sizeof(smlPoolSto), sizeof(smlPoolSto[0]));
+
+    for (n = 0U; n &lt; N_PHILO; ++n) {         /* start the active objects... */
+        QACTIVE_START(AO_Philo[n], (uint8_t)(n + 1),
+                      philoQueueSto[n], Q_DIM(philoQueueSto[n]),
+                      (void *)0, 0U, (QEvt *)0);
+    }
+    QACTIVE_START(AO_Table, (uint8_t)(N_PHILO + 1),
+                  tableQueueSto, Q_DIM(tableQueueSto),
+                  (void *)0, 0U, (QEvt *)0);
+
+    return QF_run();                              /* run the QF application */
+}
+</text>
+  </file>
  </directory>
 </model>

+ 31 - 51
examples/arm-cm/qk/gnu/dpp-qk_ek-tm4c123gxl/main.c

@@ -1,81 +1,61 @@
 /*****************************************************************************
-* Product: DPP example
-* Last Updated for Version: 4.5.02
-* Date of the Last Update:  Jul 04, 2012
+* Model: dpp.qm
+* File:  ./main.c
 *
-*                    Q u a n t u m     L e a P s
-*                    ---------------------------
-*                    innovating embedded systems
-*
-* Copyright (C) 2002-2012 Quantum Leaps, LLC. All rights reserved.
+* This code has been generated by QM tool (see state-machine.com/qm).
+* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
 *
 * 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 3 of the License, or
-* (at your option) any later version.
-*
-* 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.
-*
-* 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/>.
+* by the Free Software Foundation.
 *
-* Contact information:
-* Quantum Leaps Web sites: http://www.quantum-leaps.com
-*                          http://www.state-machine.com
-* e-mail:                  info@quantum-leaps.com
+* 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.
 *****************************************************************************/
+/* @(/3/3) .................................................................*/
 #include "qp_port.h"
 #include "dpp.h"
 #include "bsp.h"
 
-/* Local-scope objects -----------------------------------------------------*/
-static QEvt const *l_tableQueueSto[N_PHILO];
-static QEvt const *l_philoQueueSto[N_PHILO][N_PHILO];
-static QSubscrList l_subscrSto[MAX_PUB_SIG];
-
-/* storage for event pools... */
-static QF_MPOOL_EL(TableEvt) l_smlPoolSto[2*N_PHILO];         /* small pool */
-
 /*..........................................................................*/
-int main(void) {
+int main() {
+    static QEvt const *tableQueueSto[N_PHILO];
+    static QEvt const *philoQueueSto[N_PHILO][N_PHILO];
+    static QSubscrList subscrSto[MAX_PUB_SIG];
+    static QF_MPOOL_EL(TableEvt) smlPoolSto[2*N_PHILO];       /* small pool */
     uint8_t n;
 
     Philo_ctor();             /* instantiate all Philosopher active objects */
     Table_ctor();                    /* instantiate the Table active object */
 
     QF_init();     /* initialize the framework and the underlying RT kernel */
-    BSP_init();                                       /* initialize the BSP */
+    BSP_init();                     /* initialize the Board Support Package */
 
                                                   /* object dictionaries... */
-    QS_OBJ_DICTIONARY(l_smlPoolSto);
-    QS_OBJ_DICTIONARY(l_tableQueueSto);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[0]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[1]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[2]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[3]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[4]);
+    QS_OBJ_DICTIONARY(smlPoolSto);
+    QS_OBJ_DICTIONARY(tableQueueSto);
+    QS_OBJ_DICTIONARY(philoQueueSto[0]);
+    QS_OBJ_DICTIONARY(philoQueueSto[1]);
+    QS_OBJ_DICTIONARY(philoQueueSto[2]);
+    QS_OBJ_DICTIONARY(philoQueueSto[3]);
+    QS_OBJ_DICTIONARY(philoQueueSto[4]);
 
-    QF_psInit(l_subscrSto, Q_DIM(l_subscrSto));   /* init publish-subscribe */
+    QF_psInit(subscrSto, Q_DIM(subscrSto));       /* init publish-subscribe */
 
                                                /* initialize event pools... */
-    QF_poolInit(l_smlPoolSto, sizeof(l_smlPoolSto), sizeof(l_smlPoolSto[0]));
+    QF_poolInit(smlPoolSto, sizeof(smlPoolSto), sizeof(smlPoolSto[0]));
 
-    for (n = 0; n < N_PHILO; ++n) {          /* start the active objects... */
-        QActive_start(AO_Philo[n], (uint8_t)(n + 1),
-                      l_philoQueueSto[n], Q_DIM(l_philoQueueSto[n]),
+    for (n = 0U; n < N_PHILO; ++n) {         /* start the active objects... */
+        QACTIVE_START(AO_Philo[n], (uint8_t)(n + 1),
+                      philoQueueSto[n], Q_DIM(philoQueueSto[n]),
                       (void *)0, 0U, (QEvt *)0);
     }
-    QActive_start(AO_Table, (uint8_t)(N_PHILO + 1),
-                  l_tableQueueSto, Q_DIM(l_tableQueueSto),
+    QACTIVE_START(AO_Table, (uint8_t)(N_PHILO + 1),
+                  tableQueueSto, Q_DIM(tableQueueSto),
                   (void *)0, 0U, (QEvt *)0);
 
     return QF_run();                              /* run the QF application */
 }
+

+ 90 - 54
examples/arm-cm/qk/gnu/dpp-qk_ek-tm4c123gxl/philo.c

@@ -2,11 +2,19 @@
 * Model: dpp.qm
 * File:  ./philo.c
 *
-* This file has been generated automatically by QP Modeler (QM).
-* DO NOT EDIT THIS FILE MANUALLY.
+* This code has been generated by QM tool (see state-machine.com/qm).
+* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
 *
-* Please visit www.state-machine.com/qm for more information.
+* 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.
+*
+* 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.
 *****************************************************************************/
+/* @(/3/1) .................................................................*/
 #include "qp_port.h"
 #include "dpp.h"
 #include "bsp.h"
@@ -17,7 +25,7 @@ Q_DEFINE_THIS_FILE
 /* @(/2/0) .................................................................*/
 typedef struct PhiloTag {
 /* protected: */
-    QActive super;
+    QMActive super;
 
 /* private: */
     QTimeEvt timeEvt;
@@ -25,9 +33,28 @@ typedef struct PhiloTag {
 
 /* protected: */
 static QState Philo_initial(Philo * const me, QEvt const * const e);
-static QState Philo_thinking(Philo * const me, QEvt const * const e);
-static QState Philo_hungry(Philo * const me, QEvt const * const e);
-static QState Philo_eating(Philo * const me, QEvt const * const e);
+static QState Philo_thinking  (Philo * const me, QEvt const * const e);
+static QState Philo_thinking_e(Philo * const me);
+static QMState const Philo_thinking_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Philo_thinking),
+    Q_ACTION_CAST(0)
+};
+static QState Philo_hungry  (Philo * const me, QEvt const * const e);
+static QState Philo_hungry_e(Philo * const me);
+static QMState const Philo_hungry_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Philo_hungry),
+    Q_ACTION_CAST(0)
+};
+static QState Philo_eating  (Philo * const me, QEvt const * const e);
+static QState Philo_eating_e(Philo * const me);
+static QState Philo_eating_x(Philo * const me);
+static QMState const Philo_eating_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Philo_eating),
+    Q_ACTION_CAST(&Philo_eating_x)
+};
 
 
 /* Local objects -----------------------------------------------------------*/
@@ -61,14 +88,18 @@ void Philo_ctor(void) {
     Philo *me;
     for (n = 0U; n < N_PHILO; ++n) {
         me = &l_philo[n];
-        QActive_ctor(&me->super, Q_STATE_CAST(&Philo_initial));
-        QTimeEvt_ctor(&me->timeEvt, TIMEOUT_SIG);
+        QMActive_ctor(&me->super, Q_STATE_CAST(&Philo_initial));
+        QTimeEvt_ctorX(&me->timeEvt, &me->super, TIMEOUT_SIG, 0U);
     }
 }
 /* @(/2/0) .................................................................*/
 /* @(/2/0/1) ...............................................................*/
 /* @(/2/0/1/0) */
 static QState Philo_initial(Philo * const me, QEvt const * const e) {
+    static QActionHandler const act_[] = {
+        Q_ACTION_CAST(&Philo_thinking_e),
+        Q_ACTION_CAST(0)
+    };
     static uint8_t registered = (uint8_t)0; /* starts off with 0, per C-standard */
     (void)e; /* suppress the compiler warning about unused parameter */
     if (registered == (uint8_t)0) {
@@ -94,21 +125,23 @@ static QState Philo_initial(Philo * const me, QEvt const * const e) {
     QS_SIG_DICTIONARY(TIMEOUT_SIG, me); /* signal for each Philos */
 
     QActive_subscribe(&me->super, EAT_SIG);
-    return Q_TRAN(&Philo_thinking);
+    return QM_INITIAL(&Philo_thinking_s, act_);
 }
 /* @(/2/0/1/1) .............................................................*/
+static QState Philo_thinking_e(Philo * const me) {
+    QTimeEvt_armX(&me->timeEvt, THINK_TIME, 0U);
+    return QM_ENTRY(&Philo_thinking_s);
+}
 static QState Philo_thinking(Philo * const me, QEvt const * const e) {
-    QState status;
+    QState status_;
     switch (e->sig) {
-        /* @(/2/0/1/1) */
-        case Q_ENTRY_SIG: {
-            QTimeEvt_postIn(&me->timeEvt, &me->super, THINK_TIME);
-            status = Q_HANDLED();
-            break;
-        }
         /* @(/2/0/1/1/0) */
         case TIMEOUT_SIG: {
-            status = Q_TRAN(&Philo_hungry);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Philo_hungry_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Philo_hungry_s, act_);
             break;
         }
         /* @(/2/0/1/1/1) */
@@ -116,36 +149,38 @@ static QState Philo_thinking(Philo * const me, QEvt const * const e) {
         case DONE_SIG: {
             /* EAT or DONE must be for other Philos than this one */
             Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
-    return status;
+    return status_;
 }
 /* @(/2/0/1/2) .............................................................*/
+static QState Philo_hungry_e(Philo * const me) {
+    TableEvt *pe = Q_NEW(TableEvt, HUNGRY_SIG);
+    pe->philoNum = PHILO_ID(me);
+    QACTIVE_POST(AO_Table, &pe->super, me);
+    return QM_ENTRY(&Philo_hungry_s);
+}
 static QState Philo_hungry(Philo * const me, QEvt const * const e) {
-    QState status;
+    QState status_;
     switch (e->sig) {
-        /* @(/2/0/1/2) */
-        case Q_ENTRY_SIG: {
-            TableEvt *pe = Q_NEW(TableEvt, HUNGRY_SIG);
-            pe->philoNum = PHILO_ID(me);
-            QACTIVE_POST(AO_Table, &pe->super, me);
-            status = Q_HANDLED();
-            break;
-        }
         /* @(/2/0/1/2/0) */
         case EAT_SIG: {
             /* @(/2/0/1/2/0/0) */
             if (Q_EVT_CAST(TableEvt)->philoNum == PHILO_ID(me)) {
-                status = Q_TRAN(&Philo_eating);
+                static QActionHandler const act_[] = {
+                    Q_ACTION_CAST(&Philo_eating_e),
+                    Q_ACTION_CAST(0)
+                };
+                status_ = QM_TRAN(&Philo_eating_s, act_);
             }
             else {
-                status = Q_UNHANDLED();
+                status_ = QM_UNHANDLED();
             }
             break;
         }
@@ -153,37 +188,38 @@ static QState Philo_hungry(Philo * const me, QEvt const * const e) {
         case DONE_SIG: {
             /* DONE must be for other Philos than this one */
             Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
-    return status;
+    return status_;
 }
 /* @(/2/0/1/3) .............................................................*/
+static QState Philo_eating_e(Philo * const me) {
+    QTimeEvt_armX(&me->timeEvt, EAT_TIME, 0U);
+    return QM_ENTRY(&Philo_eating_s);
+}
+static QState Philo_eating_x(Philo * const me) {
+    TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
+    pe->philoNum = PHILO_ID(me);
+    QF_PUBLISH(&pe->super, me);
+    return QM_EXIT(&Philo_eating_s);
+}
 static QState Philo_eating(Philo * const me, QEvt const * const e) {
-    QState status;
+    QState status_;
     switch (e->sig) {
-        /* @(/2/0/1/3) */
-        case Q_ENTRY_SIG: {
-            QTimeEvt_postIn(&me->timeEvt, &me->super, EAT_TIME);
-            status = Q_HANDLED();
-            break;
-        }
-        /* @(/2/0/1/3) */
-        case Q_EXIT_SIG: {
-            TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
-            pe->philoNum = PHILO_ID(me);
-            QF_PUBLISH(&pe->super, me);
-            status = Q_HANDLED();
-            break;
-        }
         /* @(/2/0/1/3/0) */
         case TIMEOUT_SIG: {
-            status = Q_TRAN(&Philo_thinking);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Philo_eating_x),
+                Q_ACTION_CAST(&Philo_thinking_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Philo_thinking_s, act_);
             break;
         }
         /* @(/2/0/1/3/1) */
@@ -191,14 +227,14 @@ static QState Philo_eating(Philo * const me, QEvt const * const e) {
         case DONE_SIG: {
             /* EAT or DONE must be for other Philos than this one */
             Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
-    return status;
+    return status_;
 }
 

+ 412 - 138
examples/arm-cm/qk/gnu/dpp-qk_ek-tm4c123gxl/startup_tm4c.c

@@ -1,7 +1,7 @@
 /*****************************************************************************
-* Purpose: CMSIS-compliant startup code for Tiva TM4C Cortex-M4F devices, GNU
-* Last Updated for Version: 5.0.0
-* Date of the Last Update:  Aug 26, 2013
+* Product: CMSIS-compliant startup code for TM4C Cortex-M4F, GNU-ARM
+* Last Updated for Version: 5.2.0
+* Date of the Last Update:  Dec 24, 2013
 *
 *                    Q u a n t u m     L e a P s
 *                    ---------------------------
@@ -32,79 +32,158 @@
 *                          http://www.state-machine.com
 * e-mail:                  info@quantum-leaps.com
 *****************************************************************************/
-void __attribute__ ((weak)) Reset_Handler(void);
-void __attribute__ ((weak)) NMI_Handler(void);
-void __attribute__ ((weak)) HardFault_Handler(void);
-void __attribute__ ((weak)) MemManage_Handler(void);
-void __attribute__ ((weak)) BusFault_Handler(void);
-void __attribute__ ((weak)) UsageFault_Handler(void);
-void __attribute__ ((weak)) MemManage_Handler(void);
-void __attribute__ ((weak)) SVC_Handler(void);
-void __attribute__ ((weak)) DebugMon_Handler(void);
-void __attribute__ ((weak)) PendSV_Handler(void);
-void __attribute__ ((weak)) SysTick_Handler(void);
+#include <stdint.h>
+#include "sysctl.h"
+#include "rom.h"
 
-                                                  /* external interrupts... */
-void __attribute__ ((weak)) GPIOPortA_IRQHandler(void);
-void __attribute__ ((weak)) GPIOPortB_IRQHandler(void);
-void __attribute__ ((weak)) GPIOPortC_IRQHandler(void);
-void __attribute__ ((weak)) GPIOPortD_IRQHandler(void);
-void __attribute__ ((weak)) GPIOPortE_IRQHandler(void);
-void __attribute__ ((weak)) UART0_IRQHandler(void);
-void __attribute__ ((weak)) UART1_IRQHandler(void);
-void __attribute__ ((weak)) SSI0_IRQHandler(void);
-void __attribute__ ((weak)) I2C0_IRQHandler(void);
-void __attribute__ ((weak)) PWMFault_IRQHandler(void);
-void __attribute__ ((weak)) PWMGen0_IRQHandler(void);
-void __attribute__ ((weak)) PWMGen1_IRQHandler(void);
-void __attribute__ ((weak)) PWMGen2_IRQHandler(void);
-void __attribute__ ((weak)) QEI0_IRQHandler(void);
-void __attribute__ ((weak)) ADCSeq0_IRQHandler(void);
-void __attribute__ ((weak)) ADCSeq1_IRQHandler(void);
-void __attribute__ ((weak)) ADCSeq2_IRQHandler(void);
-void __attribute__ ((weak)) ADCSeq3_IRQHandler(void);
-void __attribute__ ((weak)) Watchdog_IRQHandler(void);
-void __attribute__ ((weak)) Timer0A_IRQHandler(void);
-void __attribute__ ((weak)) Timer0B_IRQHandler(void);
-void __attribute__ ((weak)) Timer1A_IRQHandler(void);
-void __attribute__ ((weak)) Timer1B_IRQHandler(void);
-void __attribute__ ((weak)) Timer2A_IRQHandler(void);
-void __attribute__ ((weak)) Timer2B_IRQHandler(void);
-void __attribute__ ((weak)) Comp0_IRQHandler(void);
-void __attribute__ ((weak)) Comp1_IRQHandler(void);
-void __attribute__ ((weak)) Comp2_IRQHandler(void);
-void __attribute__ ((weak)) SysCtrl_IRQHandler(void);
-void __attribute__ ((weak)) FlashCtrl_IRQHandler(void);
-void __attribute__ ((weak)) GPIOPortF_IRQHandler(void);
-void __attribute__ ((weak)) GPIOPortG_IRQHandler(void);
-void __attribute__ ((weak)) GPIOPortH_IRQHandler(void);
-void __attribute__ ((weak)) UART2_IRQHandler(void);
-void __attribute__ ((weak)) SSI1_IRQHandler(void);
-void __attribute__ ((weak)) Timer3A_IRQHandler(void);
-void __attribute__ ((weak)) Timer3B_IRQHandler(void);
-void __attribute__ ((weak)) I2C1_IRQHandler(void);
-void __attribute__ ((weak)) QEI1_IRQHandler(void);
-void __attribute__ ((weak)) CAN0_IRQHandler(void);
-void __attribute__ ((weak)) CAN1_IRQHandler(void);
-void __attribute__ ((weak)) CAN2_IRQHandler(void);
-void __attribute__ ((weak)) Ethernet_IRQHandler(void);
-void __attribute__ ((weak)) Hibernate_IRQHandler(void);
+/* Function prototypes -----------------------------------------------------*/
+void Reset_Handler(void);
+void NMI_Handler(void);
+void HardFault_Handler(void);
+void MemManage_Handler(void);
+void BusFault_Handler(void);
+void UsageFault_Handler(void);
+void HardFault_Handler(void);
+void Spurious_Handler(void);
+
+void assert_failed(char const *file, int line);       /* defined in the BSP */
+
+/*----------------------------------------------------------------------------
+* weak aliases for each Exception handler to the Spurious_Handler.
+* Any function with the same name will override these definitions.
+*/
+__attribute__ ((weak)) void SVC_Handler(void);
+__attribute__ ((weak)) void DebugMon_Handler(void);
+__attribute__ ((weak)) void PendSV_Handler(void);
+__attribute__ ((weak)) void SysTick_Handler(void);
+__attribute__ ((weak)) void Spurious_Handler(void);
+
+/* external interrupts... */
+__attribute__ ((weak)) void GPIOPortA_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortB_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortC_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortD_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortE_IRQHandler(void);
+__attribute__ ((weak)) void UART0_IRQHandler(void);
+__attribute__ ((weak)) void UART1_IRQHandler(void);
+__attribute__ ((weak)) void SSI0_IRQHandler(void);
+__attribute__ ((weak)) void I2C0_IRQHandler(void);
+__attribute__ ((weak)) void PWMFault_IRQHandler(void);
+__attribute__ ((weak)) void PWMGen0_IRQHandler(void);
+__attribute__ ((weak)) void PWMGen1_IRQHandler(void);
+__attribute__ ((weak)) void PWMGen2_IRQHandler(void);
+__attribute__ ((weak)) void QEI0_IRQHandler(void);
+__attribute__ ((weak)) void ADCSeq0_IRQHandler(void);
+__attribute__ ((weak)) void ADCSeq1_IRQHandler(void);
+__attribute__ ((weak)) void ADCSeq2_IRQHandler(void);
+__attribute__ ((weak)) void ADCSeq3_IRQHandler(void);
+__attribute__ ((weak)) void Watchdog_IRQHandler(void);
+__attribute__ ((weak)) void Timer0A_IRQHandler(void);
+__attribute__ ((weak)) void Timer0B_IRQHandler(void);
+__attribute__ ((weak)) void Timer1A_IRQHandler(void);
+__attribute__ ((weak)) void Timer1B_IRQHandler(void);
+__attribute__ ((weak)) void Timer2A_IRQHandler(void);
+__attribute__ ((weak)) void Timer2B_IRQHandler(void);
+__attribute__ ((weak)) void Comp0_IRQHandler(void);
+__attribute__ ((weak)) void Comp1_IRQHandler(void);
+__attribute__ ((weak)) void Comp2_IRQHandler(void);
+__attribute__ ((weak)) void SysCtrl_IRQHandler(void);
+__attribute__ ((weak)) void FlashCtrl_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortF_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortG_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortH_IRQHandler(void);
+__attribute__ ((weak)) void UART2_IRQHandler(void);
+__attribute__ ((weak)) void SSI1_IRQHandler(void);
+__attribute__ ((weak)) void Timer3A_IRQHandler(void);
+__attribute__ ((weak)) void Timer3B_IRQHandler(void);
+__attribute__ ((weak)) void I2C1_IRQHandler(void);
+__attribute__ ((weak)) void QEI1_IRQHandler(void);
+__attribute__ ((weak)) void CAN0_IRQHandler(void);
+__attribute__ ((weak)) void CAN1_IRQHandler(void);
+__attribute__ ((weak)) void CAN2_IRQHandler(void);
+__attribute__ ((weak)) void Ethernet_IRQHandler(void);
+__attribute__ ((weak)) void Hibernate_IRQHandler(void);
+
+__attribute__ ((weak)) void USB0_IRQHandler(void);
+__attribute__ ((weak)) void PWMGen3_IRQHandler(void);
+__attribute__ ((weak)) void uDMAST_IRQHandler(void);
+__attribute__ ((weak)) void uDMAError_IRQHandler(void);
+__attribute__ ((weak)) void ADC1Seq0_IRQHandler(void);
+__attribute__ ((weak)) void ADC1Seq1_IRQHandler(void);
+__attribute__ ((weak)) void ADC1Seq2_IRQHandler(void);
+__attribute__ ((weak)) void ADC1Seq3_IRQHandler(void);
+__attribute__ ((weak)) void I2S0_IRQHandler(void);
+__attribute__ ((weak)) void EBI0_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortJ_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortK_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortL_IRQHandler(void);
+__attribute__ ((weak)) void SSI2_IRQHandler(void);
+__attribute__ ((weak)) void SSI3_IRQHandler(void);
+__attribute__ ((weak)) void UART3_IRQHandler(void);
+__attribute__ ((weak)) void UART4_IRQHandler(void);
+__attribute__ ((weak)) void UART5_IRQHandler(void);
+__attribute__ ((weak)) void UART6_IRQHandler(void);
+__attribute__ ((weak)) void UART7_IRQHandler(void);
+__attribute__ ((weak)) void I2C2_IRQHandler(void);
+__attribute__ ((weak)) void I2C3_IRQHandler(void);
+__attribute__ ((weak)) void Timer4A_IRQHandler(void);
+__attribute__ ((weak)) void Timer4B_IRQHandler(void);
+__attribute__ ((weak)) void Timer5A_IRQHandler(void);
+__attribute__ ((weak)) void Timer5B_IRQHandler(void);
+__attribute__ ((weak)) void WideTimer0A_IRQHandler(void);
+__attribute__ ((weak)) void WideTimer0B_IRQHandler(void);
+__attribute__ ((weak)) void WideTimer1A_IRQHandler(void);
+__attribute__ ((weak)) void WideTimer1B_IRQHandler(void);
+__attribute__ ((weak)) void WideTimer2A_IRQHandler(void);
+__attribute__ ((weak)) void WideTimer2B_IRQHandler(void);
+__attribute__ ((weak)) void WideTimer3A_IRQHandler(void);
+__attribute__ ((weak)) void WideTimer3B_IRQHandler(void);
+__attribute__ ((weak)) void WideTimer4A_IRQHandler(void);
+__attribute__ ((weak)) void WideTimer4B_IRQHandler(void);
+__attribute__ ((weak)) void WideTimer5A_IRQHandler(void);
+__attribute__ ((weak)) void WideTimer5B_IRQHandler(void);
+__attribute__ ((weak)) void FPU_IRQHandler(void);
+__attribute__ ((weak)) void PECI0_IRQHandler(void);
+__attribute__ ((weak)) void LPC0_IRQHandler(void);
+__attribute__ ((weak)) void I2C4_IRQHandler(void);
+__attribute__ ((weak)) void I2C5_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortM_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortN_IRQHandler(void);
+__attribute__ ((weak)) void QEI2_IRQHandler(void);
+__attribute__ ((weak)) void Fan0_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortP0_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortP1_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortP2_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortP3_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortP4_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortP5_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortP6_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortP7_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortQ0_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortQ1_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortQ2_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortQ3_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortQ4_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortQ5_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortQ6_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortQ7_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortR_IRQHandler(void);
+__attribute__ ((weak)) void GPIOPortS_IRQHandler(void);
+__attribute__ ((weak)) void PWM1Gen0_IRQHandler(void);
+__attribute__ ((weak)) void PWM1Gen1_IRQHandler(void);
+__attribute__ ((weak)) void PWM1Gen2_IRQHandler(void);
+__attribute__ ((weak)) void PWM1Gen3_IRQHandler(void);
+__attribute__ ((weak)) void PWM1Fault_IRQHandler(void);
 
-void __attribute__ ((weak)) Spurious_Handler(void);
 
 /*----------------------------------------------------------------------------
 * weak aliases for each Exception handler to the Spurious_Handler.
 * Any function with the same name will override these definitions.
 */
-#pragma weak NMI_Handler            = Spurious_Handler
-#pragma weak MemManage_Handler      = Spurious_Handler
-#pragma weak BusFault_Handler       = Spurious_Handler
-#pragma weak UsageFault_Handler     = Spurious_Handler
 #pragma weak SVC_Handler            = Spurious_Handler
 #pragma weak DebugMon_Handler       = Spurious_Handler
 #pragma weak PendSV_Handler         = Spurious_Handler
 #pragma weak SysTick_Handler        = Spurious_Handler
-
 #pragma weak GPIOPortA_IRQHandler   = Spurious_Handler
 #pragma weak GPIOPortB_IRQHandler   = Spurious_Handler
 #pragma weak GPIOPortC_IRQHandler   = Spurious_Handler
@@ -150,20 +229,92 @@ void __attribute__ ((weak)) Spurious_Handler(void);
 #pragma weak Ethernet_IRQHandler    = Spurious_Handler
 #pragma weak Hibernate_IRQHandler   = Spurious_Handler
 
+#pragma weak USB0_IRQHandler        = Spurious_Handler
+#pragma weak PWMGen3_IRQHandler     = Spurious_Handler
+#pragma weak uDMAST_IRQHandler      = Spurious_Handler
+#pragma weak uDMAError_IRQHandler   = Spurious_Handler
+#pragma weak ADC1Seq0_IRQHandler    = Spurious_Handler
+#pragma weak ADC1Seq1_IRQHandler    = Spurious_Handler
+#pragma weak ADC1Seq2_IRQHandler    = Spurious_Handler
+#pragma weak ADC1Seq3_IRQHandler    = Spurious_Handler
+#pragma weak I2S0_IRQHandler        = Spurious_Handler
+#pragma weak EBI0_IRQHandler        = Spurious_Handler
+#pragma weak GPIOPortJ_IRQHandler   = Spurious_Handler
+#pragma weak GPIOPortK_IRQHandler   = Spurious_Handler
+#pragma weak GPIOPortL_IRQHandler   = Spurious_Handler
+#pragma weak SSI2_IRQHandler        = Spurious_Handler
+#pragma weak SSI3_IRQHandler        = Spurious_Handler
+#pragma weak UART3_IRQHandler       = Spurious_Handler
+#pragma weak UART4_IRQHandler       = Spurious_Handler
+#pragma weak UART5_IRQHandler       = Spurious_Handler
+#pragma weak UART6_IRQHandler       = Spurious_Handler
+#pragma weak UART7_IRQHandler       = Spurious_Handler
+#pragma weak I2C2_IRQHandler        = Spurious_Handler
+#pragma weak I2C3_IRQHandler        = Spurious_Handler
+#pragma weak Timer4A_IRQHandler     = Spurious_Handler
+#pragma weak Timer4B_IRQHandler     = Spurious_Handler
+#pragma weak Timer5A_IRQHandler     = Spurious_Handler
+#pragma weak Timer5B_IRQHandler     = Spurious_Handler
+#pragma weak WideTimer0A_IRQHandler = Spurious_Handler
+#pragma weak WideTimer0B_IRQHandler = Spurious_Handler
+#pragma weak WideTimer1A_IRQHandler = Spurious_Handler
+#pragma weak WideTimer1B_IRQHandler = Spurious_Handler
+#pragma weak WideTimer2A_IRQHandler = Spurious_Handler
+#pragma weak WideTimer2B_IRQHandler = Spurious_Handler
+#pragma weak WideTimer3A_IRQHandler = Spurious_Handler
+#pragma weak WideTimer3B_IRQHandler = Spurious_Handler
+#pragma weak WideTimer4A_IRQHandler = Spurious_Handler
+#pragma weak WideTimer4B_IRQHandler = Spurious_Handler
+#pragma weak WideTimer5A_IRQHandler = Spurious_Handler
+#pragma weak WideTimer5B_IRQHandler = Spurious_Handler
+#pragma weak FPU_IRQHandler         = Spurious_Handler
+#pragma weak PECI0_IRQHandler       = Spurious_Handler
+#pragma weak LPC0_IRQHandler        = Spurious_Handler
+#pragma weak I2C4_IRQHandler        = Spurious_Handler
+#pragma weak I2C5_IRQHandler        = Spurious_Handler
+#pragma weak GPIOPortM_IRQHandler   = Spurious_Handler
+#pragma weak GPIOPortN_IRQHandler   = Spurious_Handler
+#pragma weak QEI2_IRQHandler        = Spurious_Handler
+#pragma weak Fan0_IRQHandler        = Spurious_Handler
+#pragma weak GPIOPortP0_IRQHandler  = Spurious_Handler
+#pragma weak GPIOPortP1_IRQHandler  = Spurious_Handler
+#pragma weak GPIOPortP2_IRQHandler  = Spurious_Handler
+#pragma weak GPIOPortP3_IRQHandler  = Spurious_Handler
+#pragma weak GPIOPortP4_IRQHandler  = Spurious_Handler
+#pragma weak GPIOPortP5_IRQHandler  = Spurious_Handler
+#pragma weak GPIOPortP6_IRQHandler  = Spurious_Handler
+#pragma weak GPIOPortP7_IRQHandler  = Spurious_Handler
+#pragma weak GPIOPortQ0_IRQHandler  = Spurious_Handler
+#pragma weak GPIOPortQ1_IRQHandler  = Spurious_Handler
+#pragma weak GPIOPortQ2_IRQHandler  = Spurious_Handler
+#pragma weak GPIOPortQ3_IRQHandler  = Spurious_Handler
+#pragma weak GPIOPortQ4_IRQHandler  = Spurious_Handler
+#pragma weak GPIOPortQ5_IRQHandler  = Spurious_Handler
+#pragma weak GPIOPortQ6_IRQHandler  = Spurious_Handler
+#pragma weak GPIOPortQ7_IRQHandler  = Spurious_Handler
+#pragma weak GPIOPortR_IRQHandler   = Spurious_Handler
+#pragma weak GPIOPortS_IRQHandler   = Spurious_Handler
+#pragma weak PWM1Gen0_IRQHandler    = Spurious_Handler
+#pragma weak PWM1Gen1_IRQHandler    = Spurious_Handler
+#pragma weak PWM1Gen2_IRQHandler    = Spurious_Handler
+#pragma weak PWM1Gen3_IRQHandler    = Spurious_Handler
+#pragma weak PWM1Fault_IRQHandler   = Spurious_Handler
+
+
+/* start and end of stack defined in the linker script ---------------------*/
+extern unsigned __stack_start__;
+extern unsigned __stack_end__;
+
 /* exception and interrupt vector table ------------------------------------*/
-typedef void (*ExceptionHandler)(void);
-typedef union {
-    ExceptionHandler handler;
-    void            *pointer;
+typedef union VectorTableEntryTag {
+    void *pointer;                 /* used only to initialize the stack top */
+    void (*handler)(void); /* used for all exception and interrupt handlers */
 } VectorTableEntry;
 
-                               /* top of stack defined in the linker script */
-extern unsigned __c_stack_top__;
-
 /*..........................................................................*/
 __attribute__ ((section(".isr_vector")))
 VectorTableEntry const g_pfnVectors[] = {
-    { .pointer = &__c_stack_top__        }, /* initial stack pointer        */
+    { .pointer = &__stack_end__          }, /* initial stack pointer        */
     { .handler = &Reset_Handler          }, /* Reset Handler                */
     { .handler = &NMI_Handler            }, /* NMI Handler                  */
     { .handler = &HardFault_Handler      }, /* Hard Fault Handler           */
@@ -180,57 +331,150 @@ VectorTableEntry const g_pfnVectors[] = {
     { .handler = &PendSV_Handler         }, /* PendSV Handler               */
     { .handler = &SysTick_Handler        }, /* SysTick Handler              */
     /* external interrupts (IRQs) ... */
-    { .handler = GPIOPortA_IRQHandler    }, /* GPIO Port A                  */
-    { .handler = GPIOPortB_IRQHandler    }, /* GPIO Port B                  */
-    { .handler = GPIOPortC_IRQHandler    }, /* GPIO Port C                  */
-    { .handler = GPIOPortD_IRQHandler    }, /* GPIO Port D                  */
-    { .handler = GPIOPortE_IRQHandler    }, /* GPIO Port E                  */
-    { .handler = UART0_IRQHandler        }, /* UART0 Rx and Tx              */
-    { .handler = UART1_IRQHandler        }, /* UART1 Rx and Tx              */
-    { .handler = SSI0_IRQHandler         }, /* SSI0 Rx and Tx               */
-    { .handler = I2C0_IRQHandler         }, /* I2C0 Master and Slave        */
-    { .handler = PWMFault_IRQHandler     }, /* PWM Fault                    */
-    { .handler = PWMGen0_IRQHandler      }, /* PWM Generator 0              */
-    { .handler = PWMGen1_IRQHandler      }, /* PWM Generator 1              */
-    { .handler = PWMGen2_IRQHandler      }, /* PWM Generator 2              */
-    { .handler = QEI0_IRQHandler         }, /* Quadrature Encoder 0         */
-    { .handler = ADCSeq0_IRQHandler      }, /* ADC Sequence 0               */
-    { .handler = ADCSeq1_IRQHandler      }, /* ADC Sequence 1               */
-    { .handler = ADCSeq2_IRQHandler      }, /* ADC Sequence 2               */
-    { .handler = ADCSeq3_IRQHandler      }, /* ADC Sequence 3               */
-    { .handler = Watchdog_IRQHandler     }, /* Watchdog timer               */
-    { .handler = Timer0A_IRQHandler      }, /* Timer 0 subtimer A           */
-    { .handler = Timer0B_IRQHandler      }, /* Timer 0 subtimer B           */
-    { .handler = Timer1A_IRQHandler      }, /* Timer 1 subtimer A           */
-    { .handler = Timer1B_IRQHandler      }, /* Timer 1 subtimer B           */
-    { .handler = Timer2A_IRQHandler      }, /* Timer 2 subtimer A           */
-    { .handler = Timer2B_IRQHandler      }, /* Timer 2 subtimer B           */
-    { .handler = Comp0_IRQHandler        }, /* Analog Comparator 0          */
-    { .handler = Comp1_IRQHandler        }, /* Analog Comparator 1          */
-    { .handler = Comp2_IRQHandler        }, /* Analog Comparator 2          */
-    { .handler = SysCtrl_IRQHandler      }, /* System Control (PLL,OSC,BO)  */
-    { .handler = FlashCtrl_IRQHandler    }, /* FLASH Control                */
-    { .handler = GPIOPortF_IRQHandler    }, /* GPIO Port F                  */
-    { .handler = GPIOPortG_IRQHandler    }, /* GPIO Port G                  */
-    { .handler = GPIOPortH_IRQHandler    }, /* GPIO Port H                  */
-    { .handler = UART2_IRQHandler        }, /* UART2 Rx and Tx              */
-    { .handler = SSI1_IRQHandler         }, /* SSI1 Rx and Tx               */
-    { .handler = Timer3A_IRQHandler      }, /* Timer 3 subtimer A           */
-    { .handler = Timer3B_IRQHandler      }, /* Timer 3 subtimer B           */
-    { .handler = I2C1_IRQHandler         }, /* I2C1 Master and Slave        */
-    { .handler = QEI1_IRQHandler         }, /* Quadrature Encoder 1         */
-    { .handler = CAN0_IRQHandler         }, /* CAN0                         */
-    { .handler = CAN1_IRQHandler         }, /* CAN1                         */
-    { .handler = CAN2_IRQHandler         }, /* CAN2                         */
-    { .handler = Ethernet_IRQHandler     }, /* Ethernet                     */
-    { .handler = Hibernate_IRQHandler    }, /* Hibernate                    */
+    { .handler = &GPIOPortA_IRQHandler   }, /* GPIO Port A                  */
+    { .handler = &GPIOPortB_IRQHandler   }, /* GPIO Port B                  */
+    { .handler = &GPIOPortC_IRQHandler   }, /* GPIO Port C                  */
+    { .handler = &GPIOPortD_IRQHandler   }, /* GPIO Port D                  */
+    { .handler = &GPIOPortE_IRQHandler   }, /* GPIO Port E                  */
+    { .handler = &UART0_IRQHandler       }, /* UART0 Rx and Tx              */
+    { .handler = &UART1_IRQHandler       }, /* UART1 Rx and Tx              */
+    { .handler = &SSI0_IRQHandler        }, /* SSI0 Rx and Tx               */
+    { .handler = &I2C0_IRQHandler        }, /* I2C0 Master and Slave        */
+    { .handler = &PWMFault_IRQHandler    }, /* PWM Fault                    */
+    { .handler = &PWMGen0_IRQHandler     }, /* PWM Generator 0              */
+    { .handler = &PWMGen1_IRQHandler     }, /* PWM Generator 1              */
+    { .handler = &PWMGen2_IRQHandler     }, /* PWM Generator 2              */
+    { .handler = &QEI0_IRQHandler        }, /* Quadrature Encoder 0         */
+    { .handler = &ADCSeq0_IRQHandler     }, /* ADC Sequence 0               */
+    { .handler = &ADCSeq1_IRQHandler     }, /* ADC Sequence 1               */
+    { .handler = &ADCSeq2_IRQHandler     }, /* ADC Sequence 2               */
+    { .handler = &ADCSeq3_IRQHandler     }, /* ADC Sequence 3               */
+    { .handler = &Watchdog_IRQHandler    }, /* Watchdog timer               */
+    { .handler = &Timer0A_IRQHandler     }, /* Timer 0 subtimer A           */
+    { .handler = &Timer0B_IRQHandler     }, /* Timer 0 subtimer B           */
+    { .handler = &Timer1A_IRQHandler     }, /* Timer 1 subtimer A           */
+    { .handler = &Timer1B_IRQHandler     }, /* Timer 1 subtimer B           */
+    { .handler = &Timer2A_IRQHandler     }, /* Timer 2 subtimer A           */
+    { .handler = &Timer2B_IRQHandler     }, /* Timer 2 subtimer B           */
+    { .handler = &Comp0_IRQHandler       }, /* Analog Comparator 0          */
+    { .handler = &Comp1_IRQHandler       }, /* Analog Comparator 1          */
+    { .handler = &Comp2_IRQHandler       }, /* Analog Comparator 2          */
+    { .handler = &SysCtrl_IRQHandler     }, /* System Control (PLL,OSC,BO)  */
+    { .handler = &FlashCtrl_IRQHandler   }, /* FLASH Control                */
+    { .handler = &GPIOPortF_IRQHandler   }, /* GPIO Port F                  */
+    { .handler = &GPIOPortG_IRQHandler   }, /* GPIO Port G                  */
+    { .handler = &GPIOPortH_IRQHandler   }, /* GPIO Port H                  */
+    { .handler = &UART2_IRQHandler       }, /* UART2 Rx and Tx              */
+    { .handler = &SSI1_IRQHandler        }, /* SSI1 Rx and Tx               */
+    { .handler = &Timer3A_IRQHandler     }, /* Timer 3 subtimer A           */
+    { .handler = &Timer3B_IRQHandler     }, /* Timer 3 subtimer B           */
+    { .handler = &I2C1_IRQHandler        }, /* I2C1 Master and Slave        */
+    { .handler = &QEI1_IRQHandler        }, /* Quadrature Encoder 1         */
+    { .handler = &CAN0_IRQHandler        }, /* CAN0                         */
+    { .handler = &CAN1_IRQHandler        }, /* CAN1                         */
+    { .handler = &CAN2_IRQHandler        }, /* CAN2                         */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &Hibernate_IRQHandler   }, /* Hibernate                    */
+    { .handler = &USB0_IRQHandler        }, /* USB0                         */
+    { .handler = &PWMGen3_IRQHandler     }, /* PWM Generator 3              */
+    { .handler = &uDMAST_IRQHandler      }, /* uDMA Software Transfer       */
+    { .handler = &uDMAError_IRQHandler   }, /* uDMA Error                   */
+    { .handler = &ADC1Seq0_IRQHandler    }, /* ADC1 Sequence 0              */
+    { .handler = &ADC1Seq1_IRQHandler    }, /* ADC1 Sequence 1              */
+    { .handler = &ADC1Seq2_IRQHandler    }, /* ADC1 Sequence 2              */
+    { .handler = &ADC1Seq3_IRQHandler    }, /* ADC1 Sequence 3              */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &GPIOPortJ_IRQHandler   }, /* GPIO Port J                  */
+    { .handler = &GPIOPortK_IRQHandler   }, /* GPIO Port K                  */
+    { .handler = &GPIOPortL_IRQHandler   }, /* GPIO Port L                  */
+    { .handler = &SSI2_IRQHandler        }, /* SSI2 Rx and Tx               */
+    { .handler = &SSI3_IRQHandler        }, /* SSI3 Rx and Tx               */
+    { .handler = &UART3_IRQHandler       }, /* UART3 Rx and Tx              */
+    { .handler = &UART4_IRQHandler       }, /* UART4 Rx and Tx              */
+    { .handler = &UART5_IRQHandler       }, /* UART5 Rx and Tx              */
+    { .handler = &UART6_IRQHandler       }, /* UART6 Rx and Tx              */
+    { .handler = &UART7_IRQHandler       }, /* UART7 Rx and Tx              */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &I2C2_IRQHandler        }, /* I2C2 Master and Slave        */
+    { .handler = &I2C3_IRQHandler        }, /* I2C3 Master and Slave        */
+    { .handler = &Timer4A_IRQHandler     }, /* Timer 4 subtimer A           */
+    { .handler = &Timer4B_IRQHandler     }, /* Timer 4 subtimer B           */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &Timer5A_IRQHandler     }, /* Timer 5 subtimer A           */
+    { .handler = &Timer5B_IRQHandler     }, /* Timer 5 subtimer B           */
+    { .handler = &WideTimer0A_IRQHandler }, /* Wide Timer 0 subtimer A      */
+    { .handler = &WideTimer0B_IRQHandler }, /* Wide Timer 0 subtimer B      */
+    { .handler = &WideTimer1A_IRQHandler }, /* Wide Timer 1 subtimer A      */
+    { .handler = &WideTimer1B_IRQHandler }, /* Wide Timer 1 subtimer B      */
+    { .handler = &WideTimer2A_IRQHandler }, /* Wide Timer 2 subtimer A      */
+    { .handler = &WideTimer2B_IRQHandler }, /* Wide Timer 2 subtimer B      */
+    { .handler = &WideTimer3A_IRQHandler }, /* Wide Timer 3 subtimer A      */
+    { .handler = &WideTimer3B_IRQHandler }, /* Wide Timer 3 subtimer B      */
+    { .handler = &WideTimer4A_IRQHandler }, /* Wide Timer 4 subtimer A      */
+    { .handler = &WideTimer4B_IRQHandler }, /* Wide Timer 4 subtimer B      */
+    { .handler = &WideTimer5A_IRQHandler }, /* Wide Timer 5 subtimer A      */
+    { .handler = &WideTimer5B_IRQHandler }, /* Wide Timer 5 subtimer B      */
+    { .handler = &FPU_IRQHandler         }, /* FPU                          */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &I2C4_IRQHandler        }, /* I2C4 Master and Slave        */
+    { .handler = &I2C5_IRQHandler        }, /* I2C5 Master and Slave        */
+    { .handler = &GPIOPortM_IRQHandler   }, /* GPIO Port M                  */
+    { .handler = &GPIOPortN_IRQHandler   }, /* GPIO Port N                  */
+    { .handler = &QEI2_IRQHandler        }, /* Quadrature Encoder 2         */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &Spurious_Handler       }, /* Reserved                     */
+    { .handler = &GPIOPortP0_IRQHandler  }, /* GPIO Port P (Summary or P0)  */
+    { .handler = &GPIOPortP1_IRQHandler  }, /* GPIO Port P1                 */
+    { .handler = &GPIOPortP2_IRQHandler  }, /* GPIO Port P2                 */
+    { .handler = &GPIOPortP3_IRQHandler  }, /* GPIO Port P3                 */
+    { .handler = &GPIOPortP4_IRQHandler  }, /* GPIO Port P4                 */
+    { .handler = &GPIOPortP5_IRQHandler  }, /* GPIO Port P5                 */
+    { .handler = &GPIOPortP6_IRQHandler  }, /* GPIO Port P6                 */
+    { .handler = &GPIOPortP7_IRQHandler  }, /* GPIO Port P7                 */
+    { .handler = &GPIOPortQ0_IRQHandler  }, /* GPIO Port Q (Summary or Q0)  */
+    { .handler = &GPIOPortQ1_IRQHandler  }, /* GPIO Port Q1                 */
+    { .handler = &GPIOPortQ2_IRQHandler  }, /* GPIO Port Q2                 */
+    { .handler = &GPIOPortQ3_IRQHandler  }, /* GPIO Port Q3                 */
+    { .handler = &GPIOPortQ4_IRQHandler  }, /* GPIO Port Q4                 */
+    { .handler = &GPIOPortQ5_IRQHandler  }, /* GPIO Port Q5                 */
+    { .handler = &GPIOPortQ6_IRQHandler  }, /* GPIO Port Q6                 */
+    { .handler = &GPIOPortQ7_IRQHandler  }, /* GPIO Port Q7                 */
+    { .handler = &GPIOPortR_IRQHandler   }, /* GPIO Port R                  */
+    { .handler = &GPIOPortS_IRQHandler   }, /* GPIO Port S                  */
+    { .handler = &PWM1Gen0_IRQHandler    }, /* PWM 1 Generator 0            */
+    { .handler = &PWM1Gen1_IRQHandler    }, /* PWM 1 Generator 1            */
+    { .handler = &PWM1Gen2_IRQHandler    }, /* PWM 1 Generator 2            */
+    { .handler = &PWM1Gen3_IRQHandler    }, /* PWM 1 Generator 3            */
+    { .handler = &PWM1Fault_IRQHandler   }  /* PWM 1 Fault                  */
 };
 
-/* function prototypes -----------------------------------------------------*/
-void assert_failed(char const *file, int line);
 
-/*..........................................................................*/
-void Reset_Handler(void)    __attribute__((__interrupt__));
+/* exception handlers ------------------------------------------------------*/
+__attribute__((naked)) void Reset_Handler(void);
 void Reset_Handler(void) {
     extern int main(void);
     extern int __libc_init_array(void);
@@ -247,34 +491,64 @@ void Reset_Handler(void) {
     for (dst = &__data_start; dst < &__data_end__; ++dst, ++src) {
         *dst = *src;
     }
-
                                            /* zero fill the .bss segment... */
     for (dst = &__bss_start__; dst < &__bss_end__; ++dst) {
         *dst = 0;
     }
-            /* call all static constructors in C++ (harmless in C programs) */
-    //__libc_init_array(); // incompatible ARMv4 ISO C Library in Sourcery
+             /* call all static construcors in C++ (harmless in C programs) */
+    __libc_init_array();
 
-                                      /* call the application's entry point */
-    main();
-
-    /* in a bare-metal system main() has nothing to return to and it should
-    * never return. Just in case main() returns, the assert_failed() gives
-    * the last opportunity to catch this problem.
+    /* Enable the floating-point unit. This must be done here to handle the
+    * case where main() uses floating-point and the function prologue saves
+    * floating-point registers (which will fault if floating-point is not
+    * enabled). Any configuration of the floating-point unit using DriverLib
+    * APIs must be done here prior to the floating-point unit being enabled.
     */
-    assert_failed("startup_lm4f", __LINE__);
+    ROM_FPUEnable();
+
+    (void)main();  /* application's entry point, which should never return! */
 }
 /*..........................................................................*/
-void Spurious_Handler(void) __attribute__((__interrupt__));
-void Spurious_Handler(void) {
-    assert_failed("startup_stm32f10x_cl", __LINE__);
-    /* assert_failed() should not return, but just in case the following
-    * enless loop will tie up the CPU.
-    */
-    for (;;) {
+__attribute__((naked)) void NMI_Handler(void);
+void NMI_Handler(void) {
+    assert_failed("NMI", __LINE__);                 /* should never return! */
+}
+/*..........................................................................*/
+__attribute__((naked)) void MemManage_Handler(void);
+void MemManage_Handler(void) {
+    assert_failed("MemManage", __LINE__);           /* should never return! */
+}
+/*..........................................................................*/
+__attribute__((naked)) void HardFault_Handler(void);
+void HardFault_Handler(void) {
+    unsigned old_sp;
+    __asm volatile ("mov %0,sp" : "=r" (old_sp));
+    if (old_sp < (unsigned)&__stack_start__) {           /* stack overflow? */
+        unsigned new_sp = (unsigned)&__stack_end__;
+        __asm volatile ("mov sp,%0" :: "r" (new_sp));
+        assert_failed("StackOverflow", old_sp);     /* should never return! */
+    }
+    else {
+        assert_failed("HardFault", __LINE__);       /* should never return! */
     }
 }
 /*..........................................................................*/
+__attribute__((naked)) void BusFault_Handler(void);
+void BusFault_Handler(void) {
+    assert_failed("BusFault", __LINE__);            /* should never return! */
+}
+/*..........................................................................*/
+__attribute__((naked)) void UsageFault_Handler(void);
+void UsageFault_Handler(void) {
+    assert_failed("UsageFault", __LINE__);          /* should never return! */
+}
+/*..........................................................................*/
+__attribute__((naked)) void Spurious_Handler(void);
+void Spurious_Handler(void) {
+    assert_failed("Spurious", __LINE__);            /* should never return! */
+}
+/*..........................................................................*/
 void _init() {
 }
 
+

+ 95 - 62
examples/arm-cm/qk/gnu/dpp-qk_ek-tm4c123gxl/table.c

@@ -2,11 +2,19 @@
 * Model: dpp.qm
 * File:  ./table.c
 *
-* This file has been generated automatically by QP Modeler (QM).
-* DO NOT EDIT THIS FILE MANUALLY.
+* This code has been generated by QM tool (see state-machine.com/qm).
+* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
 *
-* Please visit www.state-machine.com/qm for more information.
+* 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.
+*
+* 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.
 *****************************************************************************/
+/* @(/3/2) .................................................................*/
 #include "qp_port.h"
 #include "dpp.h"
 #include "bsp.h"
@@ -17,7 +25,7 @@ Q_DEFINE_THIS_FILE
 /* @(/2/1) .................................................................*/
 typedef struct TableTag {
 /* protected: */
-    QActive super;
+    QMActive super;
 
 /* private: */
     uint8_t fork[N_PHILO];
@@ -26,9 +34,27 @@ typedef struct TableTag {
 
 /* protected: */
 static QState Table_initial(Table * const me, QEvt const * const e);
-static QState Table_active(Table * const me, QEvt const * const e);
-static QState Table_serving(Table * const me, QEvt const * const e);
-static QState Table_paused(Table * const me, QEvt const * const e);
+static QState Table_active  (Table * const me, QEvt const * const e);
+static QMState const Table_active_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Table_active),
+    Q_ACTION_CAST(0)
+};
+static QState Table_serving  (Table * const me, QEvt const * const e);
+static QState Table_serving_e(Table * const me);
+static QMState const Table_serving_s = {
+    &Table_active_s,
+    Q_STATE_CAST(&Table_serving),
+    Q_ACTION_CAST(0)
+};
+static QState Table_paused  (Table * const me, QEvt const * const e);
+static QState Table_paused_e(Table * const me);
+static QState Table_paused_x(Table * const me);
+static QMState const Table_paused_s = {
+    &Table_active_s,
+    Q_STATE_CAST(&Table_paused),
+    Q_ACTION_CAST(&Table_paused_x)
+};
 
 
 #define RIGHT(n_) ((uint8_t)(((n_) + (N_PHILO - 1U)) % N_PHILO))
@@ -48,7 +74,7 @@ void Table_ctor(void) {
     uint8_t n;
     Table *me = &l_table;
 
-    QActive_ctor(&me->super, Q_STATE_CAST(&Table_initial));
+    QMActive_ctor(&me->super, Q_STATE_CAST(&Table_initial));
 
     for (n = 0U; n < N_PHILO; ++n) {
         me->fork[n] = FREE;
@@ -59,6 +85,10 @@ void Table_ctor(void) {
 /* @(/2/1/2) ...............................................................*/
 /* @(/2/1/2/0) */
 static QState Table_initial(Table * const me, QEvt const * const e) {
+    static QActionHandler const act_[] = {
+        Q_ACTION_CAST(&Table_serving_e),
+        Q_ACTION_CAST(0)
+    };
     uint8_t n;
     (void)e; /* suppress the compiler warning about unused parameter */
 
@@ -83,57 +113,55 @@ static QState Table_initial(Table * const me, QEvt const * const e) {
         me->isHungry[n] = 0U;
         BSP_displayPhilStat(n, "thinking");
     }
-    return Q_TRAN(&Table_serving);
+    return QM_INITIAL(&Table_serving_s, act_);
 }
 /* @(/2/1/2/1) .............................................................*/
 static QState Table_active(Table * const me, QEvt const * const e) {
-    QState status;
+    QState status_;
     switch (e->sig) {
         /* @(/2/1/2/1/0) */
         case TERMINATE_SIG: {
             BSP_terminate(0);
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/1) */
         case EAT_SIG: {
             Q_ERROR();
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
-    return status;
+    return status_;
 }
 /* @(/2/1/2/1/2) ...........................................................*/
-static QState Table_serving(Table * const me, QEvt const * const e) {
-    QState status;
-    switch (e->sig) {
-        /* @(/2/1/2/1/2) */
-        case Q_ENTRY_SIG: {
-            uint8_t n;
-            for (n = 0U; n < N_PHILO; ++n) { /* give permissions to eat... */
-                if ((me->isHungry[n] != 0U)
-                    && (me->fork[LEFT(n)] == FREE)
-                    && (me->fork[n] == FREE))
-                {
-                    TableEvt *te;
+static QState Table_serving_e(Table * const me) {
+    uint8_t n;
+    for (n = 0U; n < N_PHILO; ++n) { /* give permissions to eat... */
+        if ((me->isHungry[n] != 0U)
+            && (me->fork[LEFT(n)] == FREE)
+            && (me->fork[n] == FREE))
+        {
+            TableEvt *te;
 
-                    me->fork[LEFT(n)] = USED;
-                    me->fork[n] = USED;
-                    te = Q_NEW(TableEvt, EAT_SIG);
-                    te->philoNum = n;
-                    QF_PUBLISH(&te->super, me);
-                    me->isHungry[n] = 0U;
-                    BSP_displayPhilStat(n, "eating  ");
-                }
-            }
-            status = Q_HANDLED();
-            break;
+            me->fork[LEFT(n)] = USED;
+            me->fork[n] = USED;
+            te = Q_NEW(TableEvt, EAT_SIG);
+            te->philoNum = n;
+            QF_PUBLISH(&te->super, me);
+            me->isHungry[n] = 0U;
+            BSP_displayPhilStat(n, "eating  ");
         }
+    }
+    return QM_ENTRY(&Table_serving_s);
+}
+static QState Table_serving(Table * const me, QEvt const * const e) {
+    QState status_;
+    switch (e->sig) {
         /* @(/2/1/2/1/2/0) */
         case HUNGRY_SIG: {
             uint8_t n, m;
@@ -153,12 +181,12 @@ static QState Table_serving(Table * const me, QEvt const * const e) {
                 pe->philoNum = n;
                 QF_PUBLISH(&pe->super, me);
                 BSP_displayPhilStat(n, "eating  ");
-                status = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             /* @(/2/1/2/1/2/0/1) */
             else {
                 me->isHungry[n] = 1U;
-                status = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             break;
         }
@@ -200,46 +228,51 @@ static QState Table_serving(Table * const me, QEvt const * const e) {
                 QF_PUBLISH(&pe->super, me);
                 BSP_displayPhilStat(m, "eating  ");
             }
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/2/2) */
         case EAT_SIG: {
             Q_ERROR();
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/2/3) */
         case PAUSE_SIG: {
-            status = Q_TRAN(&Table_paused);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Table_paused_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Table_paused_s, act_);
             break;
         }
         default: {
-            status = Q_SUPER(&Table_active);
+            status_ = QM_SUPER();
             break;
         }
     }
-    return status;
+    return status_;
 }
 /* @(/2/1/2/1/3) ...........................................................*/
+static QState Table_paused_e(Table * const me) {
+    BSP_displayPaused(1U);
+    return QM_ENTRY(&Table_paused_s);
+}
+static QState Table_paused_x(Table * const me) {
+    BSP_displayPaused(0U);
+    return QM_EXIT(&Table_paused_s);
+}
 static QState Table_paused(Table * const me, QEvt const * const e) {
-    QState status;
+    QState status_;
     switch (e->sig) {
-        /* @(/2/1/2/1/3) */
-        case Q_ENTRY_SIG: {
-            BSP_displayPaused(1U);
-            status = Q_HANDLED();
-            break;
-        }
-        /* @(/2/1/2/1/3) */
-        case Q_EXIT_SIG: {
-            BSP_displayPaused(0U);
-            status = Q_HANDLED();
-            break;
-        }
         /* @(/2/1/2/1/3/0) */
         case PAUSE_SIG: {
-            status = Q_TRAN(&Table_serving);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Table_paused_x),
+                Q_ACTION_CAST(&Table_serving_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Table_serving_s, act_);
             break;
         }
         /* @(/2/1/2/1/3/1) */
@@ -249,7 +282,7 @@ static QState Table_paused(Table * const me, QEvt const * const e) {
             Q_ASSERT((n < N_PHILO) && (me->isHungry[n] == 0U));
             me->isHungry[n] = 1U;
             BSP_displayPhilStat(n, "hungry  ");
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/3/2) */
@@ -267,14 +300,14 @@ static QState Table_paused(Table * const me, QEvt const * const e) {
 
             me->fork[m] = FREE;
             me->fork[n] = FREE;
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status = Q_SUPER(&Table_active);
+            status_ = QM_SUPER();
             break;
         }
     }
-    return status;
+    return status_;
 }
 

+ 5 - 1
examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1114/Makefile

@@ -219,8 +219,12 @@ $(BIN_DIR)/%.o : %.c
 $(BIN_DIR)/%.o : %.cpp
 	$(CPP) $(CPPFLAGS) -c $< -o $@
 
+# include dependency files only if our goal depends on their existence
+ifneq ($(MAKECMDGOALS),clean)
+  ifneq ($(MAKECMDGOALS),show)
 -include $(C_DEPS_EXT) $(CPP_DEPS_EXT)
-
+  endif
+endif
 
 .PHONY : clean
 clean:

+ 1 - 1
examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1114/bsp.c

@@ -98,7 +98,7 @@ void SysTick_Handler(void) {
     }
 #endif
 
-    QF_TICK(&l_SysTick_Handler);           /* process all armed time events */
+    QF_TICK_X(0U, &l_SysTick_Handler);    /* process time events for rate 0 */
 
     QK_ISR_EXIT();                         /* inform QK-nano about ISR exit */
 }

+ 13 - 3
examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1114/dpp.h

@@ -2,11 +2,19 @@
 * Model: dpp.qm
 * File:  ./dpp.h
 *
-* This file has been generated automatically by QP Modeler (QM).
-* DO NOT EDIT THIS FILE MANUALLY.
+* This code has been generated by QM tool (see state-machine.com/qm).
+* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
 *
-* Please visit www.state-machine.com/qm for more information.
+* 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.
+*
+* 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.
 *****************************************************************************/
+/* @(/3/0) .................................................................*/
 #ifndef dpp_h
 #define dpp_h
 
@@ -42,6 +50,8 @@ void Table_ctor(void);
 
 
 extern QActive * const AO_Philo[N_PHILO];
+
 extern QActive * const AO_Table;
 
+
 #endif                    /* dpp_h */

+ 57 - 9
examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1114/dpp.qm

@@ -1,6 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<model version="2.3.0">
- <documentation>Dining Philosopher Problem example</documentation>
+<model version="3.0.0">
+ <documentation>Dining Philosopher Problem example
+
+NOTE: Requries QP 5.</documentation>
  <framework name="qpc"/>
  <package name="Events" stereotype="0x01">
   <class name="TableEvt" superclass="qpc::QEvt">
@@ -8,7 +10,7 @@
   </class>
  </package>
  <package name="AOs" stereotype="0x02">
-  <class name="Philo" superclass="qpc::QActive">
+  <class name="Philo" superclass="qpc::QMActive">
    <attribute name="timeEvt" type="QTimeEvt" visibility="0x02" properties="0x00"/>
    <statechart>
     <initial target="../1">
@@ -42,7 +44,7 @@ QActive_subscribe(&amp;me-&gt;super, EAT_SIG);</action>
      </initial_glyph>
     </initial>
     <state name="thinking">
-     <entry>QTimeEvt_postIn(&amp;me-&gt;timeEvt, &amp;me-&gt;super, THINK_TIME);</entry>
+     <entry>QTimeEvt_armX(&amp;me-&gt;timeEvt, THINK_TIME, 0U);</entry>
      <tran trig="TIMEOUT" target="../../2">
       <tran_glyph conn="2,12,3,1,20,13,-3">
        <action box="0,-2,6,2"/>
@@ -86,7 +88,7 @@ Q_ASSERT(Q_EVT_CAST(TableEvt)-&gt;philoNum != PHILO_ID(me));</action>
      </state_glyph>
     </state>
     <state name="eating">
-     <entry>QTimeEvt_postIn(&amp;me-&gt;timeEvt, &amp;me-&gt;super, EAT_TIME);</entry>
+     <entry>QTimeEvt_armX(&amp;me-&gt;timeEvt, EAT_TIME, 0U);</entry>
      <exit>TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
 pe-&gt;philoNum = PHILO_ID(me);
 QF_PUBLISH(&amp;pe-&gt;super, me);</exit>
@@ -110,7 +112,7 @@ Q_ASSERT(Q_EVT_CAST(TableEvt)-&gt;philoNum != PHILO_ID(me));</action>
     <state_diagram size="37,61"/>
    </statechart>
   </class>
-  <class name="Table" superclass="qpc::QActive">
+  <class name="Table" superclass="qpc::QMActive">
    <attribute name="fork[N_PHILO]" type="uint8_t" visibility="0x02" properties="0x00"/>
    <attribute name="isHungry[N_PHILO]" type="uint8_t" visibility="0x02" properties="0x00"/>
    <statechart>
@@ -316,15 +318,15 @@ me-&gt;fork[n] = FREE;</action>
 Philo *me;
 for (n = 0U; n &lt; N_PHILO; ++n) {
     me = &amp;l_philo[n];
-    QActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Philo_initial));
-    QTimeEvt_ctor(&amp;me-&gt;timeEvt, TIMEOUT_SIG);
+    QMActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Philo_initial));
+    QTimeEvt_ctorX(&amp;me-&gt;timeEvt, &amp;me-&gt;super, TIMEOUT_SIG, 0U);
 }</code>
   </operation>
   <operation name="Table_ctor" type="void" visibility="0x00" properties="0x00">
    <code>uint8_t n;
 Table *me = &amp;l_table;
 
-QActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Table_initial));
+QMActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Table_initial));
 
 for (n = 0U; n &lt; N_PHILO; ++n) {
     me-&gt;fork[n] = FREE;
@@ -424,5 +426,51 @@ QActive * const AO_Table = &amp;l_table.super; /* &quot;opaque&quot; AO pointer
 $define(AOs::Table_ctor)
 $define(AOs::Table)</text>
   </file>
+  <file name="main.c">
+   <text>#include &quot;qp_port.h&quot;
+#include &quot;dpp.h&quot;
+#include &quot;bsp.h&quot;
+
+/*..........................................................................*/
+int main() {
+    static QEvt const *tableQueueSto[N_PHILO];
+    static QEvt const *philoQueueSto[N_PHILO][N_PHILO];
+    static QSubscrList subscrSto[MAX_PUB_SIG];
+    static QF_MPOOL_EL(TableEvt) smlPoolSto[2*N_PHILO];       /* small pool */
+    uint8_t n;
+
+    Philo_ctor();             /* instantiate all Philosopher active objects */
+    Table_ctor();                    /* instantiate the Table active object */
+
+    QF_init();     /* initialize the framework and the underlying RT kernel */
+    BSP_init();                     /* initialize the Board Support Package */
+
+                                                  /* object dictionaries... */
+    QS_OBJ_DICTIONARY(smlPoolSto);
+    QS_OBJ_DICTIONARY(tableQueueSto);
+    QS_OBJ_DICTIONARY(philoQueueSto[0]);
+    QS_OBJ_DICTIONARY(philoQueueSto[1]);
+    QS_OBJ_DICTIONARY(philoQueueSto[2]);
+    QS_OBJ_DICTIONARY(philoQueueSto[3]);
+    QS_OBJ_DICTIONARY(philoQueueSto[4]);
+
+    QF_psInit(subscrSto, Q_DIM(subscrSto));       /* init publish-subscribe */
+
+                                               /* initialize event pools... */
+    QF_poolInit(smlPoolSto, sizeof(smlPoolSto), sizeof(smlPoolSto[0]));
+
+    for (n = 0U; n &lt; N_PHILO; ++n) {         /* start the active objects... */
+        QACTIVE_START(AO_Philo[n], (uint8_t)(n + 1),
+                      philoQueueSto[n], Q_DIM(philoQueueSto[n]),
+                      (void *)0, 0U, (QEvt *)0);
+    }
+    QACTIVE_START(AO_Table, (uint8_t)(N_PHILO + 1),
+                  tableQueueSto, Q_DIM(tableQueueSto),
+                  (void *)0, 0U, (QEvt *)0);
+
+    return QF_run();                              /* run the QF application */
+}
+</text>
+  </file>
  </directory>
 </model>

+ 31 - 51
examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1114/main.c

@@ -1,81 +1,61 @@
 /*****************************************************************************
-* Product: DPP example
-* Last Updated for Version: 4.5.02
-* Date of the Last Update:  Jul 04, 2012
+* Model: dpp.qm
+* File:  ./main.c
 *
-*                    Q u a n t u m     L e a P s
-*                    ---------------------------
-*                    innovating embedded systems
-*
-* Copyright (C) 2002-2012 Quantum Leaps, LLC. All rights reserved.
+* This code has been generated by QM tool (see state-machine.com/qm).
+* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
 *
 * 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 3 of the License, or
-* (at your option) any later version.
-*
-* 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.
-*
-* 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/>.
+* by the Free Software Foundation.
 *
-* Contact information:
-* Quantum Leaps Web sites: http://www.quantum-leaps.com
-*                          http://www.state-machine.com
-* e-mail:                  info@quantum-leaps.com
+* 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.
 *****************************************************************************/
+/* @(/3/3) .................................................................*/
 #include "qp_port.h"
 #include "dpp.h"
 #include "bsp.h"
 
-/* Local-scope objects -----------------------------------------------------*/
-static QEvt const *l_tableQueueSto[N_PHILO];
-static QEvt const *l_philoQueueSto[N_PHILO][N_PHILO];
-static QSubscrList l_subscrSto[MAX_PUB_SIG];
-
-/* storage for event pools... */
-static QF_MPOOL_EL(TableEvt) l_smlPoolSto[2*N_PHILO];         /* small pool */
-
 /*..........................................................................*/
-int main(void) {
+int main() {
+    static QEvt const *tableQueueSto[N_PHILO];
+    static QEvt const *philoQueueSto[N_PHILO][N_PHILO];
+    static QSubscrList subscrSto[MAX_PUB_SIG];
+    static QF_MPOOL_EL(TableEvt) smlPoolSto[2*N_PHILO];       /* small pool */
     uint8_t n;
 
     Philo_ctor();             /* instantiate all Philosopher active objects */
     Table_ctor();                    /* instantiate the Table active object */
 
     QF_init();     /* initialize the framework and the underlying RT kernel */
-    BSP_init();                                       /* initialize the BSP */
+    BSP_init();                     /* initialize the Board Support Package */
 
                                                   /* object dictionaries... */
-    QS_OBJ_DICTIONARY(l_smlPoolSto);
-    QS_OBJ_DICTIONARY(l_tableQueueSto);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[0]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[1]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[2]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[3]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[4]);
+    QS_OBJ_DICTIONARY(smlPoolSto);
+    QS_OBJ_DICTIONARY(tableQueueSto);
+    QS_OBJ_DICTIONARY(philoQueueSto[0]);
+    QS_OBJ_DICTIONARY(philoQueueSto[1]);
+    QS_OBJ_DICTIONARY(philoQueueSto[2]);
+    QS_OBJ_DICTIONARY(philoQueueSto[3]);
+    QS_OBJ_DICTIONARY(philoQueueSto[4]);
 
-    QF_psInit(l_subscrSto, Q_DIM(l_subscrSto));   /* init publish-subscribe */
+    QF_psInit(subscrSto, Q_DIM(subscrSto));       /* init publish-subscribe */
 
                                                /* initialize event pools... */
-    QF_poolInit(l_smlPoolSto, sizeof(l_smlPoolSto), sizeof(l_smlPoolSto[0]));
+    QF_poolInit(smlPoolSto, sizeof(smlPoolSto), sizeof(smlPoolSto[0]));
 
-    for (n = 0; n < N_PHILO; ++n) {          /* start the active objects... */
-        QActive_start(AO_Philo[n], (uint8_t)(n + 1),
-                      l_philoQueueSto[n], Q_DIM(l_philoQueueSto[n]),
+    for (n = 0U; n < N_PHILO; ++n) {         /* start the active objects... */
+        QACTIVE_START(AO_Philo[n], (uint8_t)(n + 1),
+                      philoQueueSto[n], Q_DIM(philoQueueSto[n]),
                       (void *)0, 0U, (QEvt *)0);
     }
-    QActive_start(AO_Table, (uint8_t)(N_PHILO + 1),
-                  l_tableQueueSto, Q_DIM(l_tableQueueSto),
+    QACTIVE_START(AO_Table, (uint8_t)(N_PHILO + 1),
+                  tableQueueSto, Q_DIM(tableQueueSto),
                   (void *)0, 0U, (QEvt *)0);
 
     return QF_run();                              /* run the QF application */
 }
+

+ 90 - 54
examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1114/philo.c

@@ -2,11 +2,19 @@
 * Model: dpp.qm
 * File:  ./philo.c
 *
-* This file has been generated automatically by QP Modeler (QM).
-* DO NOT EDIT THIS FILE MANUALLY.
+* This code has been generated by QM tool (see state-machine.com/qm).
+* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
 *
-* Please visit www.state-machine.com/qm for more information.
+* 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.
+*
+* 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.
 *****************************************************************************/
+/* @(/3/1) .................................................................*/
 #include "qp_port.h"
 #include "dpp.h"
 #include "bsp.h"
@@ -17,7 +25,7 @@ Q_DEFINE_THIS_FILE
 /* @(/2/0) .................................................................*/
 typedef struct PhiloTag {
 /* protected: */
-    QActive super;
+    QMActive super;
 
 /* private: */
     QTimeEvt timeEvt;
@@ -25,9 +33,28 @@ typedef struct PhiloTag {
 
 /* protected: */
 static QState Philo_initial(Philo * const me, QEvt const * const e);
-static QState Philo_thinking(Philo * const me, QEvt const * const e);
-static QState Philo_hungry(Philo * const me, QEvt const * const e);
-static QState Philo_eating(Philo * const me, QEvt const * const e);
+static QState Philo_thinking  (Philo * const me, QEvt const * const e);
+static QState Philo_thinking_e(Philo * const me);
+static QMState const Philo_thinking_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Philo_thinking),
+    Q_ACTION_CAST(0)
+};
+static QState Philo_hungry  (Philo * const me, QEvt const * const e);
+static QState Philo_hungry_e(Philo * const me);
+static QMState const Philo_hungry_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Philo_hungry),
+    Q_ACTION_CAST(0)
+};
+static QState Philo_eating  (Philo * const me, QEvt const * const e);
+static QState Philo_eating_e(Philo * const me);
+static QState Philo_eating_x(Philo * const me);
+static QMState const Philo_eating_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Philo_eating),
+    Q_ACTION_CAST(&Philo_eating_x)
+};
 
 
 /* Local objects -----------------------------------------------------------*/
@@ -61,14 +88,18 @@ void Philo_ctor(void) {
     Philo *me;
     for (n = 0U; n < N_PHILO; ++n) {
         me = &l_philo[n];
-        QActive_ctor(&me->super, Q_STATE_CAST(&Philo_initial));
-        QTimeEvt_ctor(&me->timeEvt, TIMEOUT_SIG);
+        QMActive_ctor(&me->super, Q_STATE_CAST(&Philo_initial));
+        QTimeEvt_ctorX(&me->timeEvt, &me->super, TIMEOUT_SIG, 0U);
     }
 }
 /* @(/2/0) .................................................................*/
 /* @(/2/0/1) ...............................................................*/
 /* @(/2/0/1/0) */
 static QState Philo_initial(Philo * const me, QEvt const * const e) {
+    static QActionHandler const act_[] = {
+        Q_ACTION_CAST(&Philo_thinking_e),
+        Q_ACTION_CAST(0)
+    };
     static uint8_t registered = (uint8_t)0; /* starts off with 0, per C-standard */
     (void)e; /* suppress the compiler warning about unused parameter */
     if (registered == (uint8_t)0) {
@@ -94,21 +125,23 @@ static QState Philo_initial(Philo * const me, QEvt const * const e) {
     QS_SIG_DICTIONARY(TIMEOUT_SIG, me); /* signal for each Philos */
 
     QActive_subscribe(&me->super, EAT_SIG);
-    return Q_TRAN(&Philo_thinking);
+    return QM_INITIAL(&Philo_thinking_s, act_);
 }
 /* @(/2/0/1/1) .............................................................*/
+static QState Philo_thinking_e(Philo * const me) {
+    QTimeEvt_armX(&me->timeEvt, THINK_TIME, 0U);
+    return QM_ENTRY(&Philo_thinking_s);
+}
 static QState Philo_thinking(Philo * const me, QEvt const * const e) {
-    QState status;
+    QState status_;
     switch (e->sig) {
-        /* @(/2/0/1/1) */
-        case Q_ENTRY_SIG: {
-            QTimeEvt_postIn(&me->timeEvt, &me->super, THINK_TIME);
-            status = Q_HANDLED();
-            break;
-        }
         /* @(/2/0/1/1/0) */
         case TIMEOUT_SIG: {
-            status = Q_TRAN(&Philo_hungry);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Philo_hungry_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Philo_hungry_s, act_);
             break;
         }
         /* @(/2/0/1/1/1) */
@@ -116,36 +149,38 @@ static QState Philo_thinking(Philo * const me, QEvt const * const e) {
         case DONE_SIG: {
             /* EAT or DONE must be for other Philos than this one */
             Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
-    return status;
+    return status_;
 }
 /* @(/2/0/1/2) .............................................................*/
+static QState Philo_hungry_e(Philo * const me) {
+    TableEvt *pe = Q_NEW(TableEvt, HUNGRY_SIG);
+    pe->philoNum = PHILO_ID(me);
+    QACTIVE_POST(AO_Table, &pe->super, me);
+    return QM_ENTRY(&Philo_hungry_s);
+}
 static QState Philo_hungry(Philo * const me, QEvt const * const e) {
-    QState status;
+    QState status_;
     switch (e->sig) {
-        /* @(/2/0/1/2) */
-        case Q_ENTRY_SIG: {
-            TableEvt *pe = Q_NEW(TableEvt, HUNGRY_SIG);
-            pe->philoNum = PHILO_ID(me);
-            QACTIVE_POST(AO_Table, &pe->super, me);
-            status = Q_HANDLED();
-            break;
-        }
         /* @(/2/0/1/2/0) */
         case EAT_SIG: {
             /* @(/2/0/1/2/0/0) */
             if (Q_EVT_CAST(TableEvt)->philoNum == PHILO_ID(me)) {
-                status = Q_TRAN(&Philo_eating);
+                static QActionHandler const act_[] = {
+                    Q_ACTION_CAST(&Philo_eating_e),
+                    Q_ACTION_CAST(0)
+                };
+                status_ = QM_TRAN(&Philo_eating_s, act_);
             }
             else {
-                status = Q_UNHANDLED();
+                status_ = QM_UNHANDLED();
             }
             break;
         }
@@ -153,37 +188,38 @@ static QState Philo_hungry(Philo * const me, QEvt const * const e) {
         case DONE_SIG: {
             /* DONE must be for other Philos than this one */
             Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
-    return status;
+    return status_;
 }
 /* @(/2/0/1/3) .............................................................*/
+static QState Philo_eating_e(Philo * const me) {
+    QTimeEvt_armX(&me->timeEvt, EAT_TIME, 0U);
+    return QM_ENTRY(&Philo_eating_s);
+}
+static QState Philo_eating_x(Philo * const me) {
+    TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
+    pe->philoNum = PHILO_ID(me);
+    QF_PUBLISH(&pe->super, me);
+    return QM_EXIT(&Philo_eating_s);
+}
 static QState Philo_eating(Philo * const me, QEvt const * const e) {
-    QState status;
+    QState status_;
     switch (e->sig) {
-        /* @(/2/0/1/3) */
-        case Q_ENTRY_SIG: {
-            QTimeEvt_postIn(&me->timeEvt, &me->super, EAT_TIME);
-            status = Q_HANDLED();
-            break;
-        }
-        /* @(/2/0/1/3) */
-        case Q_EXIT_SIG: {
-            TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
-            pe->philoNum = PHILO_ID(me);
-            QF_PUBLISH(&pe->super, me);
-            status = Q_HANDLED();
-            break;
-        }
         /* @(/2/0/1/3/0) */
         case TIMEOUT_SIG: {
-            status = Q_TRAN(&Philo_thinking);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Philo_eating_x),
+                Q_ACTION_CAST(&Philo_thinking_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Philo_thinking_s, act_);
             break;
         }
         /* @(/2/0/1/3/1) */
@@ -191,14 +227,14 @@ static QState Philo_eating(Philo * const me, QEvt const * const e) {
         case DONE_SIG: {
             /* EAT or DONE must be for other Philos than this one */
             Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
-    return status;
+    return status_;
 }
 

+ 95 - 62
examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1114/table.c

@@ -2,11 +2,19 @@
 * Model: dpp.qm
 * File:  ./table.c
 *
-* This file has been generated automatically by QP Modeler (QM).
-* DO NOT EDIT THIS FILE MANUALLY.
+* This code has been generated by QM tool (see state-machine.com/qm).
+* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
 *
-* Please visit www.state-machine.com/qm for more information.
+* 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.
+*
+* 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.
 *****************************************************************************/
+/* @(/3/2) .................................................................*/
 #include "qp_port.h"
 #include "dpp.h"
 #include "bsp.h"
@@ -17,7 +25,7 @@ Q_DEFINE_THIS_FILE
 /* @(/2/1) .................................................................*/
 typedef struct TableTag {
 /* protected: */
-    QActive super;
+    QMActive super;
 
 /* private: */
     uint8_t fork[N_PHILO];
@@ -26,9 +34,27 @@ typedef struct TableTag {
 
 /* protected: */
 static QState Table_initial(Table * const me, QEvt const * const e);
-static QState Table_active(Table * const me, QEvt const * const e);
-static QState Table_serving(Table * const me, QEvt const * const e);
-static QState Table_paused(Table * const me, QEvt const * const e);
+static QState Table_active  (Table * const me, QEvt const * const e);
+static QMState const Table_active_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Table_active),
+    Q_ACTION_CAST(0)
+};
+static QState Table_serving  (Table * const me, QEvt const * const e);
+static QState Table_serving_e(Table * const me);
+static QMState const Table_serving_s = {
+    &Table_active_s,
+    Q_STATE_CAST(&Table_serving),
+    Q_ACTION_CAST(0)
+};
+static QState Table_paused  (Table * const me, QEvt const * const e);
+static QState Table_paused_e(Table * const me);
+static QState Table_paused_x(Table * const me);
+static QMState const Table_paused_s = {
+    &Table_active_s,
+    Q_STATE_CAST(&Table_paused),
+    Q_ACTION_CAST(&Table_paused_x)
+};
 
 
 #define RIGHT(n_) ((uint8_t)(((n_) + (N_PHILO - 1U)) % N_PHILO))
@@ -48,7 +74,7 @@ void Table_ctor(void) {
     uint8_t n;
     Table *me = &l_table;
 
-    QActive_ctor(&me->super, Q_STATE_CAST(&Table_initial));
+    QMActive_ctor(&me->super, Q_STATE_CAST(&Table_initial));
 
     for (n = 0U; n < N_PHILO; ++n) {
         me->fork[n] = FREE;
@@ -59,6 +85,10 @@ void Table_ctor(void) {
 /* @(/2/1/2) ...............................................................*/
 /* @(/2/1/2/0) */
 static QState Table_initial(Table * const me, QEvt const * const e) {
+    static QActionHandler const act_[] = {
+        Q_ACTION_CAST(&Table_serving_e),
+        Q_ACTION_CAST(0)
+    };
     uint8_t n;
     (void)e; /* suppress the compiler warning about unused parameter */
 
@@ -83,57 +113,55 @@ static QState Table_initial(Table * const me, QEvt const * const e) {
         me->isHungry[n] = 0U;
         BSP_displayPhilStat(n, "thinking");
     }
-    return Q_TRAN(&Table_serving);
+    return QM_INITIAL(&Table_serving_s, act_);
 }
 /* @(/2/1/2/1) .............................................................*/
 static QState Table_active(Table * const me, QEvt const * const e) {
-    QState status;
+    QState status_;
     switch (e->sig) {
         /* @(/2/1/2/1/0) */
         case TERMINATE_SIG: {
             BSP_terminate(0);
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/1) */
         case EAT_SIG: {
             Q_ERROR();
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
-    return status;
+    return status_;
 }
 /* @(/2/1/2/1/2) ...........................................................*/
-static QState Table_serving(Table * const me, QEvt const * const e) {
-    QState status;
-    switch (e->sig) {
-        /* @(/2/1/2/1/2) */
-        case Q_ENTRY_SIG: {
-            uint8_t n;
-            for (n = 0U; n < N_PHILO; ++n) { /* give permissions to eat... */
-                if ((me->isHungry[n] != 0U)
-                    && (me->fork[LEFT(n)] == FREE)
-                    && (me->fork[n] == FREE))
-                {
-                    TableEvt *te;
+static QState Table_serving_e(Table * const me) {
+    uint8_t n;
+    for (n = 0U; n < N_PHILO; ++n) { /* give permissions to eat... */
+        if ((me->isHungry[n] != 0U)
+            && (me->fork[LEFT(n)] == FREE)
+            && (me->fork[n] == FREE))
+        {
+            TableEvt *te;
 
-                    me->fork[LEFT(n)] = USED;
-                    me->fork[n] = USED;
-                    te = Q_NEW(TableEvt, EAT_SIG);
-                    te->philoNum = n;
-                    QF_PUBLISH(&te->super, me);
-                    me->isHungry[n] = 0U;
-                    BSP_displayPhilStat(n, "eating  ");
-                }
-            }
-            status = Q_HANDLED();
-            break;
+            me->fork[LEFT(n)] = USED;
+            me->fork[n] = USED;
+            te = Q_NEW(TableEvt, EAT_SIG);
+            te->philoNum = n;
+            QF_PUBLISH(&te->super, me);
+            me->isHungry[n] = 0U;
+            BSP_displayPhilStat(n, "eating  ");
         }
+    }
+    return QM_ENTRY(&Table_serving_s);
+}
+static QState Table_serving(Table * const me, QEvt const * const e) {
+    QState status_;
+    switch (e->sig) {
         /* @(/2/1/2/1/2/0) */
         case HUNGRY_SIG: {
             uint8_t n, m;
@@ -153,12 +181,12 @@ static QState Table_serving(Table * const me, QEvt const * const e) {
                 pe->philoNum = n;
                 QF_PUBLISH(&pe->super, me);
                 BSP_displayPhilStat(n, "eating  ");
-                status = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             /* @(/2/1/2/1/2/0/1) */
             else {
                 me->isHungry[n] = 1U;
-                status = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             break;
         }
@@ -200,46 +228,51 @@ static QState Table_serving(Table * const me, QEvt const * const e) {
                 QF_PUBLISH(&pe->super, me);
                 BSP_displayPhilStat(m, "eating  ");
             }
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/2/2) */
         case EAT_SIG: {
             Q_ERROR();
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/2/3) */
         case PAUSE_SIG: {
-            status = Q_TRAN(&Table_paused);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Table_paused_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Table_paused_s, act_);
             break;
         }
         default: {
-            status = Q_SUPER(&Table_active);
+            status_ = QM_SUPER();
             break;
         }
     }
-    return status;
+    return status_;
 }
 /* @(/2/1/2/1/3) ...........................................................*/
+static QState Table_paused_e(Table * const me) {
+    BSP_displayPaused(1U);
+    return QM_ENTRY(&Table_paused_s);
+}
+static QState Table_paused_x(Table * const me) {
+    BSP_displayPaused(0U);
+    return QM_EXIT(&Table_paused_s);
+}
 static QState Table_paused(Table * const me, QEvt const * const e) {
-    QState status;
+    QState status_;
     switch (e->sig) {
-        /* @(/2/1/2/1/3) */
-        case Q_ENTRY_SIG: {
-            BSP_displayPaused(1U);
-            status = Q_HANDLED();
-            break;
-        }
-        /* @(/2/1/2/1/3) */
-        case Q_EXIT_SIG: {
-            BSP_displayPaused(0U);
-            status = Q_HANDLED();
-            break;
-        }
         /* @(/2/1/2/1/3/0) */
         case PAUSE_SIG: {
-            status = Q_TRAN(&Table_serving);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Table_paused_x),
+                Q_ACTION_CAST(&Table_serving_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Table_serving_s, act_);
             break;
         }
         /* @(/2/1/2/1/3/1) */
@@ -249,7 +282,7 @@ static QState Table_paused(Table * const me, QEvt const * const e) {
             Q_ASSERT((n < N_PHILO) && (me->isHungry[n] == 0U));
             me->isHungry[n] = 1U;
             BSP_displayPhilStat(n, "hungry  ");
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/3/2) */
@@ -267,14 +300,14 @@ static QState Table_paused(Table * const me, QEvt const * const e) {
 
             me->fork[m] = FREE;
             me->fork[n] = FREE;
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status = Q_SUPER(&Table_active);
+            status_ = QM_SUPER();
             break;
         }
     }
-    return status;
+    return status_;
 }
 

+ 5 - 1
examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1343/Makefile

@@ -219,8 +219,12 @@ $(BIN_DIR)/%.o : %.c
 $(BIN_DIR)/%.o : %.cpp
 	$(CPP) $(CPPFLAGS) -c $< -o $@
 
+# include dependency files only if our goal depends on their existence
+ifneq ($(MAKECMDGOALS),clean)
+  ifneq ($(MAKECMDGOALS),show)
 -include $(C_DEPS_EXT) $(CPP_DEPS_EXT)
-
+  endif
+endif
 
 .PHONY : clean
 clean:

+ 3 - 4
examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1343/bsp.c

@@ -1,7 +1,7 @@
 /*****************************************************************************
 * Product: DPP example, LPCXpresso-1343 board, QK kernel, GNU/CodeRed
-* Last Updated for Version: 5.1.0
-* Date of the Last Update:  Sep 21, 2013
+* Last Updated for Version: 5.2.0
+* Date of the Last Update:  Dec 25, 2013
 *
 *                    Q u a n t u m     L e a P s
 *                    ---------------------------
@@ -98,7 +98,7 @@ void SysTick_Handler(void) {
     }
 #endif
 
-    QF_TICK(&l_SysTick_Handler);           /* process all armed time events */
+    QF_TICK_X(0U, &l_SysTick_Handler);    /* process time events for rate 0 */
 
     QK_ISR_EXIT();                         /* inform QK-nano about ISR exit */
 }
@@ -124,7 +124,6 @@ void BSP_init(void) {
         Q_ERROR();
     }
 
-    QS_RESET();
     QS_OBJ_DICTIONARY(&l_SysTick_Handler);
     QS_OBJ_DICTIONARY(&l_PIOINT0_IRQHandler);
 }

+ 13 - 3
examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1343/dpp.h

@@ -2,11 +2,19 @@
 * Model: dpp.qm
 * File:  ./dpp.h
 *
-* This file has been generated automatically by QP Modeler (QM).
-* DO NOT EDIT THIS FILE MANUALLY.
+* This code has been generated by QM tool (see state-machine.com/qm).
+* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
 *
-* Please visit www.state-machine.com/qm for more information.
+* 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.
+*
+* 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.
 *****************************************************************************/
+/* @(/3/0) .................................................................*/
 #ifndef dpp_h
 #define dpp_h
 
@@ -42,6 +50,8 @@ void Table_ctor(void);
 
 
 extern QActive * const AO_Philo[N_PHILO];
+
 extern QActive * const AO_Table;
 
+
 #endif                    /* dpp_h */

+ 57 - 9
examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1343/dpp.qm

@@ -1,6 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<model version="2.3.0">
- <documentation>Dining Philosopher Problem example</documentation>
+<model version="3.0.0">
+ <documentation>Dining Philosopher Problem example
+
+NOTE: Requries QP 5.</documentation>
  <framework name="qpc"/>
  <package name="Events" stereotype="0x01">
   <class name="TableEvt" superclass="qpc::QEvt">
@@ -8,7 +10,7 @@
   </class>
  </package>
  <package name="AOs" stereotype="0x02">
-  <class name="Philo" superclass="qpc::QActive">
+  <class name="Philo" superclass="qpc::QMActive">
    <attribute name="timeEvt" type="QTimeEvt" visibility="0x02" properties="0x00"/>
    <statechart>
     <initial target="../1">
@@ -42,7 +44,7 @@ QActive_subscribe(&amp;me-&gt;super, EAT_SIG);</action>
      </initial_glyph>
     </initial>
     <state name="thinking">
-     <entry>QTimeEvt_postIn(&amp;me-&gt;timeEvt, &amp;me-&gt;super, THINK_TIME);</entry>
+     <entry>QTimeEvt_armX(&amp;me-&gt;timeEvt, THINK_TIME, 0U);</entry>
      <tran trig="TIMEOUT" target="../../2">
       <tran_glyph conn="2,12,3,1,20,13,-3">
        <action box="0,-2,6,2"/>
@@ -86,7 +88,7 @@ Q_ASSERT(Q_EVT_CAST(TableEvt)-&gt;philoNum != PHILO_ID(me));</action>
      </state_glyph>
     </state>
     <state name="eating">
-     <entry>QTimeEvt_postIn(&amp;me-&gt;timeEvt, &amp;me-&gt;super, EAT_TIME);</entry>
+     <entry>QTimeEvt_armX(&amp;me-&gt;timeEvt, EAT_TIME, 0U);</entry>
      <exit>TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
 pe-&gt;philoNum = PHILO_ID(me);
 QF_PUBLISH(&amp;pe-&gt;super, me);</exit>
@@ -110,7 +112,7 @@ Q_ASSERT(Q_EVT_CAST(TableEvt)-&gt;philoNum != PHILO_ID(me));</action>
     <state_diagram size="37,61"/>
    </statechart>
   </class>
-  <class name="Table" superclass="qpc::QActive">
+  <class name="Table" superclass="qpc::QMActive">
    <attribute name="fork[N_PHILO]" type="uint8_t" visibility="0x02" properties="0x00"/>
    <attribute name="isHungry[N_PHILO]" type="uint8_t" visibility="0x02" properties="0x00"/>
    <statechart>
@@ -316,15 +318,15 @@ me-&gt;fork[n] = FREE;</action>
 Philo *me;
 for (n = 0U; n &lt; N_PHILO; ++n) {
     me = &amp;l_philo[n];
-    QActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Philo_initial));
-    QTimeEvt_ctor(&amp;me-&gt;timeEvt, TIMEOUT_SIG);
+    QMActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Philo_initial));
+    QTimeEvt_ctorX(&amp;me-&gt;timeEvt, &amp;me-&gt;super, TIMEOUT_SIG, 0U);
 }</code>
   </operation>
   <operation name="Table_ctor" type="void" visibility="0x00" properties="0x00">
    <code>uint8_t n;
 Table *me = &amp;l_table;
 
-QActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Table_initial));
+QMActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Table_initial));
 
 for (n = 0U; n &lt; N_PHILO; ++n) {
     me-&gt;fork[n] = FREE;
@@ -424,5 +426,51 @@ QActive * const AO_Table = &amp;l_table.super; /* &quot;opaque&quot; AO pointer
 $define(AOs::Table_ctor)
 $define(AOs::Table)</text>
   </file>
+  <file name="main.c">
+   <text>#include &quot;qp_port.h&quot;
+#include &quot;dpp.h&quot;
+#include &quot;bsp.h&quot;
+
+/*..........................................................................*/
+int main() {
+    static QEvt const *tableQueueSto[N_PHILO];
+    static QEvt const *philoQueueSto[N_PHILO][N_PHILO];
+    static QSubscrList subscrSto[MAX_PUB_SIG];
+    static QF_MPOOL_EL(TableEvt) smlPoolSto[2*N_PHILO];       /* small pool */
+    uint8_t n;
+
+    Philo_ctor();             /* instantiate all Philosopher active objects */
+    Table_ctor();                    /* instantiate the Table active object */
+
+    QF_init();     /* initialize the framework and the underlying RT kernel */
+    BSP_init();                     /* initialize the Board Support Package */
+
+                                                  /* object dictionaries... */
+    QS_OBJ_DICTIONARY(smlPoolSto);
+    QS_OBJ_DICTIONARY(tableQueueSto);
+    QS_OBJ_DICTIONARY(philoQueueSto[0]);
+    QS_OBJ_DICTIONARY(philoQueueSto[1]);
+    QS_OBJ_DICTIONARY(philoQueueSto[2]);
+    QS_OBJ_DICTIONARY(philoQueueSto[3]);
+    QS_OBJ_DICTIONARY(philoQueueSto[4]);
+
+    QF_psInit(subscrSto, Q_DIM(subscrSto));       /* init publish-subscribe */
+
+                                               /* initialize event pools... */
+    QF_poolInit(smlPoolSto, sizeof(smlPoolSto), sizeof(smlPoolSto[0]));
+
+    for (n = 0U; n &lt; N_PHILO; ++n) {         /* start the active objects... */
+        QACTIVE_START(AO_Philo[n], (uint8_t)(n + 1),
+                      philoQueueSto[n], Q_DIM(philoQueueSto[n]),
+                      (void *)0, 0U, (QEvt *)0);
+    }
+    QACTIVE_START(AO_Table, (uint8_t)(N_PHILO + 1),
+                  tableQueueSto, Q_DIM(tableQueueSto),
+                  (void *)0, 0U, (QEvt *)0);
+
+    return QF_run();                              /* run the QF application */
+}
+</text>
+  </file>
  </directory>
 </model>

+ 31 - 51
examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1343/main.c

@@ -1,81 +1,61 @@
 /*****************************************************************************
-* Product: DPP example
-* Last Updated for Version: 4.5.02
-* Date of the Last Update:  Jul 04, 2012
+* Model: dpp.qm
+* File:  ./main.c
 *
-*                    Q u a n t u m     L e a P s
-*                    ---------------------------
-*                    innovating embedded systems
-*
-* Copyright (C) 2002-2012 Quantum Leaps, LLC. All rights reserved.
+* This code has been generated by QM tool (see state-machine.com/qm).
+* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
 *
 * 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 3 of the License, or
-* (at your option) any later version.
-*
-* 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.
-*
-* 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/>.
+* by the Free Software Foundation.
 *
-* Contact information:
-* Quantum Leaps Web sites: http://www.quantum-leaps.com
-*                          http://www.state-machine.com
-* e-mail:                  info@quantum-leaps.com
+* 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.
 *****************************************************************************/
+/* @(/3/3) .................................................................*/
 #include "qp_port.h"
 #include "dpp.h"
 #include "bsp.h"
 
-/* Local-scope objects -----------------------------------------------------*/
-static QEvt const *l_tableQueueSto[N_PHILO];
-static QEvt const *l_philoQueueSto[N_PHILO][N_PHILO];
-static QSubscrList l_subscrSto[MAX_PUB_SIG];
-
-/* storage for event pools... */
-static QF_MPOOL_EL(TableEvt) l_smlPoolSto[2*N_PHILO];         /* small pool */
-
 /*..........................................................................*/
-int main(void) {
+int main() {
+    static QEvt const *tableQueueSto[N_PHILO];
+    static QEvt const *philoQueueSto[N_PHILO][N_PHILO];
+    static QSubscrList subscrSto[MAX_PUB_SIG];
+    static QF_MPOOL_EL(TableEvt) smlPoolSto[2*N_PHILO];       /* small pool */
     uint8_t n;
 
     Philo_ctor();             /* instantiate all Philosopher active objects */
     Table_ctor();                    /* instantiate the Table active object */
 
     QF_init();     /* initialize the framework and the underlying RT kernel */
-    BSP_init();                                       /* initialize the BSP */
+    BSP_init();                     /* initialize the Board Support Package */
 
                                                   /* object dictionaries... */
-    QS_OBJ_DICTIONARY(l_smlPoolSto);
-    QS_OBJ_DICTIONARY(l_tableQueueSto);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[0]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[1]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[2]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[3]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[4]);
+    QS_OBJ_DICTIONARY(smlPoolSto);
+    QS_OBJ_DICTIONARY(tableQueueSto);
+    QS_OBJ_DICTIONARY(philoQueueSto[0]);
+    QS_OBJ_DICTIONARY(philoQueueSto[1]);
+    QS_OBJ_DICTIONARY(philoQueueSto[2]);
+    QS_OBJ_DICTIONARY(philoQueueSto[3]);
+    QS_OBJ_DICTIONARY(philoQueueSto[4]);
 
-    QF_psInit(l_subscrSto, Q_DIM(l_subscrSto));   /* init publish-subscribe */
+    QF_psInit(subscrSto, Q_DIM(subscrSto));       /* init publish-subscribe */
 
                                                /* initialize event pools... */
-    QF_poolInit(l_smlPoolSto, sizeof(l_smlPoolSto), sizeof(l_smlPoolSto[0]));
+    QF_poolInit(smlPoolSto, sizeof(smlPoolSto), sizeof(smlPoolSto[0]));
 
-    for (n = 0; n < N_PHILO; ++n) {          /* start the active objects... */
-        QActive_start(AO_Philo[n], (uint8_t)(n + 1),
-                      l_philoQueueSto[n], Q_DIM(l_philoQueueSto[n]),
+    for (n = 0U; n < N_PHILO; ++n) {         /* start the active objects... */
+        QACTIVE_START(AO_Philo[n], (uint8_t)(n + 1),
+                      philoQueueSto[n], Q_DIM(philoQueueSto[n]),
                       (void *)0, 0U, (QEvt *)0);
     }
-    QActive_start(AO_Table, (uint8_t)(N_PHILO + 1),
-                  l_tableQueueSto, Q_DIM(l_tableQueueSto),
+    QACTIVE_START(AO_Table, (uint8_t)(N_PHILO + 1),
+                  tableQueueSto, Q_DIM(tableQueueSto),
                   (void *)0, 0U, (QEvt *)0);
 
     return QF_run();                              /* run the QF application */
 }
+

+ 90 - 54
examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1343/philo.c

@@ -2,11 +2,19 @@
 * Model: dpp.qm
 * File:  ./philo.c
 *
-* This file has been generated automatically by QP Modeler (QM).
-* DO NOT EDIT THIS FILE MANUALLY.
+* This code has been generated by QM tool (see state-machine.com/qm).
+* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
 *
-* Please visit www.state-machine.com/qm for more information.
+* 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.
+*
+* 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.
 *****************************************************************************/
+/* @(/3/1) .................................................................*/
 #include "qp_port.h"
 #include "dpp.h"
 #include "bsp.h"
@@ -17,7 +25,7 @@ Q_DEFINE_THIS_FILE
 /* @(/2/0) .................................................................*/
 typedef struct PhiloTag {
 /* protected: */
-    QActive super;
+    QMActive super;
 
 /* private: */
     QTimeEvt timeEvt;
@@ -25,9 +33,28 @@ typedef struct PhiloTag {
 
 /* protected: */
 static QState Philo_initial(Philo * const me, QEvt const * const e);
-static QState Philo_thinking(Philo * const me, QEvt const * const e);
-static QState Philo_hungry(Philo * const me, QEvt const * const e);
-static QState Philo_eating(Philo * const me, QEvt const * const e);
+static QState Philo_thinking  (Philo * const me, QEvt const * const e);
+static QState Philo_thinking_e(Philo * const me);
+static QMState const Philo_thinking_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Philo_thinking),
+    Q_ACTION_CAST(0)
+};
+static QState Philo_hungry  (Philo * const me, QEvt const * const e);
+static QState Philo_hungry_e(Philo * const me);
+static QMState const Philo_hungry_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Philo_hungry),
+    Q_ACTION_CAST(0)
+};
+static QState Philo_eating  (Philo * const me, QEvt const * const e);
+static QState Philo_eating_e(Philo * const me);
+static QState Philo_eating_x(Philo * const me);
+static QMState const Philo_eating_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Philo_eating),
+    Q_ACTION_CAST(&Philo_eating_x)
+};
 
 
 /* Local objects -----------------------------------------------------------*/
@@ -61,14 +88,18 @@ void Philo_ctor(void) {
     Philo *me;
     for (n = 0U; n < N_PHILO; ++n) {
         me = &l_philo[n];
-        QActive_ctor(&me->super, Q_STATE_CAST(&Philo_initial));
-        QTimeEvt_ctor(&me->timeEvt, TIMEOUT_SIG);
+        QMActive_ctor(&me->super, Q_STATE_CAST(&Philo_initial));
+        QTimeEvt_ctorX(&me->timeEvt, &me->super, TIMEOUT_SIG, 0U);
     }
 }
 /* @(/2/0) .................................................................*/
 /* @(/2/0/1) ...............................................................*/
 /* @(/2/0/1/0) */
 static QState Philo_initial(Philo * const me, QEvt const * const e) {
+    static QActionHandler const act_[] = {
+        Q_ACTION_CAST(&Philo_thinking_e),
+        Q_ACTION_CAST(0)
+    };
     static uint8_t registered = (uint8_t)0; /* starts off with 0, per C-standard */
     (void)e; /* suppress the compiler warning about unused parameter */
     if (registered == (uint8_t)0) {
@@ -94,21 +125,23 @@ static QState Philo_initial(Philo * const me, QEvt const * const e) {
     QS_SIG_DICTIONARY(TIMEOUT_SIG, me); /* signal for each Philos */
 
     QActive_subscribe(&me->super, EAT_SIG);
-    return Q_TRAN(&Philo_thinking);
+    return QM_INITIAL(&Philo_thinking_s, act_);
 }
 /* @(/2/0/1/1) .............................................................*/
+static QState Philo_thinking_e(Philo * const me) {
+    QTimeEvt_armX(&me->timeEvt, THINK_TIME, 0U);
+    return QM_ENTRY(&Philo_thinking_s);
+}
 static QState Philo_thinking(Philo * const me, QEvt const * const e) {
-    QState status;
+    QState status_;
     switch (e->sig) {
-        /* @(/2/0/1/1) */
-        case Q_ENTRY_SIG: {
-            QTimeEvt_postIn(&me->timeEvt, &me->super, THINK_TIME);
-            status = Q_HANDLED();
-            break;
-        }
         /* @(/2/0/1/1/0) */
         case TIMEOUT_SIG: {
-            status = Q_TRAN(&Philo_hungry);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Philo_hungry_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Philo_hungry_s, act_);
             break;
         }
         /* @(/2/0/1/1/1) */
@@ -116,36 +149,38 @@ static QState Philo_thinking(Philo * const me, QEvt const * const e) {
         case DONE_SIG: {
             /* EAT or DONE must be for other Philos than this one */
             Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
-    return status;
+    return status_;
 }
 /* @(/2/0/1/2) .............................................................*/
+static QState Philo_hungry_e(Philo * const me) {
+    TableEvt *pe = Q_NEW(TableEvt, HUNGRY_SIG);
+    pe->philoNum = PHILO_ID(me);
+    QACTIVE_POST(AO_Table, &pe->super, me);
+    return QM_ENTRY(&Philo_hungry_s);
+}
 static QState Philo_hungry(Philo * const me, QEvt const * const e) {
-    QState status;
+    QState status_;
     switch (e->sig) {
-        /* @(/2/0/1/2) */
-        case Q_ENTRY_SIG: {
-            TableEvt *pe = Q_NEW(TableEvt, HUNGRY_SIG);
-            pe->philoNum = PHILO_ID(me);
-            QACTIVE_POST(AO_Table, &pe->super, me);
-            status = Q_HANDLED();
-            break;
-        }
         /* @(/2/0/1/2/0) */
         case EAT_SIG: {
             /* @(/2/0/1/2/0/0) */
             if (Q_EVT_CAST(TableEvt)->philoNum == PHILO_ID(me)) {
-                status = Q_TRAN(&Philo_eating);
+                static QActionHandler const act_[] = {
+                    Q_ACTION_CAST(&Philo_eating_e),
+                    Q_ACTION_CAST(0)
+                };
+                status_ = QM_TRAN(&Philo_eating_s, act_);
             }
             else {
-                status = Q_UNHANDLED();
+                status_ = QM_UNHANDLED();
             }
             break;
         }
@@ -153,37 +188,38 @@ static QState Philo_hungry(Philo * const me, QEvt const * const e) {
         case DONE_SIG: {
             /* DONE must be for other Philos than this one */
             Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
-    return status;
+    return status_;
 }
 /* @(/2/0/1/3) .............................................................*/
+static QState Philo_eating_e(Philo * const me) {
+    QTimeEvt_armX(&me->timeEvt, EAT_TIME, 0U);
+    return QM_ENTRY(&Philo_eating_s);
+}
+static QState Philo_eating_x(Philo * const me) {
+    TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
+    pe->philoNum = PHILO_ID(me);
+    QF_PUBLISH(&pe->super, me);
+    return QM_EXIT(&Philo_eating_s);
+}
 static QState Philo_eating(Philo * const me, QEvt const * const e) {
-    QState status;
+    QState status_;
     switch (e->sig) {
-        /* @(/2/0/1/3) */
-        case Q_ENTRY_SIG: {
-            QTimeEvt_postIn(&me->timeEvt, &me->super, EAT_TIME);
-            status = Q_HANDLED();
-            break;
-        }
-        /* @(/2/0/1/3) */
-        case Q_EXIT_SIG: {
-            TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
-            pe->philoNum = PHILO_ID(me);
-            QF_PUBLISH(&pe->super, me);
-            status = Q_HANDLED();
-            break;
-        }
         /* @(/2/0/1/3/0) */
         case TIMEOUT_SIG: {
-            status = Q_TRAN(&Philo_thinking);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Philo_eating_x),
+                Q_ACTION_CAST(&Philo_thinking_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Philo_thinking_s, act_);
             break;
         }
         /* @(/2/0/1/3/1) */
@@ -191,14 +227,14 @@ static QState Philo_eating(Philo * const me, QEvt const * const e) {
         case DONE_SIG: {
             /* EAT or DONE must be for other Philos than this one */
             Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
-    return status;
+    return status_;
 }
 

+ 95 - 62
examples/arm-cm/qk/gnu/dpp-qk_lpcxpresso-1343/table.c

@@ -2,11 +2,19 @@
 * Model: dpp.qm
 * File:  ./table.c
 *
-* This file has been generated automatically by QP Modeler (QM).
-* DO NOT EDIT THIS FILE MANUALLY.
+* This code has been generated by QM tool (see state-machine.com/qm).
+* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
 *
-* Please visit www.state-machine.com/qm for more information.
+* 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.
+*
+* 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.
 *****************************************************************************/
+/* @(/3/2) .................................................................*/
 #include "qp_port.h"
 #include "dpp.h"
 #include "bsp.h"
@@ -17,7 +25,7 @@ Q_DEFINE_THIS_FILE
 /* @(/2/1) .................................................................*/
 typedef struct TableTag {
 /* protected: */
-    QActive super;
+    QMActive super;
 
 /* private: */
     uint8_t fork[N_PHILO];
@@ -26,9 +34,27 @@ typedef struct TableTag {
 
 /* protected: */
 static QState Table_initial(Table * const me, QEvt const * const e);
-static QState Table_active(Table * const me, QEvt const * const e);
-static QState Table_serving(Table * const me, QEvt const * const e);
-static QState Table_paused(Table * const me, QEvt const * const e);
+static QState Table_active  (Table * const me, QEvt const * const e);
+static QMState const Table_active_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Table_active),
+    Q_ACTION_CAST(0)
+};
+static QState Table_serving  (Table * const me, QEvt const * const e);
+static QState Table_serving_e(Table * const me);
+static QMState const Table_serving_s = {
+    &Table_active_s,
+    Q_STATE_CAST(&Table_serving),
+    Q_ACTION_CAST(0)
+};
+static QState Table_paused  (Table * const me, QEvt const * const e);
+static QState Table_paused_e(Table * const me);
+static QState Table_paused_x(Table * const me);
+static QMState const Table_paused_s = {
+    &Table_active_s,
+    Q_STATE_CAST(&Table_paused),
+    Q_ACTION_CAST(&Table_paused_x)
+};
 
 
 #define RIGHT(n_) ((uint8_t)(((n_) + (N_PHILO - 1U)) % N_PHILO))
@@ -48,7 +74,7 @@ void Table_ctor(void) {
     uint8_t n;
     Table *me = &l_table;
 
-    QActive_ctor(&me->super, Q_STATE_CAST(&Table_initial));
+    QMActive_ctor(&me->super, Q_STATE_CAST(&Table_initial));
 
     for (n = 0U; n < N_PHILO; ++n) {
         me->fork[n] = FREE;
@@ -59,6 +85,10 @@ void Table_ctor(void) {
 /* @(/2/1/2) ...............................................................*/
 /* @(/2/1/2/0) */
 static QState Table_initial(Table * const me, QEvt const * const e) {
+    static QActionHandler const act_[] = {
+        Q_ACTION_CAST(&Table_serving_e),
+        Q_ACTION_CAST(0)
+    };
     uint8_t n;
     (void)e; /* suppress the compiler warning about unused parameter */
 
@@ -83,57 +113,55 @@ static QState Table_initial(Table * const me, QEvt const * const e) {
         me->isHungry[n] = 0U;
         BSP_displayPhilStat(n, "thinking");
     }
-    return Q_TRAN(&Table_serving);
+    return QM_INITIAL(&Table_serving_s, act_);
 }
 /* @(/2/1/2/1) .............................................................*/
 static QState Table_active(Table * const me, QEvt const * const e) {
-    QState status;
+    QState status_;
     switch (e->sig) {
         /* @(/2/1/2/1/0) */
         case TERMINATE_SIG: {
             BSP_terminate(0);
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/1) */
         case EAT_SIG: {
             Q_ERROR();
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
-    return status;
+    return status_;
 }
 /* @(/2/1/2/1/2) ...........................................................*/
-static QState Table_serving(Table * const me, QEvt const * const e) {
-    QState status;
-    switch (e->sig) {
-        /* @(/2/1/2/1/2) */
-        case Q_ENTRY_SIG: {
-            uint8_t n;
-            for (n = 0U; n < N_PHILO; ++n) { /* give permissions to eat... */
-                if ((me->isHungry[n] != 0U)
-                    && (me->fork[LEFT(n)] == FREE)
-                    && (me->fork[n] == FREE))
-                {
-                    TableEvt *te;
+static QState Table_serving_e(Table * const me) {
+    uint8_t n;
+    for (n = 0U; n < N_PHILO; ++n) { /* give permissions to eat... */
+        if ((me->isHungry[n] != 0U)
+            && (me->fork[LEFT(n)] == FREE)
+            && (me->fork[n] == FREE))
+        {
+            TableEvt *te;
 
-                    me->fork[LEFT(n)] = USED;
-                    me->fork[n] = USED;
-                    te = Q_NEW(TableEvt, EAT_SIG);
-                    te->philoNum = n;
-                    QF_PUBLISH(&te->super, me);
-                    me->isHungry[n] = 0U;
-                    BSP_displayPhilStat(n, "eating  ");
-                }
-            }
-            status = Q_HANDLED();
-            break;
+            me->fork[LEFT(n)] = USED;
+            me->fork[n] = USED;
+            te = Q_NEW(TableEvt, EAT_SIG);
+            te->philoNum = n;
+            QF_PUBLISH(&te->super, me);
+            me->isHungry[n] = 0U;
+            BSP_displayPhilStat(n, "eating  ");
         }
+    }
+    return QM_ENTRY(&Table_serving_s);
+}
+static QState Table_serving(Table * const me, QEvt const * const e) {
+    QState status_;
+    switch (e->sig) {
         /* @(/2/1/2/1/2/0) */
         case HUNGRY_SIG: {
             uint8_t n, m;
@@ -153,12 +181,12 @@ static QState Table_serving(Table * const me, QEvt const * const e) {
                 pe->philoNum = n;
                 QF_PUBLISH(&pe->super, me);
                 BSP_displayPhilStat(n, "eating  ");
-                status = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             /* @(/2/1/2/1/2/0/1) */
             else {
                 me->isHungry[n] = 1U;
-                status = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             break;
         }
@@ -200,46 +228,51 @@ static QState Table_serving(Table * const me, QEvt const * const e) {
                 QF_PUBLISH(&pe->super, me);
                 BSP_displayPhilStat(m, "eating  ");
             }
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/2/2) */
         case EAT_SIG: {
             Q_ERROR();
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/2/3) */
         case PAUSE_SIG: {
-            status = Q_TRAN(&Table_paused);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Table_paused_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Table_paused_s, act_);
             break;
         }
         default: {
-            status = Q_SUPER(&Table_active);
+            status_ = QM_SUPER();
             break;
         }
     }
-    return status;
+    return status_;
 }
 /* @(/2/1/2/1/3) ...........................................................*/
+static QState Table_paused_e(Table * const me) {
+    BSP_displayPaused(1U);
+    return QM_ENTRY(&Table_paused_s);
+}
+static QState Table_paused_x(Table * const me) {
+    BSP_displayPaused(0U);
+    return QM_EXIT(&Table_paused_s);
+}
 static QState Table_paused(Table * const me, QEvt const * const e) {
-    QState status;
+    QState status_;
     switch (e->sig) {
-        /* @(/2/1/2/1/3) */
-        case Q_ENTRY_SIG: {
-            BSP_displayPaused(1U);
-            status = Q_HANDLED();
-            break;
-        }
-        /* @(/2/1/2/1/3) */
-        case Q_EXIT_SIG: {
-            BSP_displayPaused(0U);
-            status = Q_HANDLED();
-            break;
-        }
         /* @(/2/1/2/1/3/0) */
         case PAUSE_SIG: {
-            status = Q_TRAN(&Table_serving);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Table_paused_x),
+                Q_ACTION_CAST(&Table_serving_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Table_serving_s, act_);
             break;
         }
         /* @(/2/1/2/1/3/1) */
@@ -249,7 +282,7 @@ static QState Table_paused(Table * const me, QEvt const * const e) {
             Q_ASSERT((n < N_PHILO) && (me->isHungry[n] == 0U));
             me->isHungry[n] = 1U;
             BSP_displayPhilStat(n, "hungry  ");
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/3/2) */
@@ -267,14 +300,14 @@ static QState Table_paused(Table * const me, QEvt const * const e) {
 
             me->fork[m] = FREE;
             me->fork[n] = FREE;
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status = Q_SUPER(&Table_active);
+            status_ = QM_SUPER();
             break;
         }
     }
-    return status;
+    return status_;
 }
 

+ 5 - 1
examples/arm-cm/qk/gnu/dpp-qk_stm3210c-eval/Makefile

@@ -246,8 +246,12 @@ $(BIN_DIR)/%.o : %.c
 $(BIN_DIR)/%.o : %.cpp
 	$(CPP) $(CPPFLAGS) -c $< -o $@
 
+# include dependency files only if our goal depends on their existence
+ifneq ($(MAKECMDGOALS),clean)
+  ifneq ($(MAKECMDGOALS),show)
 -include $(C_DEPS_EXT) $(CPP_DEPS_EXT)
-
+  endif
+endif
 
 .PHONY : clean
 clean:

+ 3 - 3
examples/arm-cm/qk/gnu/dpp-qk_stm3210c-eval/bsp.c

@@ -1,7 +1,7 @@
 /*****************************************************************************
 * Product: DPP example, STM3210C-EVAL board, QK kernel
-* Last Updated for Version: 5.1.0
-* Date of the Last Update:  Sep 19, 2013
+* Last Updated for Version: 5.2.0
+* Date of the Last Update:  Dec 25, 2013
 *
 *                    Q u a n t u m     L e a P s
 *                    ---------------------------
@@ -87,7 +87,7 @@ void SysTick_Handler(void) {
     QS_tickTime_ += QS_tickPeriod_;       /* account for the clock rollover */
 #endif
 
-    QF_TICK(&l_SysTick_Handler);           /* process all armed time events */
+    QF_TICK_X(0U, &l_SysTick_Handler);    /* process time events for rate 0 */
 
     QK_ISR_EXIT();                         /* inform QK-nano about ISR exit */
 }

+ 16 - 4
examples/arm-cm/qk/gnu/dpp-qk_stm3210c-eval/dpp.h

@@ -1,12 +1,20 @@
 /*****************************************************************************
 * Model: dpp.qm
-* File:  ././dpp.h
+* File:  ./dpp.h
 *
-* This file has been generated automatically by QP Modeler (QM).
-* DO NOT EDIT THIS FILE MANUALLY.
+* This code has been generated by QM tool (see state-machine.com/qm).
+* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
 *
-* Please visit www.state-machine.com/qm for more information.
+* 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.
+*
+* 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.
 *****************************************************************************/
+/* @(/3/0) .................................................................*/
 #ifndef dpp_h
 #define dpp_h
 
@@ -34,12 +42,16 @@ typedef struct TableEvtTag {
 /* number of philosophers */
 #define N_PHILO ((uint8_t)5)
 
+/* @(/2/4) .................................................................*/
 void Philo_ctor(void);
 
+/* @(/2/5) .................................................................*/
 void Table_ctor(void);
 
 
 extern QActive * const AO_Philo[N_PHILO];
+
 extern QActive * const AO_Table;
 
+
 #endif                    /* dpp_h */

+ 57 - 9
examples/arm-cm/qk/gnu/dpp-qk_stm3210c-eval/dpp.qm

@@ -1,6 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<model version="2.3.0">
- <documentation>Dining Philosopher Problem example</documentation>
+<model version="3.0.0">
+ <documentation>Dining Philosopher Problem example
+
+NOTE: Requries QP 5.</documentation>
  <framework name="qpc"/>
  <package name="Events" stereotype="0x01">
   <class name="TableEvt" superclass="qpc::QEvt">
@@ -8,7 +10,7 @@
   </class>
  </package>
  <package name="AOs" stereotype="0x02">
-  <class name="Philo" superclass="qpc::QActive">
+  <class name="Philo" superclass="qpc::QMActive">
    <attribute name="timeEvt" type="QTimeEvt" visibility="0x02" properties="0x00"/>
    <statechart>
     <initial target="../1">
@@ -42,7 +44,7 @@ QActive_subscribe(&amp;me-&gt;super, EAT_SIG);</action>
      </initial_glyph>
     </initial>
     <state name="thinking">
-     <entry>QTimeEvt_postIn(&amp;me-&gt;timeEvt, &amp;me-&gt;super, THINK_TIME);</entry>
+     <entry>QTimeEvt_armX(&amp;me-&gt;timeEvt, THINK_TIME, 0U);</entry>
      <tran trig="TIMEOUT" target="../../2">
       <tran_glyph conn="2,12,3,1,20,13,-3">
        <action box="0,-2,6,2"/>
@@ -86,7 +88,7 @@ Q_ASSERT(Q_EVT_CAST(TableEvt)-&gt;philoNum != PHILO_ID(me));</action>
      </state_glyph>
     </state>
     <state name="eating">
-     <entry>QTimeEvt_postIn(&amp;me-&gt;timeEvt, &amp;me-&gt;super, EAT_TIME);</entry>
+     <entry>QTimeEvt_armX(&amp;me-&gt;timeEvt, EAT_TIME, 0U);</entry>
      <exit>TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
 pe-&gt;philoNum = PHILO_ID(me);
 QF_PUBLISH(&amp;pe-&gt;super, me);</exit>
@@ -110,7 +112,7 @@ Q_ASSERT(Q_EVT_CAST(TableEvt)-&gt;philoNum != PHILO_ID(me));</action>
     <state_diagram size="37,61"/>
    </statechart>
   </class>
-  <class name="Table" superclass="qpc::QActive">
+  <class name="Table" superclass="qpc::QMActive">
    <attribute name="fork[N_PHILO]" type="uint8_t" visibility="0x02" properties="0x00"/>
    <attribute name="isHungry[N_PHILO]" type="uint8_t" visibility="0x02" properties="0x00"/>
    <statechart>
@@ -316,15 +318,15 @@ me-&gt;fork[n] = FREE;</action>
 Philo *me;
 for (n = 0U; n &lt; N_PHILO; ++n) {
     me = &amp;l_philo[n];
-    QActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Philo_initial));
-    QTimeEvt_ctor(&amp;me-&gt;timeEvt, TIMEOUT_SIG);
+    QMActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Philo_initial));
+    QTimeEvt_ctorX(&amp;me-&gt;timeEvt, &amp;me-&gt;super, TIMEOUT_SIG, 0U);
 }</code>
   </operation>
   <operation name="Table_ctor" type="void" visibility="0x00" properties="0x00">
    <code>uint8_t n;
 Table *me = &amp;l_table;
 
-QActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Table_initial));
+QMActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Table_initial));
 
 for (n = 0U; n &lt; N_PHILO; ++n) {
     me-&gt;fork[n] = FREE;
@@ -424,5 +426,51 @@ QActive * const AO_Table = &amp;l_table.super; /* &quot;opaque&quot; AO pointer
 $define(AOs::Table_ctor)
 $define(AOs::Table)</text>
   </file>
+  <file name="main.c">
+   <text>#include &quot;qp_port.h&quot;
+#include &quot;dpp.h&quot;
+#include &quot;bsp.h&quot;
+
+/*..........................................................................*/
+int main() {
+    static QEvt const *tableQueueSto[N_PHILO];
+    static QEvt const *philoQueueSto[N_PHILO][N_PHILO];
+    static QSubscrList subscrSto[MAX_PUB_SIG];
+    static QF_MPOOL_EL(TableEvt) smlPoolSto[2*N_PHILO];       /* small pool */
+    uint8_t n;
+
+    Philo_ctor();             /* instantiate all Philosopher active objects */
+    Table_ctor();                    /* instantiate the Table active object */
+
+    QF_init();     /* initialize the framework and the underlying RT kernel */
+    BSP_init();                     /* initialize the Board Support Package */
+
+                                                  /* object dictionaries... */
+    QS_OBJ_DICTIONARY(smlPoolSto);
+    QS_OBJ_DICTIONARY(tableQueueSto);
+    QS_OBJ_DICTIONARY(philoQueueSto[0]);
+    QS_OBJ_DICTIONARY(philoQueueSto[1]);
+    QS_OBJ_DICTIONARY(philoQueueSto[2]);
+    QS_OBJ_DICTIONARY(philoQueueSto[3]);
+    QS_OBJ_DICTIONARY(philoQueueSto[4]);
+
+    QF_psInit(subscrSto, Q_DIM(subscrSto));       /* init publish-subscribe */
+
+                                               /* initialize event pools... */
+    QF_poolInit(smlPoolSto, sizeof(smlPoolSto), sizeof(smlPoolSto[0]));
+
+    for (n = 0U; n &lt; N_PHILO; ++n) {         /* start the active objects... */
+        QACTIVE_START(AO_Philo[n], (uint8_t)(n + 1),
+                      philoQueueSto[n], Q_DIM(philoQueueSto[n]),
+                      (void *)0, 0U, (QEvt *)0);
+    }
+    QACTIVE_START(AO_Table, (uint8_t)(N_PHILO + 1),
+                  tableQueueSto, Q_DIM(tableQueueSto),
+                  (void *)0, 0U, (QEvt *)0);
+
+    return QF_run();                              /* run the QF application */
+}
+</text>
+  </file>
  </directory>
 </model>

+ 31 - 51
examples/arm-cm/qk/gnu/dpp-qk_stm3210c-eval/main.c

@@ -1,81 +1,61 @@
 /*****************************************************************************
-* Product: DPP example
-* Last Updated for Version: 4.5.02
-* Date of the Last Update:  Jul 04, 2012
+* Model: dpp.qm
+* File:  ./main.c
 *
-*                    Q u a n t u m     L e a P s
-*                    ---------------------------
-*                    innovating embedded systems
-*
-* Copyright (C) 2002-2012 Quantum Leaps, LLC. All rights reserved.
+* This code has been generated by QM tool (see state-machine.com/qm).
+* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
 *
 * 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 3 of the License, or
-* (at your option) any later version.
-*
-* 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.
-*
-* 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/>.
+* by the Free Software Foundation.
 *
-* Contact information:
-* Quantum Leaps Web sites: http://www.quantum-leaps.com
-*                          http://www.state-machine.com
-* e-mail:                  info@quantum-leaps.com
+* 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.
 *****************************************************************************/
+/* @(/3/3) .................................................................*/
 #include "qp_port.h"
 #include "dpp.h"
 #include "bsp.h"
 
-/* Local-scope objects -----------------------------------------------------*/
-static QEvt const *l_tableQueueSto[N_PHILO];
-static QEvt const *l_philoQueueSto[N_PHILO][N_PHILO];
-static QSubscrList l_subscrSto[MAX_PUB_SIG];
-
-/* storage for event pools... */
-static QF_MPOOL_EL(TableEvt) l_smlPoolSto[2*N_PHILO];         /* small pool */
-
 /*..........................................................................*/
-int main(void) {
+int main() {
+    static QEvt const *tableQueueSto[N_PHILO];
+    static QEvt const *philoQueueSto[N_PHILO][N_PHILO];
+    static QSubscrList subscrSto[MAX_PUB_SIG];
+    static QF_MPOOL_EL(TableEvt) smlPoolSto[2*N_PHILO];       /* small pool */
     uint8_t n;
 
     Philo_ctor();             /* instantiate all Philosopher active objects */
     Table_ctor();                    /* instantiate the Table active object */
 
     QF_init();     /* initialize the framework and the underlying RT kernel */
-    BSP_init();                                       /* initialize the BSP */
+    BSP_init();                     /* initialize the Board Support Package */
 
                                                   /* object dictionaries... */
-    QS_OBJ_DICTIONARY(l_smlPoolSto);
-    QS_OBJ_DICTIONARY(l_tableQueueSto);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[0]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[1]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[2]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[3]);
-    QS_OBJ_DICTIONARY(l_philoQueueSto[4]);
+    QS_OBJ_DICTIONARY(smlPoolSto);
+    QS_OBJ_DICTIONARY(tableQueueSto);
+    QS_OBJ_DICTIONARY(philoQueueSto[0]);
+    QS_OBJ_DICTIONARY(philoQueueSto[1]);
+    QS_OBJ_DICTIONARY(philoQueueSto[2]);
+    QS_OBJ_DICTIONARY(philoQueueSto[3]);
+    QS_OBJ_DICTIONARY(philoQueueSto[4]);
 
-    QF_psInit(l_subscrSto, Q_DIM(l_subscrSto));   /* init publish-subscribe */
+    QF_psInit(subscrSto, Q_DIM(subscrSto));       /* init publish-subscribe */
 
                                                /* initialize event pools... */
-    QF_poolInit(l_smlPoolSto, sizeof(l_smlPoolSto), sizeof(l_smlPoolSto[0]));
+    QF_poolInit(smlPoolSto, sizeof(smlPoolSto), sizeof(smlPoolSto[0]));
 
-    for (n = 0; n < N_PHILO; ++n) {          /* start the active objects... */
-        QActive_start(AO_Philo[n], (uint8_t)(n + 1),
-                      l_philoQueueSto[n], Q_DIM(l_philoQueueSto[n]),
+    for (n = 0U; n < N_PHILO; ++n) {         /* start the active objects... */
+        QACTIVE_START(AO_Philo[n], (uint8_t)(n + 1),
+                      philoQueueSto[n], Q_DIM(philoQueueSto[n]),
                       (void *)0, 0U, (QEvt *)0);
     }
-    QActive_start(AO_Table, (uint8_t)(N_PHILO + 1),
-                  l_tableQueueSto, Q_DIM(l_tableQueueSto),
+    QACTIVE_START(AO_Table, (uint8_t)(N_PHILO + 1),
+                  tableQueueSto, Q_DIM(tableQueueSto),
                   (void *)0, 0U, (QEvt *)0);
 
     return QF_run();                              /* run the QF application */
 }
+

+ 91 - 55
examples/arm-cm/qk/gnu/dpp-qk_stm3210c-eval/philo.c

@@ -1,12 +1,20 @@
 /*****************************************************************************
 * Model: dpp.qm
-* File:  ././philo.c
+* File:  ./philo.c
 *
-* This file has been generated automatically by QP Modeler (QM).
-* DO NOT EDIT THIS FILE MANUALLY.
+* This code has been generated by QM tool (see state-machine.com/qm).
+* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
 *
-* Please visit www.state-machine.com/qm for more information.
+* 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.
+*
+* 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.
 *****************************************************************************/
+/* @(/3/1) .................................................................*/
 #include "qp_port.h"
 #include "dpp.h"
 #include "bsp.h"
@@ -17,7 +25,7 @@ Q_DEFINE_THIS_FILE
 /* @(/2/0) .................................................................*/
 typedef struct PhiloTag {
 /* protected: */
-    QActive super;
+    QMActive super;
 
 /* private: */
     QTimeEvt timeEvt;
@@ -25,9 +33,28 @@ typedef struct PhiloTag {
 
 /* protected: */
 static QState Philo_initial(Philo * const me, QEvt const * const e);
-static QState Philo_thinking(Philo * const me, QEvt const * const e);
-static QState Philo_hungry(Philo * const me, QEvt const * const e);
-static QState Philo_eating(Philo * const me, QEvt const * const e);
+static QState Philo_thinking  (Philo * const me, QEvt const * const e);
+static QState Philo_thinking_e(Philo * const me);
+static QMState const Philo_thinking_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Philo_thinking),
+    Q_ACTION_CAST(0)
+};
+static QState Philo_hungry  (Philo * const me, QEvt const * const e);
+static QState Philo_hungry_e(Philo * const me);
+static QMState const Philo_hungry_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Philo_hungry),
+    Q_ACTION_CAST(0)
+};
+static QState Philo_eating  (Philo * const me, QEvt const * const e);
+static QState Philo_eating_e(Philo * const me);
+static QState Philo_eating_x(Philo * const me);
+static QMState const Philo_eating_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Philo_eating),
+    Q_ACTION_CAST(&Philo_eating_x)
+};
 
 
 /* Local objects -----------------------------------------------------------*/
@@ -61,14 +88,18 @@ void Philo_ctor(void) {
     Philo *me;
     for (n = 0U; n < N_PHILO; ++n) {
         me = &l_philo[n];
-        QActive_ctor(&me->super, Q_STATE_CAST(&Philo_initial));
-        QTimeEvt_ctor(&me->timeEvt, TIMEOUT_SIG);
+        QMActive_ctor(&me->super, Q_STATE_CAST(&Philo_initial));
+        QTimeEvt_ctorX(&me->timeEvt, &me->super, TIMEOUT_SIG, 0U);
     }
 }
 /* @(/2/0) .................................................................*/
 /* @(/2/0/1) ...............................................................*/
 /* @(/2/0/1/0) */
 static QState Philo_initial(Philo * const me, QEvt const * const e) {
+    static QActionHandler const act_[] = {
+        Q_ACTION_CAST(&Philo_thinking_e),
+        Q_ACTION_CAST(0)
+    };
     static uint8_t registered = (uint8_t)0; /* starts off with 0, per C-standard */
     (void)e; /* suppress the compiler warning about unused parameter */
     if (registered == (uint8_t)0) {
@@ -94,21 +125,23 @@ static QState Philo_initial(Philo * const me, QEvt const * const e) {
     QS_SIG_DICTIONARY(TIMEOUT_SIG, me); /* signal for each Philos */
 
     QActive_subscribe(&me->super, EAT_SIG);
-    return Q_TRAN(&Philo_thinking);
+    return QM_INITIAL(&Philo_thinking_s, act_);
 }
 /* @(/2/0/1/1) .............................................................*/
+static QState Philo_thinking_e(Philo * const me) {
+    QTimeEvt_armX(&me->timeEvt, THINK_TIME, 0U);
+    return QM_ENTRY(&Philo_thinking_s);
+}
 static QState Philo_thinking(Philo * const me, QEvt const * const e) {
-    QState status;
+    QState status_;
     switch (e->sig) {
-        /* @(/2/0/1/1) */
-        case Q_ENTRY_SIG: {
-            QTimeEvt_postIn(&me->timeEvt, &me->super, THINK_TIME);
-            status = Q_HANDLED();
-            break;
-        }
         /* @(/2/0/1/1/0) */
         case TIMEOUT_SIG: {
-            status = Q_TRAN(&Philo_hungry);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Philo_hungry_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Philo_hungry_s, act_);
             break;
         }
         /* @(/2/0/1/1/1) */
@@ -116,36 +149,38 @@ static QState Philo_thinking(Philo * const me, QEvt const * const e) {
         case DONE_SIG: {
             /* EAT or DONE must be for other Philos than this one */
             Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
-    return status;
+    return status_;
 }
 /* @(/2/0/1/2) .............................................................*/
+static QState Philo_hungry_e(Philo * const me) {
+    TableEvt *pe = Q_NEW(TableEvt, HUNGRY_SIG);
+    pe->philoNum = PHILO_ID(me);
+    QACTIVE_POST(AO_Table, &pe->super, me);
+    return QM_ENTRY(&Philo_hungry_s);
+}
 static QState Philo_hungry(Philo * const me, QEvt const * const e) {
-    QState status;
+    QState status_;
     switch (e->sig) {
-        /* @(/2/0/1/2) */
-        case Q_ENTRY_SIG: {
-            TableEvt *pe = Q_NEW(TableEvt, HUNGRY_SIG);
-            pe->philoNum = PHILO_ID(me);
-            QACTIVE_POST(AO_Table, &pe->super, me);
-            status = Q_HANDLED();
-            break;
-        }
         /* @(/2/0/1/2/0) */
         case EAT_SIG: {
             /* @(/2/0/1/2/0/0) */
             if (Q_EVT_CAST(TableEvt)->philoNum == PHILO_ID(me)) {
-                status = Q_TRAN(&Philo_eating);
+                static QActionHandler const act_[] = {
+                    Q_ACTION_CAST(&Philo_eating_e),
+                    Q_ACTION_CAST(0)
+                };
+                status_ = QM_TRAN(&Philo_eating_s, act_);
             }
             else {
-                status = Q_UNHANDLED();
+                status_ = QM_UNHANDLED();
             }
             break;
         }
@@ -153,37 +188,38 @@ static QState Philo_hungry(Philo * const me, QEvt const * const e) {
         case DONE_SIG: {
             /* DONE must be for other Philos than this one */
             Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
-    return status;
+    return status_;
 }
 /* @(/2/0/1/3) .............................................................*/
+static QState Philo_eating_e(Philo * const me) {
+    QTimeEvt_armX(&me->timeEvt, EAT_TIME, 0U);
+    return QM_ENTRY(&Philo_eating_s);
+}
+static QState Philo_eating_x(Philo * const me) {
+    TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
+    pe->philoNum = PHILO_ID(me);
+    QF_PUBLISH(&pe->super, me);
+    return QM_EXIT(&Philo_eating_s);
+}
 static QState Philo_eating(Philo * const me, QEvt const * const e) {
-    QState status;
+    QState status_;
     switch (e->sig) {
-        /* @(/2/0/1/3) */
-        case Q_ENTRY_SIG: {
-            QTimeEvt_postIn(&me->timeEvt, &me->super, EAT_TIME);
-            status = Q_HANDLED();
-            break;
-        }
-        /* @(/2/0/1/3) */
-        case Q_EXIT_SIG: {
-            TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
-            pe->philoNum = PHILO_ID(me);
-            QF_PUBLISH(&pe->super, me);
-            status = Q_HANDLED();
-            break;
-        }
         /* @(/2/0/1/3/0) */
         case TIMEOUT_SIG: {
-            status = Q_TRAN(&Philo_thinking);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Philo_eating_x),
+                Q_ACTION_CAST(&Philo_thinking_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Philo_thinking_s, act_);
             break;
         }
         /* @(/2/0/1/3/1) */
@@ -191,14 +227,14 @@ static QState Philo_eating(Philo * const me, QEvt const * const e) {
         case DONE_SIG: {
             /* EAT or DONE must be for other Philos than this one */
             Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
-    return status;
+    return status_;
 }
 

+ 96 - 63
examples/arm-cm/qk/gnu/dpp-qk_stm3210c-eval/table.c

@@ -1,12 +1,20 @@
 /*****************************************************************************
 * Model: dpp.qm
-* File:  ././table.c
+* File:  ./table.c
 *
-* This file has been generated automatically by QP Modeler (QM).
-* DO NOT EDIT THIS FILE MANUALLY.
+* This code has been generated by QM tool (see state-machine.com/qm).
+* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
 *
-* Please visit www.state-machine.com/qm for more information.
+* 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.
+*
+* 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.
 *****************************************************************************/
+/* @(/3/2) .................................................................*/
 #include "qp_port.h"
 #include "dpp.h"
 #include "bsp.h"
@@ -17,7 +25,7 @@ Q_DEFINE_THIS_FILE
 /* @(/2/1) .................................................................*/
 typedef struct TableTag {
 /* protected: */
-    QActive super;
+    QMActive super;
 
 /* private: */
     uint8_t fork[N_PHILO];
@@ -26,9 +34,27 @@ typedef struct TableTag {
 
 /* protected: */
 static QState Table_initial(Table * const me, QEvt const * const e);
-static QState Table_active(Table * const me, QEvt const * const e);
-static QState Table_serving(Table * const me, QEvt const * const e);
-static QState Table_paused(Table * const me, QEvt const * const e);
+static QState Table_active  (Table * const me, QEvt const * const e);
+static QMState const Table_active_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Table_active),
+    Q_ACTION_CAST(0)
+};
+static QState Table_serving  (Table * const me, QEvt const * const e);
+static QState Table_serving_e(Table * const me);
+static QMState const Table_serving_s = {
+    &Table_active_s,
+    Q_STATE_CAST(&Table_serving),
+    Q_ACTION_CAST(0)
+};
+static QState Table_paused  (Table * const me, QEvt const * const e);
+static QState Table_paused_e(Table * const me);
+static QState Table_paused_x(Table * const me);
+static QMState const Table_paused_s = {
+    &Table_active_s,
+    Q_STATE_CAST(&Table_paused),
+    Q_ACTION_CAST(&Table_paused_x)
+};
 
 
 #define RIGHT(n_) ((uint8_t)(((n_) + (N_PHILO - 1U)) % N_PHILO))
@@ -48,7 +74,7 @@ void Table_ctor(void) {
     uint8_t n;
     Table *me = &l_table;
 
-    QActive_ctor(&me->super, Q_STATE_CAST(&Table_initial));
+    QMActive_ctor(&me->super, Q_STATE_CAST(&Table_initial));
 
     for (n = 0U; n < N_PHILO; ++n) {
         me->fork[n] = FREE;
@@ -59,6 +85,10 @@ void Table_ctor(void) {
 /* @(/2/1/2) ...............................................................*/
 /* @(/2/1/2/0) */
 static QState Table_initial(Table * const me, QEvt const * const e) {
+    static QActionHandler const act_[] = {
+        Q_ACTION_CAST(&Table_serving_e),
+        Q_ACTION_CAST(0)
+    };
     uint8_t n;
     (void)e; /* suppress the compiler warning about unused parameter */
 
@@ -83,57 +113,55 @@ static QState Table_initial(Table * const me, QEvt const * const e) {
         me->isHungry[n] = 0U;
         BSP_displayPhilStat(n, "thinking");
     }
-    return Q_TRAN(&Table_serving);
+    return QM_INITIAL(&Table_serving_s, act_);
 }
 /* @(/2/1/2/1) .............................................................*/
 static QState Table_active(Table * const me, QEvt const * const e) {
-    QState status;
+    QState status_;
     switch (e->sig) {
         /* @(/2/1/2/1/0) */
         case TERMINATE_SIG: {
             BSP_terminate(0);
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/1) */
         case EAT_SIG: {
             Q_ERROR();
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
-    return status;
+    return status_;
 }
 /* @(/2/1/2/1/2) ...........................................................*/
-static QState Table_serving(Table * const me, QEvt const * const e) {
-    QState status;
-    switch (e->sig) {
-        /* @(/2/1/2/1/2) */
-        case Q_ENTRY_SIG: {
-            uint8_t n;
-            for (n = 0U; n < N_PHILO; ++n) { /* give permissions to eat... */
-                if ((me->isHungry[n] != 0U)
-                    && (me->fork[LEFT(n)] == FREE)
-                    && (me->fork[n] == FREE))
-                {
-                    TableEvt *te;
+static QState Table_serving_e(Table * const me) {
+    uint8_t n;
+    for (n = 0U; n < N_PHILO; ++n) { /* give permissions to eat... */
+        if ((me->isHungry[n] != 0U)
+            && (me->fork[LEFT(n)] == FREE)
+            && (me->fork[n] == FREE))
+        {
+            TableEvt *te;
 
-                    me->fork[LEFT(n)] = USED;
-                    me->fork[n] = USED;
-                    te = Q_NEW(TableEvt, EAT_SIG);
-                    te->philoNum = n;
-                    QF_PUBLISH(&te->super, me);
-                    me->isHungry[n] = 0U;
-                    BSP_displayPhilStat(n, "eating  ");
-                }
-            }
-            status = Q_HANDLED();
-            break;
+            me->fork[LEFT(n)] = USED;
+            me->fork[n] = USED;
+            te = Q_NEW(TableEvt, EAT_SIG);
+            te->philoNum = n;
+            QF_PUBLISH(&te->super, me);
+            me->isHungry[n] = 0U;
+            BSP_displayPhilStat(n, "eating  ");
         }
+    }
+    return QM_ENTRY(&Table_serving_s);
+}
+static QState Table_serving(Table * const me, QEvt const * const e) {
+    QState status_;
+    switch (e->sig) {
         /* @(/2/1/2/1/2/0) */
         case HUNGRY_SIG: {
             uint8_t n, m;
@@ -153,12 +181,12 @@ static QState Table_serving(Table * const me, QEvt const * const e) {
                 pe->philoNum = n;
                 QF_PUBLISH(&pe->super, me);
                 BSP_displayPhilStat(n, "eating  ");
-                status = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             /* @(/2/1/2/1/2/0/1) */
             else {
                 me->isHungry[n] = 1U;
-                status = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             break;
         }
@@ -200,46 +228,51 @@ static QState Table_serving(Table * const me, QEvt const * const e) {
                 QF_PUBLISH(&pe->super, me);
                 BSP_displayPhilStat(m, "eating  ");
             }
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/2/2) */
         case EAT_SIG: {
             Q_ERROR();
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/2/3) */
         case PAUSE_SIG: {
-            status = Q_TRAN(&Table_paused);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Table_paused_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Table_paused_s, act_);
             break;
         }
         default: {
-            status = Q_SUPER(&Table_active);
+            status_ = QM_SUPER();
             break;
         }
     }
-    return status;
+    return status_;
 }
 /* @(/2/1/2/1/3) ...........................................................*/
+static QState Table_paused_e(Table * const me) {
+    BSP_displayPaused(1U);
+    return QM_ENTRY(&Table_paused_s);
+}
+static QState Table_paused_x(Table * const me) {
+    BSP_displayPaused(0U);
+    return QM_EXIT(&Table_paused_s);
+}
 static QState Table_paused(Table * const me, QEvt const * const e) {
-    QState status;
+    QState status_;
     switch (e->sig) {
-        /* @(/2/1/2/1/3) */
-        case Q_ENTRY_SIG: {
-            BSP_displayPaused(1U);
-            status = Q_HANDLED();
-            break;
-        }
-        /* @(/2/1/2/1/3) */
-        case Q_EXIT_SIG: {
-            BSP_displayPaused(0U);
-            status = Q_HANDLED();
-            break;
-        }
         /* @(/2/1/2/1/3/0) */
         case PAUSE_SIG: {
-            status = Q_TRAN(&Table_serving);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Table_paused_x),
+                Q_ACTION_CAST(&Table_serving_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Table_serving_s, act_);
             break;
         }
         /* @(/2/1/2/1/3/1) */
@@ -249,7 +282,7 @@ static QState Table_paused(Table * const me, QEvt const * const e) {
             Q_ASSERT((n < N_PHILO) && (me->isHungry[n] == 0U));
             me->isHungry[n] = 1U;
             BSP_displayPhilStat(n, "hungry  ");
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         /* @(/2/1/2/1/3/2) */
@@ -267,14 +300,14 @@ static QState Table_paused(Table * const me, QEvt const * const e) {
 
             me->fork[m] = FREE;
             me->fork[n] = FREE;
-            status = Q_HANDLED();
+            status_ = QM_HANDLED();
             break;
         }
         default: {
-            status = Q_SUPER(&Table_active);
+            status_ = QM_SUPER();
             break;
         }
     }
-    return status;
+    return status_;
 }
 

+ 0 - 58
examples/arm-cm/qk/gnu/game-qk_ek-lm3s811/.game

@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<session version="2.3.2">
- <item name="license"></item>
- <group name="locked"/>
- <group name="settings">
-  <item name="tabs">1</item>
-  <item name="windows">0</item>
-  <item name="grid">3</item>
- </group>
- <group name="windows"/>
- <group name="search">
-  <item name="options">4129280</item>
-  <item name="replace">0</item>
- </group>
- <group name="vars"/>
- <group name="tools">
-  <group name="tool">
-   <item name="icon">0</item>
-   <item name="title"></item>
-   <item name="command"></item>
-   <item name="args"></item>
-   <item name="initial"></item>
-   <item name="options">0</item>
-  </group>
-  <group name="tool">
-   <item name="icon">0</item>
-   <item name="title"></item>
-   <item name="command"></item>
-   <item name="args"></item>
-   <item name="initial"></item>
-   <item name="options">0</item>
-  </group>
-  <group name="tool">
-   <item name="icon">0</item>
-   <item name="title"></item>
-   <item name="command"></item>
-   <item name="args"></item>
-   <item name="initial"></item>
-   <item name="options">0</item>
-  </group>
-  <group name="tool">
-   <item name="icon">0</item>
-   <item name="title"></item>
-   <item name="command"></item>
-   <item name="args"></item>
-   <item name="initial"></item>
-   <item name="options">0</item>
-  </group>
-  <group name="tool">
-   <item name="icon">0</item>
-   <item name="title"></item>
-   <item name="command"></item>
-   <item name="args"></item>
-   <item name="initial"></item>
-   <item name="options">0</item>
-  </group>
- </group>
-</session>

+ 0 - 5
examples/arm-cm/qk/gnu/game-qk_ek-lm3s811/.project

@@ -10,11 +10,6 @@
 			<arguments>
 			</arguments>
 		</buildCommand>
-		<buildCommand>
-			<name>com.codesourcery.arm_none_eabi.cdt.debug.core.builder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
 		<buildCommand>
 			<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
 			<triggers>clean,full,incremental,</triggers>

+ 36 - 32
examples/arm-cm/qk/gnu/game-qk_ek-lm3s811/Makefile

@@ -1,7 +1,7 @@
 ##############################################################################
-# Product: "Fly 'n' Shoot" game, EK-LM3811, QK kernel, GNU/Sourcery G++
-# Last Updated for Version: 5.0.0
-# Date of the Last Update:  Aug 25, 2013
+# Product: Makefile for EK-LM3811, QK kernel, GNU/Sourcery G++
+# Last Updated for Version: 5.2.0
+# Date of the Last Update:  Dec 17, 2013
 #
 #                    Q u a n t u m     L e a P s
 #                    ---------------------------
@@ -52,44 +52,24 @@ $(error The QPC environment variable must be defined)
 endif
 
 #-----------------------------------------------------------------------------
-# general utilities
+# directories
 #
-RM = del
 
-#-----------------------------------------------------------------------------
-# tools
-#
-ifeq ($(GNU_ARM),)
-GNU_ARM = C:/tools/CodeSourcery
-endif
+PROJECT := game-qk
 
-CC    := $(GNU_ARM)/bin/arm-none-eabi-gcc
-CPP   := $(GNU_ARM)/bin/arm-none-eabi-g++
-AS    := $(GNU_ARM)/bin/arm-none-eabi-as
-LINK  := $(GNU_ARM)/bin/arm-none-eabi-gcc
-BIN   := $(GNU_ARM)/bin/arm-none-eabi-objcopy
-RM    := rm -rf
-MKDIR := mkdir
-
-#-----------------------------------------------------------------------------
-# directories
-#
 QP_PORT_DIR := $(QPC)/ports/arm-cm/qk/gnu
 CMSIS_DIR   := $(QPC)/ports/arm-cm/cmsis
 APP_DIR     := .
-LIB_DIR     :=
 
 # source directories
 VPATH = $(APP_DIR) \
-	$(CMSIS_DIR) \
-	lwip_port/netif \
-	webserver
+	$(CMSIS_DIR)
 
 # Output file basename
-OUTPUT    := game-qk
+OUTPUT := $(PROJECT)
 
 # include directories
-INCLUDES  = -I$(QPC)/include	\
+INCLUDES  = -I$(QPC)/include \
 	-I$(QP_PORT_DIR) \
 	-I. \
 	-I$(CMSIS_DIR)
@@ -98,6 +78,29 @@ INCLUDES  = -I$(QPC)/include	\
 DEFINES =
 
 ARM_CORE = cortex-m3
+ARM_FPU  =
+
+LD_SCRIPT := $(PROJECT).ld
+LIBS      := -lqp_$(ARM_CORE)_cs
+
+#-----------------------------------------------------------------------------
+# GNU ARM compiler
+#
+ifeq ($(GNU_ARM),)
+GNU_ARM = C:/tools/CodeSourcery
+endif
+
+##############################################################################
+# Typically, you should not need to change anything below this line
+
+CC    := $(GNU_ARM)/bin/arm-none-eabi-gcc
+CPP   := $(GNU_ARM)/bin/arm-none-eabi-g++
+AS    := $(GNU_ARM)/bin/arm-none-eabi-as
+LINK  := $(GNU_ARM)/bin/arm-none-eabi-gcc
+BIN   := $(GNU_ARM)/bin/arm-none-eabi-objcopy
+RM    := rm -rf
+MKDIR := mkdir
+RM    := rm
 
 #-----------------------------------------------------------------------------
 # files
@@ -112,10 +115,6 @@ C_SRCS := $(wildcard *.c)
 # C++ source files
 CPP_SRCS :=	$(wildcard *.cpp)
 
-
-LD_SCRIPT := lm3s811.ld
-LIBS    := -lqp_$(ARM_CORE)_cs
-
 #-----------------------------------------------------------------------------
 # build options for various configurations
 #
@@ -218,7 +217,12 @@ $(BIN_DIR)/%.o : %.c
 $(BIN_DIR)/%.o : %.cpp
 	$(CPP) $(CPPFLAGS) -c $< -o $@
 
+# include dependency files only if our goal depends on their existence
+ifneq ($(MAKECMDGOALS),clean)
+  ifneq ($(MAKECMDGOALS),show)
 -include $(C_DEPS_EXT) $(CPP_DEPS_EXT)
+  endif
+endif
 
 
 .PHONY : clean

+ 9 - 13
examples/arm-cm/qk/gnu/game-qk_ek-lm3s811/bsp.c

@@ -1,7 +1,7 @@
 /*****************************************************************************
 * Product: "Fly 'n' Shoot" game example, preemptive QK kernel
-* Last Updated for Version: 5.1.0
-* Date of the Last Update:  Sep 19, 2013
+* Last Updated for Version: 5.2.0
+* Date of the Last Update:  Dec 25, 2013
 *
 *                    Q u a n t u m     L e a P s
 *                    ---------------------------
@@ -110,7 +110,7 @@ void SysTick_Handler(void) {
     }
 #endif
 
-    QF_TICK(&l_SysTick_Handler);           /* process all armed time events */
+    QF_TICK_X(0U, &l_SysTick_Handler);    /* process time events for rate 0 */
     QF_PUBLISH(&tickEvt, &l_SysTick_Handler); /* publish to all subscribers */
 
     QK_ISR_EXIT();                        /* infrom QK about exiting an ISR */
@@ -338,18 +338,16 @@ void QK_onIdle(void) {
 }
 
 /*..........................................................................*/
-void Q_onAssert(char const Q_ROM * const Q_ROM_VAR file, int line) {
-    (void)file;                                   /* avoid compiler warning */
-    (void)line;                                   /* avoid compiler warning */
-    QF_INT_DISABLE();         /* make sure that all interrupts are disabled */
-    QS_ASSERTION(file, line);
-    for (;;) {       /* NOTE: replace the loop with reset for final version */
-    }
+void Q_onAssert(char const Q_ROM * const file, int_t line) {
+    assert_failed(file, line);
 }
 /*..........................................................................*/
 /* error routine that is called if the CMSIS library encounters an error    */
 void assert_failed(char const *file, int line) {
-    Q_onAssert(file, line);
+    (void)file;                                   /* avoid compiler warning */
+    (void)line;                                   /* avoid compiler warning */
+    QF_INT_DISABLE();         /* make sure that all interrupts are disabled */
+    NVIC_SystemReset();                             /* perform system reset */
 }
 
 /*--------------------------------------------------------------------------*/
@@ -435,8 +433,6 @@ uint8_t QS_onStartup(void const *arg) {
     QS_FILTER_OFF(QS_QF_ISR_ENTRY);
     QS_FILTER_OFF(QS_QF_ISR_EXIT);
 
-    QS_RESET();
-
     return (uint8_t)1;                                    /* return success */
 }
 /*..........................................................................*/

+ 34 - 27
examples/arm-cm/qk/gnu/game-qk_ek-lm3s811/lm3s811.ld → examples/arm-cm/qk/gnu/game-qk_ek-lm3s811/game-qk.ld

@@ -1,31 +1,44 @@
 /*****************************************************************************
 * Product: GNU linker script for Stellaris LM3S811 MCUs
-* Last Updated for Version: 4.1.03
-* Date of the Last Update:  Mar 03, 2010
+* Last Updated for Version: 5.2.0
+* Date of the Last Update:  Dec 03, 2013
 *
 *                    Q u a n t u m     L e a P s
 *                    ---------------------------
 *                    innovating embedded systems
 *
-* Copyright (C) 2002-2010 Quantum Leaps, LLC. All rights reserved.
+* Copyright (C) 2002-2013 Quantum Leaps, LLC. All rights reserved.
 *
-* 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").
+* 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.
 *
-* Alternatively, this software may be distributed and modified under the
+* Alternatively, this program 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.
+* the GNU General Public License 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
 *****************************************************************************/
 
+/* The size of the stack used by the application. NOTE: you need to adjust !*/
+STACK_SIZE = DEFINED( STACK_SIZE ) ? STACK_SIZE : 600;
+
+/* The size of the heap used by the application. NOTE: you need to adjust ! */
+HEAP_SIZE = DEFINED( HEAP_SIZE ) ? HEAP_SIZE : 0;
+
 OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
 OUTPUT_ARCH(arm)
 ENTRY(Reset_Handler)                                         /* entry Point */
@@ -35,12 +48,6 @@ MEMORY {                                           /* memory map of LM3S811 */
     RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 8K
 }
 
-/* The size of the stack used by the application. NOTE: you need to adjust  */
-STACK_SIZE = 1500;
-
-/* The size of the heap used by the application. NOTE: you need to adjust   */
-HEAP_SIZE = 0;
-
 SECTIONS {
 
     .isr_vector : {                 /* the vector table goes FIRST into ROM */
@@ -83,6 +90,14 @@ SECTIONS {
 
     _etext = .;                            /* global symbols at end of code */
 
+    .stack : {
+        __stack_start__ = . ;
+        . = . + STACK_SIZE;
+        . = ALIGN(4);
+        __c_stack_top__ = . ;
+        __stack_end__ = . ;
+    } >RAM
+
     .data :  AT (_etext) {
         __data_load = LOADADDR (.data);
         __data_start = .;
@@ -114,14 +129,6 @@ SECTIONS {
         __heap_end__ = . ;
     } >RAM
 
-    .stack : {
-        __stack_start__ = . ;
-        . = . + STACK_SIZE;
-        . = ALIGN(4);
-        __c_stack_top__ = . ;
-        __stack_end__ = . ;
-    } >RAM
-
     /* Remove information from the standard libraries */
     /DISCARD/ : {
         libc.a ( * )

+ 8 - 8
examples/arm-cm/qk/gnu/game-qk_ek-lm3s811/game.h

@@ -114,22 +114,22 @@ enum GameBitmapIds {
 };
 
 /* active objects' "constructors" */
-/* @(/2/9) .................................................................*/
+/* @(/2/8) .................................................................*/
 void Tunnel_ctor(void);
 
-/* @(/2/10) ................................................................*/
+/* @(/2/9) .................................................................*/
 void Ship_ctor(void);
 
-/* @(/2/11) ................................................................*/
+/* @(/2/10) ................................................................*/
 void Missile_ctor(void);
 
 
 /* instantiation of the Mines orthogonal components */
-/* @(/2/12) ................................................................*/
-QHsm * Mine1_ctor(uint8_t id);
+/* @(/2/11) ................................................................*/
+QMsm * Mine1_ctor(uint8_t id);
 
-/* @(/2/13) ................................................................*/
-QHsm * Mine2_ctor(uint8_t id);
+/* @(/2/12) ................................................................*/
+QMsm * Mine2_ctor(uint8_t id);
 
 
 /* opaque pointers to active objects in the application */
@@ -141,7 +141,7 @@ extern QActive * const AO_Missile;
 
 
 /* helper function for all AOs */
-/* @(/2/8) .................................................................*/
+/* @(/2/13) ................................................................*/
 uint8_t do_bitmaps_overlap(
     uint8_t bmp_id1,
     uint8_t x1,

+ 54 - 57
examples/arm-cm/qk/gnu/game-qk_ek-lm3s811/game.qm

@@ -1,6 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<model version="2.3.2">
- <documentation>&quot;Fly 'n' Shoot&quot; game model from Chapters 1 &amp; 9 of PSiCC2</documentation>
+<model version="3.0.0">
+ <documentation>&quot;Fly 'n' Shoot&quot; game model from Chapters 1 &amp; 9 of PSiCC2
+
+NOTE: Requries QP 5.</documentation>
  <framework name="qpc"/>
  <package name="Events" stereotype="0x01">
   <class name="ObjectPosEvt" superclass="qpc::QEvt">
@@ -20,13 +22,13 @@
   </class>
  </package>
  <package name="AOs" stereotype="0x02">
-  <class name="Tunnel" superclass="qpc::QActive">
+  <class name="Tunnel" superclass="qpc::QMActive">
    <documentation>Tunnel Active Object</documentation>
    <attribute name="blinkTimeEvt" type="QTimeEvt" visibility="0x02" properties="0x00"/>
    <attribute name="screenTimeEvt" type="QTimeEvt" visibility="0x02" properties="0x00"/>
-   <attribute name="mines[GAME_MINES_MAX]" type="QHsm *" visibility="0x02" properties="0x00"/>
-   <attribute name="mine1_pool[GAME_MINES_MAX]" type="QHsm *" visibility="0x02" properties="0x00"/>
-   <attribute name="mine2_pool[GAME_MINES_MAX]" type="QHsm *" visibility="0x02" properties="0x00"/>
+   <attribute name="mines[GAME_MINES_MAX]" type="QMsm *" visibility="0x02" properties="0x00"/>
+   <attribute name="mine1_pool[GAME_MINES_MAX]" type="QMsm *" visibility="0x02" properties="0x00"/>
+   <attribute name="mine2_pool[GAME_MINES_MAX]" type="QMsm *" visibility="0x02" properties="0x00"/>
    <attribute name="blink_ctr" type="uint8_t" visibility="0x02" properties="0x00"/>
    <attribute name="last_mine_x" type="uint8_t" visibility="0x02" properties="0x00"/>
    <attribute name="last_mine_y" type="uint8_t" visibility="0x02" properties="0x00"/>
@@ -100,7 +102,7 @@ if ((me-&gt;last_mine_x + GAME_MINES_DIST_MIN &lt; GAME_SCREEN_WIDTH)
 {
     uint8_t n;
     for (n = 0U; n &lt; Q_DIM(me-&gt;mines); ++n) { /*look for disabled mines */
-        if (me-&gt;mines[n] == (QHsm *)0) {
+        if (me-&gt;mines[n] == (QMsm *)0) {
             break;
         }
     }
@@ -127,7 +129,7 @@ if ((me-&gt;last_mine_x + GAME_MINES_DIST_MIN &lt; GAME_SCREEN_WIDTH)
         ope.super.sig = MINE_PLANT_SIG;
         ope.x = me-&gt;last_mine_x;
         ope.y = me-&gt;last_mine_y;
-        QHsm_dispatch(me-&gt;mines[n], (QEvt *)&amp;ope); /* direct dispatch */
+        QMSM_DISPATCH(me-&gt;mines[n], (QEvt *)&amp;ope); /* direct dispatch */
     }
 }
 </code>
@@ -163,8 +165,8 @@ for (x = 0U; x &lt; w; ++x) {
     <code>uint8_t n;
 
 for (n = 0U; n &lt; GAME_MINES_MAX; ++n) {
-    if (me-&gt;mines[n] != (QHsm *)0) { /* is the mine used? */
-        QHsm_dispatch(me-&gt;mines[n], e);
+    if (me-&gt;mines[n] != (QMsm *)0) { /* is the mine used? */
+        QMSM_DISPATCH(me-&gt;mines[n], e);
     }
 }</code>
    </operation>
@@ -197,8 +199,8 @@ return (uint8_t)0;</code>
     <initial target="../1/2">
      <action>uint8_t n;
 for (n = 0U; n &lt; GAME_MINES_MAX; ++n) {
-    QHsm_init(me-&gt;mine1_pool[n], (QEvt *)0);/*initial tran. for Mine1 */
-    QHsm_init(me-&gt;mine2_pool[n], (QEvt *)0);/*initial tran. for Mine2 */
+    QMSM_INIT(me-&gt;mine1_pool[n], (QEvt *)0);/*initial tran. for Mine1 */
+    QMSM_INIT(me-&gt;mine2_pool[n], (QEvt *)0);/*initial tran. for Mine2 */
 }
 randomSeed(1234); /* seed the pseudo-random generator */
 
@@ -241,8 +243,8 @@ QS_SIG_DICTIONARY(SCORE_SIG,          &amp;l_tunnel);
     <state name="active">
      <tran trig="MINE_DISABLED">
       <action>Q_ASSERT((Q_EVT_CAST(MineEvt)-&gt;id &lt; GAME_MINES_MAX)
-         &amp;&amp; (me-&gt;mines[Q_EVT_CAST(MineEvt)-&gt;id] != (QHsm *)0));
-me-&gt;mines[Q_EVT_CAST(MineEvt)-&gt;id] = (QHsm *)0;</action>
+         &amp;&amp; (me-&gt;mines[Q_EVT_CAST(MineEvt)-&gt;id] != (QMsm *)0));
+me-&gt;mines[Q_EVT_CAST(MineEvt)-&gt;id] = (QMsm *)0;</action>
       <tran_glyph conn="2,9,3,-1,14">
        <action box="0,-2,14,2"/>
       </tran_glyph>
@@ -253,10 +255,9 @@ me-&gt;mines[Q_EVT_CAST(MineEvt)-&gt;id] = (QHsm *)0;</action>
       </tran_glyph>
      </tran>
      <state name="show_logo">
-      <entry>QTimeEvt_postEvery(&amp;me-&gt;blinkTimeEvt, (QActive *)me,
-                   BSP_TICKS_PER_SEC/2U); /* 1/2 sec */
-QTimeEvt_postIn(&amp;me-&gt;screenTimeEvt, (QActive *)me,
-                BSP_TICKS_PER_SEC*5U); /* 5 sec timeout */
+      <entry>QTimeEvt_armX(&amp;me-&gt;blinkTimeEvt, BSP_TICKS_PER_SEC/2U,
+              BSP_TICKS_PER_SEC/2U);
+QTimeEvt_armX(&amp;me-&gt;screenTimeEvt, BSP_TICKS_PER_SEC*5U, 0U);
 me-&gt;blink_ctr = 0U;
 BSP_drawNString(0U, 0U, &quot; Quantum  LeAps &quot;);
 BSP_drawNString(0U, 1U, &quot;state-machine.co&quot;);</entry>
@@ -306,10 +307,9 @@ me-&gt;minimal_gap = GAME_SCREEN_HEIGHT - 3U;
 memset(l_walls, (uint8_t)0,
       (GAME_SCREEN_WIDTH * GAME_SCREEN_HEIGHT/8U));
 
-QTimeEvt_postEvery(&amp;me-&gt;blinkTimeEvt, (QActive *)me,
-                   BSP_TICKS_PER_SEC/2U); /* every 1/2 sec */
-QTimeEvt_postIn(&amp;me-&gt;screenTimeEvt, (QActive *)me,
-                BSP_TICKS_PER_SEC*20U); /* 20s timeout */
+QTimeEvt_armX(&amp;me-&gt;blinkTimeEvt,  BSP_TICKS_PER_SEC/2U,
+              BSP_TICKS_PER_SEC/2U);
+QTimeEvt_armX(&amp;me-&gt;screenTimeEvt, BSP_TICKS_PER_SEC*20U, 0U);
 
 me-&gt;blink_ctr = 0U; /* init the blink counter */</entry>
       <exit>QTimeEvt_disarm(&amp;me-&gt;blinkTimeEvt);
@@ -457,10 +457,9 @@ BSP_drawNString((GAME_SCREEN_WIDTH - 6U*10U)/2U + 6U*6U, 1U, str);</action>
       </state_glyph>
      </state>
      <state name="game_over">
-      <entry>QTimeEvt_postEvery(&amp;me-&gt;blinkTimeEvt, (QActive *)me,
-                   BSP_TICKS_PER_SEC/2U); /* 1/2 sec */
-QTimeEvt_postIn(&amp;me-&gt;screenTimeEvt, (QActive *)me,
-                BSP_TICKS_PER_SEC*5U); /* 5 sec timeout */
+      <entry>QTimeEvt_armX(&amp;me-&gt;blinkTimeEvt, BSP_TICKS_PER_SEC/2U,
+              BSP_TICKS_PER_SEC/2U);
+QTimeEvt_armX(&amp;me-&gt;screenTimeEvt, BSP_TICKS_PER_SEC*5U, 0U);
 me-&gt;blink_ctr = 0U;
 BSP_drawNString((GAME_SCREEN_WIDTH - 6U*9U)/2U, 0U, &quot;Game Over&quot;);</entry>
       <exit>QTimeEvt_disarm(&amp;me-&gt;blinkTimeEvt);
@@ -499,8 +498,7 @@ BSP_drawNString((GAME_SCREEN_WIDTH - 6U*9U)/2, 0U,
       </tran>
       <state name="screen_saver_hide">
        <entry>BSP_displayOff(); /* power down the display */
-QTimeEvt_postIn(&amp;me-&gt;screenTimeEvt, (QActive *)me,
-                BSP_TICKS_PER_SEC*3U); /* 3s timeout */</entry>
+QTimeEvt_armX(&amp;me-&gt;screenTimeEvt, BSP_TICKS_PER_SEC*3U, 0U);</entry>
        <exit>QTimeEvt_disarm(&amp;me-&gt;screenTimeEvt);
 BSP_displayOn(); /* power up the display */</exit>
        <tran trig="SCREEN_TIMEOUT" target="../../3">
@@ -523,8 +521,7 @@ Tunnel_addImageAt(me,
         (uint8_t)(rnd % (GAME_SCREEN_WIDTH - 55U)),
         (int8_t) (rnd % (GAME_SCREEN_HEIGHT - 8U)));
 BSP_drawBitmap(l_frame);
-QTimeEvt_postIn(&amp;me-&gt;screenTimeEvt, (QActive *)me,
-                BSP_TICKS_PER_SEC/3U); /* 1/3 sec timeout */</entry>
+QTimeEvt_armX(&amp;me-&gt;screenTimeEvt, BSP_TICKS_PER_SEC/2U, 0U);</entry>
        <exit>QTimeEvt_disarm(&amp;me-&gt;screenTimeEvt);
 /* clear the screen frame buffer */
 memset(l_frame, (uint8_t)0,
@@ -557,7 +554,7 @@ QF_stop(); /* stop QF and cleanup */</entry>
     <state_diagram size="68,94"/>
    </statechart>
   </class>
-  <class name="Ship" superclass="qpc::QActive">
+  <class name="Ship" superclass="qpc::QMActive">
    <documentation>Ship Active Object</documentation>
    <attribute name="x" type="uint8_t" visibility="0x02" properties="0x00"/>
    <attribute name="y" type="uint8_t" visibility="0x02" properties="0x00"/>
@@ -701,7 +698,7 @@ QACTIVE_POST(AO_Tunnel, (QEvt *)gameOver, me);</action>
     <state_diagram size="41,67"/>
    </statechart>
   </class>
-  <class name="Missile" superclass="qpc::QActive">
+  <class name="Missile" superclass="qpc::QMActive">
    <documentation>Missile Active Object</documentation>
    <attribute name="x" type="uint8_t" visibility="0x02" properties="0x00"/>
    <attribute name="y" type="uint8_t" visibility="0x02" properties="0x00"/>
@@ -811,7 +808,7 @@ QACTIVE_POST(AO_Tunnel, (QEvt *)oie, me);</action>
     <state_diagram size="46,55"/>
    </statechart>
   </class>
-  <class name="Mine1" superclass="qpc::QHsm">
+  <class name="Mine1" superclass="qpc::QMsm">
    <documentation>The Mine1 orthogonal component</documentation>
    <attribute name="x" type="uint8_t" visibility="0x02" properties="0x00"/>
    <attribute name="y" type="uint8_t" visibility="0x02" properties="0x00"/>
@@ -975,7 +972,7 @@ QACTIVE_POST(AO_Missile, (QEvt *)&amp;mine1_destroyed, me);</action>
     <state_diagram size="53,68"/>
    </statechart>
   </class>
-  <class name="Mine2" superclass="qpc::QHsm">
+  <class name="Mine2" superclass="qpc::QMsm">
    <documentation>The Mine2 orthogonal component</documentation>
    <attribute name="x" type="uint8_t" visibility="0x02" properties="0x00"/>
    <attribute name="y" type="uint8_t" visibility="0x02" properties="0x00"/>
@@ -1150,55 +1147,55 @@ QACTIVE_POST(AO_Tunnel, (QEvt *)oie, me);</action>
   <attribute name="AO_Tunnel" type="QActive * const" visibility="0x00" properties="0x00"/>
   <attribute name="AO_Ship" type="QActive * const" visibility="0x00" properties="0x00"/>
   <attribute name="AO_Missile" type="QActive * const" visibility="0x00" properties="0x00"/>
-  <operation name="do_bitmaps_overlap" type="uint8_t" visibility="0x00" properties="0x00">
-   <parameter name="bmp_id1" type="uint8_t"/>
-   <parameter name="x1" type="uint8_t"/>
-   <parameter name="y1" type="uint8_t"/>
-   <parameter name="bmp_id2" type="uint8_t"/>
-   <parameter name="x2" type="uint8_t"/>
-   <parameter name="y2" type="uint8_t"/>
-  </operation>
   <operation name="Tunnel_ctor" type="void" visibility="0x00" properties="0x01">
    <code>uint8_t n;
 Tunnel *me = &amp;l_tunnel;
-QActive_ctor(&amp;me-&gt;super, (QStateHandler)&amp;Tunnel_initial);
-QTimeEvt_ctor(&amp;me-&gt;blinkTimeEvt,  BLINK_TIMEOUT_SIG);
-QTimeEvt_ctor(&amp;me-&gt;screenTimeEvt, SCREEN_TIMEOUT_SIG);
+QMActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Tunnel_initial));
+QTimeEvt_ctorX(&amp;me-&gt;blinkTimeEvt,  &amp;me-&gt;super, BLINK_TIMEOUT_SIG,  0U);
+QTimeEvt_ctorX(&amp;me-&gt;screenTimeEvt, &amp;me-&gt;super, SCREEN_TIMEOUT_SIG, 0U);
 for (n = 0; n &lt; GAME_MINES_MAX; ++n) {
     me-&gt;mine1_pool[n] = Mine1_ctor(n); /* instantiate Mine1 in the pool */
     me-&gt;mine2_pool[n] = Mine2_ctor(n); /* instantiate Mine2 in the pool */
-    me-&gt;mines[n] = (QHsm *)0; /* mine 'n' is unused */
+    me-&gt;mines[n] = (QMsm *)0; /* mine 'n' is unused */
 }
 me-&gt;last_mine_x = 0; /* the last mine at the right edge of the tunnel */
 me-&gt;last_mine_y = 0;</code>
   </operation>
   <operation name="Ship_ctor" type="void" visibility="0x00" properties="0x01">
    <code>Ship *me = &amp;l_ship;
-QActive_ctor(&amp;me-&gt;super, (QStateHandler)&amp;Ship_initial);
+QMActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Ship_initial));
 me-&gt;x = GAME_SHIP_X;
 me-&gt;y = GAME_SHIP_Y;</code>
   </operation>
   <operation name="Missile_ctor" type="void" visibility="0x00" properties="0x01">
    <code>Missile *me = &amp;l_missile;
-QActive_ctor(&amp;me-&gt;super, (QStateHandler)&amp;Missile_initial);</code>
+QMActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Missile_initial));</code>
   </operation>
-  <operation name="Mine1_ctor" type="QHsm *" visibility="0x00" properties="0x01">
+  <operation name="Mine1_ctor" type="QMsm *" visibility="0x00" properties="0x01">
    <parameter name="id" type="uint8_t"/>
    <code>Mine1 *me;
 Q_REQUIRE(id &lt; GAME_MINES_MAX);
 me = &amp;l_mine1[id];
 /* superclass' ctor */
-QHsm_ctor(&amp;me-&gt;super, (QStateHandler)&amp;Mine1_initial);
-return (QHsm *)me;</code>
+QMsm_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Mine1_initial));
+return (QMsm *)me;</code>
   </operation>
-  <operation name="Mine2_ctor" type="QHsm *" visibility="0x00" properties="0x01">
+  <operation name="Mine2_ctor" type="QMsm *" visibility="0x00" properties="0x01">
    <parameter name="id" type="uint8_t"/>
    <code>Mine2 *me;
 Q_REQUIRE(id &lt; GAME_MINES_MAX);
 me = &amp;l_mine2[id];
 /* superclass' ctor */
-QHsm_ctor(&amp;me-&gt;super, (QStateHandler)&amp;Mine2_initial);
-return (QHsm *)me;</code>
+QMsm_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Mine2_initial));
+return (QMsm *)me;</code>
+  </operation>
+  <operation name="do_bitmaps_overlap" type="uint8_t" visibility="0x00" properties="0x00">
+   <parameter name="bmp_id1" type="uint8_t"/>
+   <parameter name="x1" type="uint8_t"/>
+   <parameter name="y1" type="uint8_t"/>
+   <parameter name="bmp_id2" type="uint8_t"/>
+   <parameter name="x2" type="uint8_t"/>
+   <parameter name="y2" type="uint8_t"/>
   </operation>
  </package>
  <directory name=".">
@@ -1658,17 +1655,17 @@ int main() {
     QS_SIG_DICTIONARY(GAME_OVER_SIG,      (void *)0);
 
                                              /* start the active objects... */
-    QActive_start(AO_Missile,
+    QACTIVE_START(AO_Missile,
                   1U,                                           /* priority */
                   l_missileQueueSto, Q_DIM(l_missileQueueSto), /* evt queue */
                   (void *)0, 0U,                     /* no per-thread stack */
                   (QEvt *)0);                    /* no initialization event */
-    QActive_start(AO_Ship,
+    QACTIVE_START(AO_Ship,
                   2U,                                           /* priority */
                   l_shipQueueSto,    Q_DIM(l_shipQueueSto),    /* evt queue */
                   (void *)0, 0U,                     /* no per-thread stack */
                   (QEvt *)0);                    /* no initialization event */
-    QActive_start(AO_Tunnel,
+    QACTIVE_START(AO_Tunnel,
                   3U,                                           /* priority */
                   l_tunnelQueueSto,  Q_DIM(l_tunnelQueueSto),  /* evt queue */
                   (void *)0, 0U,                     /* no per-thread stack */

+ 3 - 3
examples/arm-cm/qk/gnu/game-qk_ek-lm3s811/main.c

@@ -62,17 +62,17 @@ int main() {
     QS_SIG_DICTIONARY(GAME_OVER_SIG,      (void *)0);
 
                                              /* start the active objects... */
-    QActive_start(AO_Missile,
+    QACTIVE_START(AO_Missile,
                   1U,                                           /* priority */
                   l_missileQueueSto, Q_DIM(l_missileQueueSto), /* evt queue */
                   (void *)0, 0U,                     /* no per-thread stack */
                   (QEvt *)0);                    /* no initialization event */
-    QActive_start(AO_Ship,
+    QACTIVE_START(AO_Ship,
                   2U,                                           /* priority */
                   l_shipQueueSto,    Q_DIM(l_shipQueueSto),    /* evt queue */
                   (void *)0, 0U,                     /* no per-thread stack */
                   (QEvt *)0);                    /* no initialization event */
-    QActive_start(AO_Tunnel,
+    QACTIVE_START(AO_Tunnel,
                   3U,                                           /* priority */
                   l_tunnelQueueSto,  Q_DIM(l_tunnelQueueSto),  /* evt queue */
                   (void *)0, 0U,                     /* no per-thread stack */

+ 77 - 39
examples/arm-cm/qk/gnu/game-qk_ek-lm3s811/mine1.c

@@ -25,7 +25,7 @@ Q_DEFINE_THIS_FILE
 /* @(/2/3) .................................................................*/
 typedef struct Mine1Tag {
 /* protected: */
-    QHsm super;
+    QMsm super;
 
 /* private: */
     uint8_t x;
@@ -37,10 +37,32 @@ typedef struct Mine1Tag {
 
 /* protected: */
 static QState Mine1_initial(Mine1 * const me, QEvt const * const e);
-static QState Mine1_unused(Mine1 * const me, QEvt const * const e);
-static QState Mine1_used(Mine1 * const me, QEvt const * const e);
-static QState Mine1_exploding(Mine1 * const me, QEvt const * const e);
-static QState Mine1_planted(Mine1 * const me, QEvt const * const e);
+static QState Mine1_unused  (Mine1 * const me, QEvt const * const e);
+static QMState const Mine1_unused_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Mine1_unused),
+    Q_ACTION_CAST(0)
+};
+static QState Mine1_used  (Mine1 * const me, QEvt const * const e);
+static QState Mine1_used_x(Mine1 * const me);
+static QMState const Mine1_used_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Mine1_used),
+    Q_ACTION_CAST(&Mine1_used_x)
+};
+static QState Mine1_exploding  (Mine1 * const me, QEvt const * const e);
+static QState Mine1_exploding_e(Mine1 * const me);
+static QMState const Mine1_exploding_s = {
+    &Mine1_used_s,
+    Q_STATE_CAST(&Mine1_exploding),
+    Q_ACTION_CAST(0)
+};
+static QState Mine1_planted  (Mine1 * const me, QEvt const * const e);
+static QMState const Mine1_planted_s = {
+    &Mine1_used_s,
+    Q_STATE_CAST(&Mine1_planted),
+    Q_ACTION_CAST(0)
+};
 
 
 /* local objects -----------------------------------------------------------*/
@@ -50,14 +72,14 @@ static Mine1 l_mine1[GAME_MINES_MAX];             /* a pool of type-1 mines */
 #define MINE_ID(me_)    ((uint8_t)((me_) - l_mine1))
 
 /* Mine1 class definition --------------------------------------------------*/
-/* @(/2/12) ................................................................*/
-QHsm * Mine1_ctor(uint8_t id) {
+/* @(/2/11) ................................................................*/
+QMsm * Mine1_ctor(uint8_t id) {
     Mine1 *me;
     Q_REQUIRE(id < GAME_MINES_MAX);
     me = &l_mine1[id];
     /* superclass' ctor */
-    QHsm_ctor(&me->super, (QStateHandler)&Mine1_initial);
-    return (QHsm *)me;
+    QMsm_ctor(&me->super, Q_STATE_CAST(&Mine1_initial));
+    return (QMsm *)me;
 }
 /* @(/2/3) .................................................................*/
 /* @(/2/3/3) ...............................................................*/
@@ -88,7 +110,7 @@ static QState Mine1_initial(Mine1 * const me, QEvt const * const e) {
     QS_SIG_DICTIONARY(MISSILE_IMG_SIG,   me);
 
     (void)e; /* avoid the "unreferenced parameter" warning */
-    return Q_TRAN(&Mine1_unused);
+    return QM_INITIAL(&Mine1_unused_s, QMsm_emptyAction_);
 }
 /* @(/2/3/3/1) .............................................................*/
 static QState Mine1_unused(Mine1 * const me, QEvt const * const e) {
@@ -98,51 +120,51 @@ static QState Mine1_unused(Mine1 * const me, QEvt const * const e) {
         case MINE_PLANT_SIG: {
             me->x = Q_EVT_CAST(ObjectPosEvt)->x;
             me->y = Q_EVT_CAST(ObjectPosEvt)->y;
-            status_ = Q_TRAN(&Mine1_planted);
+            status_ = QM_TRAN(&Mine1_planted_s, QMsm_emptyAction_);
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/3/3/2) .............................................................*/
+static QState Mine1_used_x(Mine1 * const me) {
+    /* tell the Tunnel that this mine is becoming disabled */
+    MineEvt *mev = Q_NEW(MineEvt, MINE_DISABLED_SIG);
+    mev->id = MINE_ID(me);
+    QACTIVE_POST(AO_Tunnel, (QEvt *)mev, me);
+    return QM_EXIT(&Mine1_used_s);
+}
 static QState Mine1_used(Mine1 * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/3/3/2) */
-        case Q_EXIT_SIG: {
-            /* tell the Tunnel that this mine is becoming disabled */
-            MineEvt *mev = Q_NEW(MineEvt, MINE_DISABLED_SIG);
-            mev->id = MINE_ID(me);
-            QACTIVE_POST(AO_Tunnel, (QEvt *)mev, me);
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/3/3/2/0) */
         case MINE_RECYCLE_SIG: {
-            status_ = Q_TRAN(&Mine1_unused);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Mine1_used_x),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Mine1_unused_s, act_);
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/3/3/2/1) ...........................................................*/
+static QState Mine1_exploding_e(Mine1 * const me) {
+    me->exp_ctr = 0U;
+    return QM_ENTRY(&Mine1_exploding_s);
+}
 static QState Mine1_exploding(Mine1 * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/3/3/2/1) */
-        case Q_ENTRY_SIG: {
-            me->exp_ctr = 0U;
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/3/3/2/1/0) */
         case TIME_TICK_SIG: {
             /* @(/2/3/3/2/1/0/0) */
@@ -157,16 +179,20 @@ static QState Mine1_exploding(Mine1 * const me, QEvt const * const e) {
                 oie->y   = (int8_t)((int)me->y - 4 + 2); /* y of explosion */
                 oie->bmp = EXPLOSION0_BMP + (me->exp_ctr >> 2);
                 QACTIVE_POST(AO_Tunnel, (QEvt *)oie, me);
-                status_ = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             /* @(/2/3/3/2/1/0/1) */
             else {
-                status_ = Q_TRAN(&Mine1_unused);
+                static QActionHandler const act_[] = {
+                    Q_ACTION_CAST(&Mine1_used_x),
+                    Q_ACTION_CAST(0)
+                };
+                status_ = QM_TRAN(&Mine1_unused_s, act_);
             }
             break;
         }
         default: {
-            status_ = Q_SUPER(&Mine1_used);
+            status_ = QM_SUPER();
             break;
         }
     }
@@ -188,11 +214,15 @@ static QState Mine1_planted(Mine1 * const me, QEvt const * const e) {
                 oie->y   = me->y;
                 oie->bmp = MINE1_BMP;
                 QACTIVE_POST(AO_Tunnel, (QEvt *)oie, me);
-                status_ = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             /* @(/2/3/3/2/2/0/1) */
             else {
-                status_ = Q_TRAN(&Mine1_unused);
+                static QActionHandler const act_[] = {
+                    Q_ACTION_CAST(&Mine1_used_x),
+                    Q_ACTION_CAST(0)
+                };
+                status_ = QM_TRAN(&Mine1_unused_s, act_);
             }
             break;
         }
@@ -203,6 +233,10 @@ static QState Mine1_planted(Mine1 * const me, QEvt const * const e) {
             uint8_t bmp = Q_EVT_CAST(ObjectImageEvt)->bmp;
             /* @(/2/3/3/2/2/1/0) */
             if (do_bitmaps_overlap(MINE1_BMP, me->x, me->y, bmp, x, y)) {
+                static QActionHandler const act_[] = {
+                    Q_ACTION_CAST(&Mine1_used_x),
+                    Q_ACTION_CAST(0)
+                };
                 static MineEvt const mine1_hit = {
                     { HIT_MINE_SIG, 0U, 0U }, /* the QEvt base instance */
                     1U  /* type of the mine (1 for Mine type-1) */
@@ -210,10 +244,10 @@ static QState Mine1_planted(Mine1 * const me, QEvt const * const e) {
                 QACTIVE_POST(AO_Ship, (QEvt *)&mine1_hit, me);
                 /* go straight to 'disabled' and let the Ship do
                  * the exploding */
-                status_ = Q_TRAN(&Mine1_unused);
+                status_ = QM_TRAN(&Mine1_unused_s, act_);
             }
             else {
-                status_ = Q_UNHANDLED();
+                status_ = QM_UNHANDLED();
             }
             break;
         }
@@ -224,20 +258,24 @@ static QState Mine1_planted(Mine1 * const me, QEvt const * const e) {
             uint8_t bmp = Q_EVT_CAST(ObjectImageEvt)->bmp;
             /* @(/2/3/3/2/2/2/0) */
             if (do_bitmaps_overlap(MINE1_BMP, me->x, me->y, bmp, x, y)) {
+                static QActionHandler const act_[] = {
+                    Q_ACTION_CAST(&Mine1_exploding_e),
+                    Q_ACTION_CAST(0)
+                };
                 static ScoreEvt const mine1_destroyed = {
                     { DESTROYED_MINE_SIG, 0U, 0U },  /* the QEvt base instance */
                     25U  /* score for destroying Mine type-1 */
                 };
                 QACTIVE_POST(AO_Missile, (QEvt *)&mine1_destroyed, me);
-                status_ = Q_TRAN(&Mine1_exploding);
+                status_ = QM_TRAN(&Mine1_exploding_s, act_);
             }
             else {
-                status_ = Q_UNHANDLED();
+                status_ = QM_UNHANDLED();
             }
             break;
         }
         default: {
-            status_ = Q_SUPER(&Mine1_used);
+            status_ = QM_SUPER();
             break;
         }
     }

+ 77 - 39
examples/arm-cm/qk/gnu/game-qk_ek-lm3s811/mine2.c

@@ -25,7 +25,7 @@ Q_DEFINE_THIS_FILE
 /* @(/2/4) .................................................................*/
 typedef struct Mine2Tag {
 /* protected: */
-    QHsm super;
+    QMsm super;
 
 /* private: */
     uint8_t x;
@@ -37,10 +37,32 @@ typedef struct Mine2Tag {
 
 /* protected: */
 static QState Mine2_initial(Mine2 * const me, QEvt const * const e);
-static QState Mine2_unused(Mine2 * const me, QEvt const * const e);
-static QState Mine2_used(Mine2 * const me, QEvt const * const e);
-static QState Mine2_planted(Mine2 * const me, QEvt const * const e);
-static QState Mine2_exploding(Mine2 * const me, QEvt const * const e);
+static QState Mine2_unused  (Mine2 * const me, QEvt const * const e);
+static QMState const Mine2_unused_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Mine2_unused),
+    Q_ACTION_CAST(0)
+};
+static QState Mine2_used  (Mine2 * const me, QEvt const * const e);
+static QState Mine2_used_x(Mine2 * const me);
+static QMState const Mine2_used_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Mine2_used),
+    Q_ACTION_CAST(&Mine2_used_x)
+};
+static QState Mine2_planted  (Mine2 * const me, QEvt const * const e);
+static QMState const Mine2_planted_s = {
+    &Mine2_used_s,
+    Q_STATE_CAST(&Mine2_planted),
+    Q_ACTION_CAST(0)
+};
+static QState Mine2_exploding  (Mine2 * const me, QEvt const * const e);
+static QState Mine2_exploding_e(Mine2 * const me);
+static QMState const Mine2_exploding_s = {
+    &Mine2_used_s,
+    Q_STATE_CAST(&Mine2_exploding),
+    Q_ACTION_CAST(0)
+};
 
 
 /* local objects -----------------------------------------------------------*/
@@ -50,14 +72,14 @@ static Mine2 l_mine2[GAME_MINES_MAX];             /* a pool of type-2 mines */
 #define MINE_ID(me_)    ((uint8_t)((me_) - l_mine2))
 
 /* Mine2 class definition --------------------------------------------------*/
-/* @(/2/13) ................................................................*/
-QHsm * Mine2_ctor(uint8_t id) {
+/* @(/2/12) ................................................................*/
+QMsm * Mine2_ctor(uint8_t id) {
     Mine2 *me;
     Q_REQUIRE(id < GAME_MINES_MAX);
     me = &l_mine2[id];
     /* superclass' ctor */
-    QHsm_ctor(&me->super, (QStateHandler)&Mine2_initial);
-    return (QHsm *)me;
+    QMsm_ctor(&me->super, Q_STATE_CAST(&Mine2_initial));
+    return (QMsm *)me;
 }
 /* @(/2/4) .................................................................*/
 /* @(/2/4/3) ...............................................................*/
@@ -90,7 +112,7 @@ static QState Mine2_initial(Mine2 * const me, QEvt const * const e) {
     QS_SIG_DICTIONARY(MISSILE_IMG_SIG,   me);
 
     (void)e; /* avoid the "unreferenced parameter" warning */
-    return Q_TRAN(&Mine2_unused);
+    return QM_INITIAL(&Mine2_unused_s, QMsm_emptyAction_);
 }
 /* @(/2/4/3/1) .............................................................*/
 static QState Mine2_unused(Mine2 * const me, QEvt const * const e) {
@@ -100,36 +122,38 @@ static QState Mine2_unused(Mine2 * const me, QEvt const * const e) {
         case MINE_PLANT_SIG: {
             me->x = Q_EVT_CAST(ObjectPosEvt)->x;
             me->y = Q_EVT_CAST(ObjectPosEvt)->y;
-            status_ = Q_TRAN(&Mine2_planted);
+            status_ = QM_TRAN(&Mine2_planted_s, QMsm_emptyAction_);
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/4/3/2) .............................................................*/
+static QState Mine2_used_x(Mine2 * const me) {
+    /* tell the Tunnel that this mine is becoming disabled */
+    MineEvt *mev = Q_NEW(MineEvt, MINE_DISABLED_SIG);
+    mev->id = MINE_ID(me);
+    QACTIVE_POST(AO_Tunnel, (QEvt *)mev, me);
+    return QM_EXIT(&Mine2_used_s);
+}
 static QState Mine2_used(Mine2 * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/4/3/2) */
-        case Q_EXIT_SIG: {
-            /* tell the Tunnel that this mine is becoming disabled */
-            MineEvt *mev = Q_NEW(MineEvt, MINE_DISABLED_SIG);
-            mev->id = MINE_ID(me);
-            QACTIVE_POST(AO_Tunnel, (QEvt *)mev, me);
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/4/3/2/0) */
         case MINE_RECYCLE_SIG: {
-            status_ = Q_TRAN(&Mine2_unused);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Mine2_used_x),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Mine2_unused_s, act_);
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
@@ -151,11 +175,15 @@ static QState Mine2_planted(Mine2 * const me, QEvt const * const e) {
                 oie->y   = me->y;
                 oie->bmp = MINE2_BMP;
                 QACTIVE_POST(AO_Tunnel, (QEvt *)oie, me);
-                status_ = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             /* @(/2/4/3/2/1/0/1) */
             else {
-                status_ = Q_TRAN(&Mine2_unused);
+                static QActionHandler const act_[] = {
+                    Q_ACTION_CAST(&Mine2_used_x),
+                    Q_ACTION_CAST(0)
+                };
+                status_ = QM_TRAN(&Mine2_unused_s, act_);
             }
             break;
         }
@@ -166,6 +194,10 @@ static QState Mine2_planted(Mine2 * const me, QEvt const * const e) {
             uint8_t bmp = Q_EVT_CAST(ObjectImageEvt)->bmp;
             /* @(/2/4/3/2/1/1/0) */
             if (do_bitmaps_overlap(MINE2_BMP, me->x, me->y, bmp, x, y)) {
+                static QActionHandler const act_[] = {
+                    Q_ACTION_CAST(&Mine2_used_x),
+                    Q_ACTION_CAST(0)
+                };
                 static MineEvt const mine1_hit = {
                     { HIT_MINE_SIG, 0U, 0U }, /* the QEvt base instance */
                     2U  /* type of the mine (2 for Mine type-2) */
@@ -173,10 +205,10 @@ static QState Mine2_planted(Mine2 * const me, QEvt const * const e) {
                  QACTIVE_POST(AO_Ship, (QEvt *)&mine1_hit, me);
                  /* go straight to 'disabled' and let the Ship do
                  * the exploding */
-                status_ = Q_TRAN(&Mine2_unused);
+                status_ = QM_TRAN(&Mine2_unused_s, act_);
             }
             else {
-                status_ = Q_UNHANDLED();
+                status_ = QM_UNHANDLED();
             }
             break;
         }
@@ -187,6 +219,10 @@ static QState Mine2_planted(Mine2 * const me, QEvt const * const e) {
             uint8_t bmp = Q_EVT_CAST(ObjectImageEvt)->bmp;
             /* @(/2/4/3/2/1/2/0) */
             if (do_bitmaps_overlap(MINE2_MISSILE_BMP, me->x, me->y, bmp, x, y)) {
+                static QActionHandler const act_[] = {
+                    Q_ACTION_CAST(&Mine2_exploding_e),
+                    Q_ACTION_CAST(0)
+                };
                 /* NOTE: Mine type-2 is nastier than Mine type-1.
                 * The type-2 mine can hit the Ship with any of its
                 * "tentacles". However, it can be destroyed by the
@@ -198,30 +234,28 @@ static QState Mine2_planted(Mine2 * const me, QEvt const * const e) {
                     45U  /* score for destroying Mine type-2 */
                 };
                 QACTIVE_POST(AO_Missile, (QEvt *)&mine2_destroyed, me);
-                status_ = Q_TRAN(&Mine2_exploding);
+                status_ = QM_TRAN(&Mine2_exploding_s, act_);
             }
             else {
-                status_ = Q_UNHANDLED();
+                status_ = QM_UNHANDLED();
             }
             break;
         }
         default: {
-            status_ = Q_SUPER(&Mine2_used);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/4/3/2/2) ...........................................................*/
+static QState Mine2_exploding_e(Mine2 * const me) {
+    me->exp_ctr = 0U;
+    return QM_ENTRY(&Mine2_exploding_s);
+}
 static QState Mine2_exploding(Mine2 * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/4/3/2/2) */
-        case Q_ENTRY_SIG: {
-            me->exp_ctr = 0U;
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/4/3/2/2/0) */
         case TIME_TICK_SIG: {
             /* @(/2/4/3/2/2/0/0) */
@@ -236,16 +270,20 @@ static QState Mine2_exploding(Mine2 * const me, QEvt const * const e) {
                 oie->y   = (int8_t)((int)me->y - 4 + 2); /* y of explosion */
                 oie->bmp = EXPLOSION0_BMP + (me->exp_ctr >> 2);
                 QACTIVE_POST(AO_Tunnel, (QEvt *)oie, me);
-                status_ = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             /* @(/2/4/3/2/2/0/1) */
             else {
-                status_ = Q_TRAN(&Mine2_unused);
+                static QActionHandler const act_[] = {
+                    Q_ACTION_CAST(&Mine2_used_x),
+                    Q_ACTION_CAST(0)
+                };
+                status_ = QM_TRAN(&Mine2_unused_s, act_);
             }
             break;
         }
         default: {
-            status_ = Q_SUPER(&Mine2_used);
+            status_ = QM_SUPER();
             break;
         }
     }

+ 41 - 23
examples/arm-cm/qk/gnu/game-qk_ek-lm3s811/missile.c

@@ -25,7 +25,7 @@
 /* @(/2/2) .................................................................*/
 typedef struct MissileTag {
 /* protected: */
-    QActive super;
+    QMActive super;
 
 /* private: */
     uint8_t x;
@@ -35,9 +35,25 @@ typedef struct MissileTag {
 
 /* protected: */
 static QState Missile_initial(Missile * const me, QEvt const * const e);
-static QState Missile_armed(Missile * const me, QEvt const * const e);
-static QState Missile_flying(Missile * const me, QEvt const * const e);
-static QState Missile_exploding(Missile * const me, QEvt const * const e);
+static QState Missile_armed  (Missile * const me, QEvt const * const e);
+static QMState const Missile_armed_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Missile_armed),
+    Q_ACTION_CAST(0)
+};
+static QState Missile_flying  (Missile * const me, QEvt const * const e);
+static QMState const Missile_flying_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Missile_flying),
+    Q_ACTION_CAST(0)
+};
+static QState Missile_exploding  (Missile * const me, QEvt const * const e);
+static QState Missile_exploding_e(Missile * const me);
+static QMState const Missile_exploding_s = {
+    (QMState const *)0,
+    Q_STATE_CAST(&Missile_exploding),
+    Q_ACTION_CAST(0)
+};
 
 static Missile l_missile; /* the sole instance of the Missile active object */
 
@@ -45,10 +61,10 @@ static Missile l_missile; /* the sole instance of the Missile active object */
 QActive * const AO_Missile = (QActive *)&l_missile;       /* opaque pointer */
 
 /* Active object definition ------------------------------------------------*/
-/* @(/2/11) ................................................................*/
+/* @(/2/10) ................................................................*/
 void Missile_ctor(void) {
     Missile *me = &l_missile;
-    QActive_ctor(&me->super, (QStateHandler)&Missile_initial);
+    QMActive_ctor(&me->super, Q_STATE_CAST(&Missile_initial));
 }
 /* @(/2/2) .................................................................*/
 /* @(/2/2/3) ...............................................................*/
@@ -67,7 +83,7 @@ static QState Missile_initial(Missile * const me, QEvt const * const e) {
     QS_SIG_DICTIONARY(MISSILE_FIRE_SIG,   &l_missile);     /* local signals */
     QS_SIG_DICTIONARY(HIT_WALL_SIG,       &l_missile);
     QS_SIG_DICTIONARY(DESTROYED_MINE_SIG, &l_missile);
-    return Q_TRAN(&Missile_armed);
+    return QM_INITIAL(&Missile_armed_s, QMsm_emptyAction_);
 }
 /* @(/2/2/3/1) .............................................................*/
 static QState Missile_armed(Missile * const me, QEvt const * const e) {
@@ -77,11 +93,11 @@ static QState Missile_armed(Missile * const me, QEvt const * const e) {
         case MISSILE_FIRE_SIG: {
             me->x = Q_EVT_CAST(ObjectPosEvt)->x;
             me->y = Q_EVT_CAST(ObjectPosEvt)->y;
-            status_ = Q_TRAN(&Missile_flying);
+            status_ = QM_TRAN(&Missile_flying_s, QMsm_emptyAction_);
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
@@ -103,42 +119,44 @@ static QState Missile_flying(Missile * const me, QEvt const * const e) {
                 oie->y   = me->y;
                 oie->bmp = MISSILE_BMP;
                 QACTIVE_POST(AO_Tunnel, (QEvt *)oie, me);
-                status_ = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             /* @(/2/2/3/2/0/1) */
             else {
-                status_ = Q_TRAN(&Missile_armed);
+                status_ = QM_TRAN(&Missile_armed_s, QMsm_emptyAction_);
             }
             break;
         }
         /* @(/2/2/3/2/1) */
         case HIT_WALL_SIG: {
-            status_ = Q_TRAN(&Missile_exploding);
+            static QActionHandler const act_[] = {
+                Q_ACTION_CAST(&Missile_exploding_e),
+                Q_ACTION_CAST(0)
+            };
+            status_ = QM_TRAN(&Missile_exploding_s, act_);
             break;
         }
         /* @(/2/2/3/2/2) */
         case DESTROYED_MINE_SIG: {
             QACTIVE_POST(AO_Ship, e, me);
-            status_ = Q_TRAN(&Missile_armed);
+            status_ = QM_TRAN(&Missile_armed_s, QMsm_emptyAction_);
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }
     return status_;
 }
 /* @(/2/2/3/3) .............................................................*/
+static QState Missile_exploding_e(Missile * const me) {
+    me->exp_ctr = 0U;
+    return QM_ENTRY(&Missile_exploding_s);
+}
 static QState Missile_exploding(Missile * const me, QEvt const * const e) {
     QState status_;
     switch (e->sig) {
-        /* @(/2/2/3/3) */
-        case Q_ENTRY_SIG: {
-            me->exp_ctr = 0U;
-            status_ = Q_HANDLED();
-            break;
-        }
         /* @(/2/2/3/3/0) */
         case TIME_TICK_SIG: {
             /* @(/2/2/3/3/0/0) */
@@ -154,16 +172,16 @@ static QState Missile_exploding(Missile * const me, QEvt const * const e) {
                 oie->y   = (int8_t)((int)me->y - 4U); /* y-pos */
                 oie->bmp = EXPLOSION0_BMP + (me->exp_ctr >> 2);
                 QACTIVE_POST(AO_Tunnel, (QEvt *)oie, me);
-                status_ = Q_HANDLED();
+                status_ = QM_HANDLED();
             }
             /* @(/2/2/3/3/0/1) */
             else {
-                status_ = Q_TRAN(&Missile_armed);
+                status_ = QM_TRAN(&Missile_armed_s, QMsm_emptyAction_);
             }
             break;
         }
         default: {
-            status_ = Q_SUPER(&QHsm_top);
+            status_ = QM_SUPER();
             break;
         }
     }

Vissa filer visades inte eftersom för många filer har ändrats