mirror of
https://github.com/QuantumLeaps/qpc.git
synced 2025-01-28 07:03:10 +08:00
113 lines
3.1 KiB
XML
113 lines
3.1 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<model version="4.6.0" links="1">
|
|
<documentation>Blinky model</documentation>
|
|
<!--${qpc}-->
|
|
<framework name="qpc"/>
|
|
<!--${AOs}-->
|
|
<package name="AOs" stereotype="0x02">
|
|
<!--${AOs::Blinky}-->
|
|
<class name="Blinky" superclass="qpc::QActive">
|
|
<!--${AOs::Blinky::timeEvt}-->
|
|
<attribute name="timeEvt" type="QTimeEvt" visibility="0x02" properties="0x00"/>
|
|
<!--${AOs::Blinky::SM}-->
|
|
<statechart properties="0x03">
|
|
<!--${AOs::Blinky::SM::initial}-->
|
|
<initial target="../1">
|
|
<action>(void)e; /* unused parameter */
|
|
|
|
QS_OBJ_DICTIONARY(&l_blinky);
|
|
QS_OBJ_DICTIONARY(&l_blinky.timeEvt);
|
|
|
|
QTimeEvt_armX(&me->timeEvt,
|
|
BSP_TICKS_PER_SEC/2, BSP_TICKS_PER_SEC/2);</action>
|
|
<initial_glyph conn="2,3,5,1,20,4,-4">
|
|
<action box="0,-2,6,2"/>
|
|
</initial_glyph>
|
|
</initial>
|
|
<!--${AOs::Blinky::SM::off}-->
|
|
<state name="off">
|
|
<entry>BSP_ledOff();</entry>
|
|
<!--${AOs::Blinky::SM::off::TIMEOUT}-->
|
|
<tran trig="TIMEOUT" target="../../2">
|
|
<tran_glyph conn="2,13,3,1,18,6,-2">
|
|
<action box="0,-2,8,2"/>
|
|
</tran_glyph>
|
|
</tran>
|
|
<state_glyph node="2,5,16,10">
|
|
<entry box="1,2,12,4"/>
|
|
</state_glyph>
|
|
</state>
|
|
<!--${AOs::Blinky::SM::on}-->
|
|
<state name="on">
|
|
<entry>BSP_ledOn();</entry>
|
|
<!--${AOs::Blinky::SM::on::TIMEOUT}-->
|
|
<tran trig="TIMEOUT" target="../../1">
|
|
<tran_glyph conn="2,25,3,1,20,-15,-4">
|
|
<action box="0,-2,8,2"/>
|
|
</tran_glyph>
|
|
</tran>
|
|
<state_glyph node="2,17,16,10">
|
|
<entry box="1,2,12,4"/>
|
|
</state_glyph>
|
|
</state>
|
|
<state_diagram size="30,29"/>
|
|
</statechart>
|
|
</class>
|
|
<!--${AOs::AO_Blinky}-->
|
|
<attribute name="AO_Blinky" type="QActive * const" visibility="0x00" properties="0x00">
|
|
<documentation>/* opaque pointer to the Blinky AO */</documentation>
|
|
<code>= &l_blinky.super;</code>
|
|
</attribute>
|
|
<!--${AOs::Blinky_ctor}-->
|
|
<operation name="Blinky_ctor" type="void" visibility="0x00" properties="0x00">
|
|
<code>Blinky *me = &l_blinky;
|
|
QActive_ctor(&me->super, Q_STATE_CAST(&Blinky_initial));
|
|
QTimeEvt_ctorX(&me->timeEvt, &me->super, TIMEOUT_SIG, 0U);</code>
|
|
</operation>
|
|
</package>
|
|
<!--${src}-->
|
|
<directory name="src">
|
|
<!--${src::blinky.h}-->
|
|
<file name="blinky.h">
|
|
<text>#ifndef BLINKY_H
|
|
#define BLINKY_H
|
|
|
|
enum BlinkySignals {
|
|
DUMMY_SIG = Q_USER_SIG,
|
|
MAX_PUB_SIG, /* the last published signal */
|
|
|
|
TIMEOUT_SIG,
|
|
MAX_SIG /* the last signal */
|
|
};
|
|
|
|
$declare${AOs::Blinky_ctor}
|
|
|
|
$declare${AOs::AO_Blinky}
|
|
|
|
#endif /* BLINKY_H */
|
|
</text>
|
|
</file>
|
|
<!--${src::blinky.c}-->
|
|
<file name="blinky.c">
|
|
<text>#include "qpc.h"
|
|
#include "blinky.h"
|
|
#include "bsp.h"
|
|
|
|
//Q_DEFINE_THIS_MODULE("blinky")
|
|
|
|
/*************** ask QM to declare the Blinky class ******************/
|
|
$declare${AOs::Blinky}
|
|
|
|
static Blinky l_blinky;
|
|
|
|
$define${AOs::AO_Blinky}
|
|
|
|
/*************** ask QM to define the Blinky class ******************/
|
|
$define${AOs::Blinky_ctor}
|
|
|
|
$define${AOs::Blinky}
|
|
</text>
|
|
</file>
|
|
</directory>
|
|
</model>
|