2020-11-09 12:57:45 -05:00

275 lines
8.4 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<model version="5.1.0" links="1">
<documentation>Blinky Low-Power example</documentation>
<!--${qpcpp}-->
<framework name="qpcpp"/>
<!--${AOs}-->
<package name="AOs" stereotype="0x02">
<!--${AOs::Blinky0}-->
<class name="Blinky0" superclass="qpcpp::QActive">
<!--${AOs::Blinky0::m_timeEvt0}-->
<attribute name="m_timeEvt0" type="QP::QTimeEvt" visibility="0x02" properties="0x00"/>
<!--${AOs::Blinky0::instance}-->
<attribute name="instance" type="Blinky0" visibility="0x00" properties="0x01">
<documentation>the sole instance of Blinky (singleton)</documentation>
</attribute>
<!--${AOs::Blinky0::m_count}-->
<attribute name="m_count" type="uint8_t" visibility="0x02" properties="0x00">
<documentation>blink counter</documentation>
</attribute>
<!--${AOs::Blinky0::Blinky0}-->
<operation name="Blinky0" type="" visibility="0x00" properties="0x00">
<code>: QActive(Q_STATE_CAST(&amp;initial)),
m_timeEvt0(this, TIMEOUT0_SIG, 0U)</code>
</operation>
<!--${AOs::Blinky0::SM}-->
<statechart properties="0x02">
<!--${AOs::Blinky0::SM::initial}-->
<initial target="../1">
<action>(void)e; // unused parameter
subscribe(BTN_PRESSED_SIG);</action>
<initial_glyph conn="4,4,5,1,34,4,-4">
<action box="0,-2,10,2"/>
</initial_glyph>
</initial>
<!--${AOs::Blinky0::SM::active}-->
<state name="active">
<entry>BSP_tickRate0_on();
m_count = 4U;
m_timeEvt0.armX(2U, 2U);</entry>
<exit>m_timeEvt0.disarm();</exit>
<!--${AOs::Blinky0::SM::active::initial}-->
<initial target="../1">
<initial_glyph conn="4,22,5,1,20,4,-2">
<action box="1,0,10,2"/>
</initial_glyph>
</initial>
<!--${AOs::Blinky0::SM::active::on}-->
<state name="on">
<entry>BSP_led0_on();</entry>
<exit>BSP_led0_off();</exit>
<!--${AOs::Blinky0::SM::active::on::TIMEOUT0}-->
<tran trig="TIMEOUT0">
<action>--m_count;</action>
<!--${AOs::Blinky0::SM::active::on::TIMEOUT0::[else]}-->
<choice target="../../../../2">
<guard brief="else"/>
<choice_glyph conn="28,38,5,1,8,24,-4">
<action box="1,-2,10,2"/>
</choice_glyph>
</choice>
<!--${AOs::Blinky0::SM::active::on::TIMEOUT0::[m_count>0]}-->
<choice target="../../../2">
<guard>m_count &gt; 0</guard>
<choice_glyph conn="28,38,4,1,14,-6">
<action box="-3,6,15,2"/>
</choice_glyph>
</choice>
<tran_glyph conn="4,38,3,-1,24">
<action box="0,-2,15,4"/>
</tran_glyph>
</tran>
<state_glyph node="4,24,18,18">
<entry box="1,2,17,4"/>
<exit box="1,6,17,4"/>
</state_glyph>
</state>
<!--${AOs::Blinky0::SM::active::off}-->
<state name="off">
<!--${AOs::Blinky0::SM::active::off::TIMEOUT0}-->
<tran trig="TIMEOUT0" target="../../1">
<tran_glyph conn="4,50,3,1,20,-18,-2">
<action box="0,-2,15,2"/>
</tran_glyph>
</tran>
<state_glyph node="4,44,18,10"/>
</state>
<state_glyph node="2,6,32,50">
<entry box="1,2,31,8"/>
<exit box="1,10,31,4"/>
</state_glyph>
</state>
<!--${AOs::Blinky0::SM::inactive}-->
<state name="inactive">
<!--${AOs::Blinky0::SM::inactive::BTN_PRESSED}-->
<tran trig="BTN_PRESSED" target="../../1">
<tran_glyph conn="2,66,3,1,36,-50,-4">
<action box="0,-2,15,2"/>
</tran_glyph>
</tran>
<state_glyph node="2,58,30,12"/>
</state>
<state_diagram size="42,74"/>
</statechart>
</class>
<!--${AOs::Blinky1}-->
<class name="Blinky1" superclass="qpcpp::QActive">
<!--${AOs::Blinky1::instance}-->
<attribute name="instance" type="Blinky1" visibility="0x00" properties="0x01">
<documentation>the sole instance of Blinky1 (singleton)</documentation>
</attribute>
<!--${AOs::Blinky1::m_timeEvt1}-->
<attribute name="m_timeEvt1" type="QP::QTimeEvt" visibility="0x02" properties="0x00"/>
<!--${AOs::Blinky1::m_count}-->
<attribute name="m_count" type="uint8_t" visibility="0x02" properties="0x00">
<documentation>blink counter</documentation>
</attribute>
<!--${AOs::Blinky1::Blinky1}-->
<operation name="Blinky1" type="" visibility="0x00" properties="0x00">
<code>: QActive(Q_STATE_CAST(&amp;initial)),
m_timeEvt1(this, TIMEOUT1_SIG, 1U)</code>
</operation>
<!--${AOs::Blinky1::SM}-->
<statechart properties="0x02">
<!--${AOs::Blinky1::SM::initial}-->
<initial target="../1">
<action>(void)e; /* unused parameter */
subscribe(BTN_PRESSED_SIG);</action>
<initial_glyph conn="4,4,5,1,32,4,-4">
<action box="0,-2,10,2"/>
</initial_glyph>
</initial>
<!--${AOs::Blinky1::SM::inactive}-->
<state name="inactive">
<!--${AOs::Blinky1::SM::inactive::BTN_PRESSED}-->
<tran trig="BTN_PRESSED" target="../../2">
<tran_glyph conn="2,14,3,1,34,16,-2">
<action box="0,-2,17,2"/>
</tran_glyph>
</tran>
<state_glyph node="2,6,30,12"/>
</state>
<!--${AOs::Blinky1::SM::active}-->
<state name="active">
<entry>BSP_tickRate1_on();
m_count = 13U;
m_timeEvt1.armX(2U, 2U);</entry>
<exit>m_timeEvt1.disarm();</exit>
<!--${AOs::Blinky1::SM::active::initial}-->
<initial target="../2">
<initial_glyph conn="4,38,5,1,22,4,-4">
<action box="1,0,10,2"/>
</initial_glyph>
</initial>
<!--${AOs::Blinky1::SM::active::off}-->
<state name="off">
<!--${AOs::Blinky1::SM::active::off::TIMEOUT1}-->
<tran trig="TIMEOUT1" target="../../2">
<tran_glyph conn="4,64,3,1,20,-16,-2">
<action box="0,-2,10,2"/>
</tran_glyph>
</tran>
<state_glyph node="4,58,18,10"/>
</state>
<!--${AOs::Blinky1::SM::active::on}-->
<state name="on">
<entry>BSP_led1_on();</entry>
<exit>BSP_led1_off();</exit>
<!--${AOs::Blinky1::SM::active::on::TIMEOUT1}-->
<tran trig="TIMEOUT1">
<action>--m_count;</action>
<!--${AOs::Blinky1::SM::active::on::TIMEOUT1::[else]}-->
<choice target="../../../../1">
<guard brief="else"/>
<choice_glyph conn="28,53,5,1,10,-41,-6">
<action box="1,-2,10,2"/>
</choice_glyph>
</choice>
<!--${AOs::Blinky1::SM::active::on::TIMEOUT1::[m_count>0]}-->
<choice target="../../../1">
<guard>m_count &gt; 0</guard>
<choice_glyph conn="28,53,4,1,13,-6">
<action box="-3,6,14,2"/>
</choice_glyph>
</choice>
<tran_glyph conn="4,53,3,-1,24">
<action box="0,-2,15,5"/>
</tran_glyph>
</tran>
<state_glyph node="4,40,18,16">
<entry box="1,2,17,4"/>
<exit box="1,6,17,4"/>
</state_glyph>
</state>
<state_glyph node="2,22,32,48">
<entry box="1,2,31,8"/>
<exit box="1,10,31,4"/>
</state_glyph>
</state>
<state_diagram size="42,74"/>
</statechart>
</class>
<!--${AOs::AO_Blinky0}-->
<attribute name="AO_Blinky0" type="QP::QActive * const" visibility="0x00" properties="0x01">
<code>= &amp;Blinky0::instance;</code>
</attribute>
<!--${AOs::AO_Blinky1}-->
<attribute name="AO_Blinky1" type="QP::QActive * const" visibility="0x00" properties="0x01">
<code>= &amp;Blinky1::instance;</code>
</attribute>
</package>
<!--${.}-->
<directory name=".">
<!--${.::low_power.hpp}-->
<file name="low_power.hpp">
<text>#ifndef LOW_POWER_HPP
#define LOW_POWER_HPP
enum BlinkySignals {
BTN_PRESSED_SIG = QP::Q_USER_SIG, // button SW1 was pressed
MAX_PUB_SIG, // the last published signal
TIMEOUT0_SIG, // timeout for Blinky0
TIMEOUT1_SIG, // timeout for Blinky1
MAX_SIG // the last signal
};
$declare${AOs::AO_Blinky0}
#ifdef QXK_HPP // QXK kernel?
extern QP::QXThread XT_Blinky1;
extern QP::QXSemaphore XSEM_sw1;
#else // QV or QK kernels
$declare${AOs::AO_Blinky1}
#endif
#endif // LOW_POWER_HPP
</text>
</file>
<!--${.::blinky0.cpp}-->
<file name="blinky0.cpp">
<text>#include &quot;qpcpp.hpp&quot;
#include &quot;low_power.hpp&quot;
#include &quot;bsp.hpp&quot;
//Q_DEFINE_THIS_FILE
$declare${AOs::Blinky0}
$define${AOs::AO_Blinky0}
$define${AOs::Blinky0}
</text>
</file>
<!--${.::blinky1.cpp}-->
<file name="blinky1.cpp">
<text>#include &quot;qpcpp.hpp&quot;
#include &quot;low_power.hpp&quot;
#include &quot;bsp.hpp&quot;
//Q_DEFINE_THIS_FILE
$declare${AOs::Blinky1}
$define${AOs::AO_Blinky1}
$define${AOs::Blinky1}
</text>
</file>
</directory>
</model>