This QP-nano Tutorial is adapted from Chapter 1 of Practical UML Statecharts in C/C++, Second Edition
by Miro Samek, the founder and president of Quantum Leaps, LLC.
Prev: QP-nano Tutorial
Next: 2. Let's Play
QP-nano is distributed in a simple platform-independent ZIP file, or in a self-extracting Windows executable. Either way, installing QP-nano requires simply decompressing the provided archive into a directory of your choice (e.g., <qpn> for QP-nano). The Section Directories and Files in the QP-nano Distribution describes the directories and files included in the standard QP-nano distribution.
Specifically to the "Fly 'n' Shoot" example, the companion code contains two versions of the game. I provide a DOS version for the standard Windows-based PC (see Figure 2-1) so that you don't need any special embedded board to play the game and experiment with the code.
I also provide an embedded version for the inexpensive ARM Corterx-M3-based LM3S811 evaluation kit from Luminary Micro (see Figure 2-2). Both the PC and ARM-Cortex versions use the exact same source code for all application components and differ only in the Board Support Package (BSP).
Figure 1-1 Building a QP-nano Application.
Figure 1-1 shows the process of building a QP-nano application. You merely need to add two QP-nano source files qepn.c and qfn.c to the project and you need to instruct the compiler to search for the header files in the <qpn>\include\ directory, typically through the -I option.. (If you use QK-nano, you additionally need to add the qkn.c source file.) The make script for building the "Fly 'n' Shoot" game for DOS with the Open Watcom compiler is found in <qpn>\examples\80x86\watcom\game\make.bat. Similarly, the IAR EWARM project file to build the game for ARM-Cortex with the IAR compiler is found in <qpn>\examples\arm-cortex\iar\game-ev-lm3s811\game.ewp.
Prev: QP-nano Tutorial
Next: 2. Let's Play
Copyright © 2002-2010 Quantum Leaps, LLC. All Rights Reserved.
http://www.quantum-leaps.com
1.6.3