<?xml version="1.0" encoding="UTF-8"?>
<model version="4.6.0" links="1">
 <documentation>Blinky Low-Power example</documentation>
 <!--${qpc}-->
 <framework name="qpc"/>
 <!--${AOs}-->
 <package name="AOs" stereotype="0x02">
  <!--${AOs::Blinky0}-->
  <class name="Blinky0" superclass="qpc::QActive">
   <!--${AOs::Blinky0::timeEvt0}-->
   <attribute name="timeEvt0" type="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::count}-->
   <attribute name="count" type="uint8_t" visibility="0x02" properties="0x00">
    <documentation>blink counter</documentation>
   </attribute>
   <!--${AOs::Blinky0::SM}-->
   <statechart properties="0x03">
    <!--${AOs::Blinky0::SM::initial}-->
    <initial target="../1">
     <action>(void)e; /* unused parameter */
QActive_subscribe(&amp;me-&gt;super, 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();
me-&gt;count = 4U;
QTimeEvt_armX(&amp;me-&gt;timeEvt0, 2U, 2U);</entry>
     <exit>QTimeEvt_disarm(&amp;me-&gt;timeEvt0);</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>--me-&gt;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::[me->count>0]}-->
       <choice target="../../../2">
        <guard>me-&gt;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="qpc::QActive">
   <!--${AOs::Blinky1::instance}-->
   <attribute name="instance" type="Blinky1" visibility="0x00" properties="0x01">
    <documentation>the sole instance of Blinky1 (singleton)</documentation>
   </attribute>
   <!--${AOs::Blinky1::timeEvt1}-->
   <attribute name="timeEvt1" type="QTimeEvt" visibility="0x02" properties="0x00"/>
   <!--${AOs::Blinky1::count}-->
   <attribute name="count" type="uint8_t" visibility="0x02" properties="0x00">
    <documentation>blink counter</documentation>
   </attribute>
   <!--${AOs::Blinky1::SM}-->
   <statechart properties="0x03">
    <!--${AOs::Blinky1::SM::initial}-->
    <initial target="../1">
     <action>(void)e; /* unused parameter */
QActive_subscribe(&amp;me-&gt;super, 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();
me-&gt;count = 13U;
QTimeEvt_armX(&amp;me-&gt;timeEvt1, 2U, 2U);</entry>
     <exit>QTimeEvt_disarm(&amp;me-&gt;timeEvt1);</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>--me-&gt;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::[me->count>0]}-->
       <choice target="../../../1">
        <guard>me-&gt;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="QActive * const" visibility="0x00" properties="0x01">
   <code>= &amp;Blinky0_instance.super;</code>
  </attribute>
  <!--${AOs::AO_Blinky1}-->
  <attribute name="AO_Blinky1" type="QActive * const" visibility="0x00" properties="0x01">
   <code>= &amp;Blinky1_instance.super;</code>
  </attribute>
  <!--${AOs::Blinky0_ctor}-->
  <operation name="Blinky0_ctor" type="void" visibility="0x00" properties="0x00">
   <code>Blinky0 *me = &amp;Blinky0_instance;
QActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Blinky0_initial));
QTimeEvt_ctorX(&amp;me-&gt;timeEvt0, &amp;me-&gt;super, TIMEOUT0_SIG, 0U);</code>
  </operation>
  <!--${AOs::Blinky1_ctor}-->
  <operation name="Blinky1_ctor" type="void" visibility="0x00" properties="0x00">
   <code>Blinky1 *me = &amp;Blinky1_instance;
QActive_ctor(&amp;me-&gt;super, Q_STATE_CAST(&amp;Blinky1_initial));
QTimeEvt_ctorX(&amp;me-&gt;timeEvt1, &amp;me-&gt;super, TIMEOUT1_SIG, 1U);</code>
  </operation>
 </package>
 <!--${.}-->
 <directory name=".">
  <!--${.::low_power.h}-->
  <file name="low_power.h">
   <text>#ifndef LOW_POWER_H
#define LOW_POWER_H

enum BlinkySignals {
    BTN_PRESSED_SIG = 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}
$declare${AOs::Blinky0_ctor}

#ifdef QXK_H /* QXK kernel? */

void XBlinky1_ctor(void);
extern QXThread XT_Blinky1;
extern QXSemaphore XSEM_sw1;

#else /* QV or QK kernels */

$declare${AOs::AO_Blinky1}
$declare${AOs::Blinky1_ctor}

#endif

#endif /* LOW_POWER_H */
</text>
  </file>
  <!--${.::blinky0.c}-->
  <file name="blinky0.c">
   <text>#include &quot;qpc.h&quot;
#include &quot;low_power.h&quot;
#include &quot;bsp.h&quot;

//Q_DEFINE_THIS_FILE

$declare${AOs::Blinky0}

$define${AOs::AO_Blinky0}

$define${AOs::Blinky0}

$define${AOs::Blinky0_ctor}
</text>
  </file>
  <!--${.::blinky1.c}-->
  <file name="blinky1.c">
   <text>#include &quot;qpc.h&quot;
#include &quot;low_power.h&quot;
#include &quot;bsp.h&quot;

//Q_DEFINE_THIS_FILE

$declare${AOs::Blinky1}

$define${AOs::AO_Blinky1}

$define${AOs::Blinky1}

$define${AOs::Blinky1_ctor}
</text>
  </file>
 </directory>
</model>
