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.
- Note:
- I've chosen the legacy 16-bit DOS platform because it allows programming a standard PC at the bare-metal level. Without leaving your desktop, you can work with interrupts, directly manipulate CPU registers, and directly access the I/O space. No other modern 32-bit development environment for the standard PC allows this much so easily. The ubiquitous PC running under DOS (or a DOS console within any variant of Windows) is as close as it gets to emulate embedded software development on the commodity 80x86 hardware. Additionally, you can use free, mature tools, such as the Borland C/C++ compiler.
I also provide an embedded version for the inexpensive ARM Corterx-M3-based Cortex-M3 LM3S811 evaluation kit from Luminary Micro (see Figure 2-2). Both the PC and Cortex-M3 versions use the exact same source code for all application components and differ only in the Board Support Package (BSP).
- Note:
- The standard QP-nano distribution contains pre-compiled examples (see Directories and Files in the QP-nano Distribution), so you can start experimenting with all examples without building them. However, if you want to re-build the QP-nano examples, this section provides the details.
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 project file for building the "Fly 'n' Shoot" game for DOS with the Turbo C++ 1.01 compiler is found in <qpn>\examples\80x86\tcpp101\game\GAME.PRJ. Similarly, the project file to build the game for Cortex-M3 with the IAR compiler is found in <qpn>\examples\cortex-m3\iar\game-ev-lm3s811\game.ewp.
Prev: QP-nano Tutorial
Next: 2. Let's Play
Copyright © 2002-2008 Quantum Leaps, LLC. All Rights Reserved.
http://www.quantum-leaps.com
Generated on Sun Jun 8 10:49:45 2008 for QP-nano by
1.5.4