原来在21ic上看到两个系统。一个是农民运动讲习所的,一个是凤舞天的实用单片机系统(MS3.20)。两个人还争论了一番。
我对两个人的系统还是不太满意,直到最后找到了这个 Practical UML Statecharts in C/C++, Second Edition: Event-Driven Programming for Embedded Systems。
因为他都是按照各种标准写的,例如UML的标准,MISA汽车标准,所以我决定学习这个。
QPC的简介:下面的英文就几句话,很牛,可以放到单片机上
QP/C is a very lightweight, open source, state machine work for modeling and coding UML state machines in C. Designed for real-time embedded systems, the QP/C work does everything you can expect from an RTOS, only more efficiently, plus many things an RTOS can't do at all.
The QP/C work is supported by the free graphical UML tool called QM (QP Modeler). QM provides intuitive diagramming environment and generates compact C code. QM is available for Windows and Linux.
QP/C consists of a universal UML-compliant event processor (QEP), a higly portable event-driven work (QF), and a tiny preemptive kernel (QK). Current versions of QP include: QP/C and QP/C++, which require about 4KB of code space (ROM) and a few hundred bytes of RAM, and the ultra-lightweight QP-nano, which requires only 1-2KB of ROM and just several bytes of RAM.
第一节: 如何安装
1.1 下载QPC
http://www.state-machine.com/downloads/index.php#QP
我下的是4.01的版本,安装到 C\QP,系统是win7/32
1.2 下载open-watcom-c-win32-1.9编译器
原来的书上使用TC++1.01编译的,可是下载的4.01代码是watcom编译的。原因是TC后来又不让免费用了,所以后来用了不要钱watcom。
安装到C:\tools\WATCOM。
这么安装的原因是:C:\QP\qpc\examples\80x86\dos\watcom\l\game下的make.bat文件中有
if "%WATCOM%"=="" set WATCOM=c:\tools\WATCOM
1.3 下载UltaEdit
我是不想在dos下编的,所以使用了UltraEdit的Dos命令菜单。
编译,成功了。
1.4 make.bat中的命令学习
好古老呀
1.4.1 echo off的含义
DOS在运行批处理时,会依次执行批处理中的每条命令,并且会在显示器上显示,如果你不想让它们显示,可以加一个“echo off”。当然,“echo off”也是命令,它本身也会显示,如果连这条也不显示,就在前面加个“@”。 |