mirror of
https://github.com/QuantumLeaps/qpc.git
synced 2025-01-28 07:03:10 +08:00
012c5c360e
Added QP Functional Safety (FuSa) Subsystem Memory Isolation with MPU MISRA-C:2023 compliance Changed comments from C-style to C++ style Added QAsm abstract state machine base class Added memory marker to QEvt and rearranged memory layout Updated: QP-FreeRTOS, QP-ESP-IDF,QP-Zephyr Added drift-free ticking for QP-POSIX Reorganized documentation Updated 3rd_party
114 lines
3.3 KiB
XML
114 lines
3.3 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<model version="5.3.0" links="1">
|
|
<documentation>Start sequence example</documentation>
|
|
<!--${qpc}-->
|
|
<framework name="qpc"/>
|
|
<!--${AOs}-->
|
|
<package name="AOs" stereotype="0x02">
|
|
<!--${AOs::Gizmo}-->
|
|
<class name="Gizmo" superclass="qpc::QActive">
|
|
<!--${AOs::Gizmo::inst}-->
|
|
<attribute name="inst" type="Gizmo" visibility="0x00" properties="0x01">
|
|
<documentation>the only instance of this AO (Singleton)</documentation>
|
|
</attribute>
|
|
<!--${AOs::Gizmo::SM}-->
|
|
<statechart properties="0x03">
|
|
<!--${AOs::Gizmo::SM::initial}-->
|
|
<initial target="../1">
|
|
<action>Q_UNUSED_PAR(par);</action>
|
|
<initial_glyph conn="2,2,5,1,20,6,-2">
|
|
<action box="1,0,6,2"/>
|
|
</initial_glyph>
|
|
</initial>
|
|
<!--${AOs::Gizmo::SM::init}-->
|
|
<state name="init">
|
|
<entry brief="self-post START">static QEvt const startEvt = QEVT_INITIALIZER(START_SIG);
|
|
QACTIVE_POST(&me->super, &startEvt, me); // self-post</entry>
|
|
<!--${AOs::Gizmo::SM::init::START}-->
|
|
<tran trig="START">
|
|
<action>QS_BEGIN_ID(QS_USER1, me->super.prio)
|
|
QS_STR("START");
|
|
QS_END()</action>
|
|
<!--${AOs::Gizmo::SM::init::START::[BSP_getStatus()]}-->
|
|
<choice target="../../../3">
|
|
<guard>BSP_getStatus()</guard>
|
|
<choice_glyph conn="26,14,5,0,16,8">
|
|
<action box="1,0,16,3"/>
|
|
</choice_glyph>
|
|
</choice>
|
|
<!--${AOs::Gizmo::SM::init::START::[else]}-->
|
|
<choice target="../../../2">
|
|
<guard brief="else"/>
|
|
<choice_glyph conn="26,14,4,1,10,-6">
|
|
<action box="-4,10,10,2"/>
|
|
</choice_glyph>
|
|
</choice>
|
|
<tran_glyph conn="2,14,3,-1,24">
|
|
<action box="0,-2,10,2"/>
|
|
</tran_glyph>
|
|
</tran>
|
|
<state_glyph node="2,6,18,12">
|
|
<entry box="1,2,15,2"/>
|
|
</state_glyph>
|
|
</state>
|
|
<!--${AOs::Gizmo::SM::on_battery}-->
|
|
<state name="on_battery">
|
|
<state_glyph node="2,22,18,10"/>
|
|
</state>
|
|
<!--${AOs::Gizmo::SM::on_mains}-->
|
|
<state name="on_mains">
|
|
<state_glyph node="30,22,15,10"/>
|
|
</state>
|
|
<state_diagram size="48,34"/>
|
|
</statechart>
|
|
</class>
|
|
<!--${AOs::Gizmo_ctor}-->
|
|
<operation name="Gizmo_ctor" type="void" visibility="0x00" properties="0x00">
|
|
<code>Gizmo *me = &Gizmo_inst;
|
|
QActive_ctor(&me->super, Q_STATE_CAST(&Gizmo_initial));</code>
|
|
</operation>
|
|
<!--${AOs::AO_Gizmo}-->
|
|
<attribute name="AO_Gizmo" type="QActive * const" visibility="0x00" properties="0x00">
|
|
<documentation>// opaque pointer to the Gizmo AO</documentation>
|
|
<code>= &Gizmo_inst.super;</code>
|
|
</attribute>
|
|
</package>
|
|
<!--${src}-->
|
|
<directory name="src">
|
|
<!--${src::gizmo.h}-->
|
|
<file name="gizmo.h">
|
|
<text>#ifndef GIZMO_H_
|
|
#define GIZMO_H_
|
|
|
|
enum BlinkySignals {
|
|
DUMMY_SIG = Q_USER_SIG,
|
|
// ...
|
|
MAX_PUB_SIG, // the last published signal
|
|
|
|
START_SIG,
|
|
// ...
|
|
MAX_SIG // the last signal
|
|
};
|
|
|
|
$declare ${AOs::AO_Gizmo}
|
|
$declare ${AOs::Gizmo_ctor}
|
|
|
|
#endif // GIZMO_H_</text>
|
|
</file>
|
|
<!--${src::gizmo.c}-->
|
|
<file name="gizmo.c">
|
|
<text>#include "qpc.h"
|
|
#include "bsp.h"
|
|
#include "gizmo.h"
|
|
|
|
//Q_DEFINE_THIS_MODULE("gizmo")
|
|
|
|
$declare ${AOs::Gizmo}
|
|
|
|
$define ${AOs::AO_Gizmo}
|
|
$define ${AOs::Gizmo_ctor}
|
|
$define ${AOs::Gizmo}</text>
|
|
</file>
|
|
</directory>
|
|
</model>
|