You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
95 lines
2.7 KiB
XML
95 lines
2.7 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<model version="5.1.4" links="1">
|
|
<documentation>About this model:
|
|
-----------------
|
|
The TimeBomb example from the video course "Modern Embedded Systems Programming":
|
|
|
|
https://www.youtube.com/c/StateMachineCOM
|
|
|
|
|
|
This example demonstrates:
|
|
- Active object TimeBomb) with hierarchical state machine
|
|
- Automatic code genertation from the model
|
|
- Integration between the generated code and other code, such as the Board Support Package (BSP)
|
|
|
|
|
|
Building and running the example:
|
|
This example builds with the uVision project "lesson" and is designed to run on the TivaC LaunchPad board.</documentation>
|
|
<!--${qpc}-->
|
|
<framework name="qpc"/>
|
|
<package file="./aos_package.qmp"/>
|
|
<!--${.}-->
|
|
<directory name=".">
|
|
<!--${.::main.c}-->
|
|
<file name="main.c">
|
|
<text>/* TimeBomb/Button with QP/C framework */
|
|
#include "qpc.h" /* QP/C API */
|
|
#include "bsp.h"
|
|
|
|
Q_DEFINE_THIS_MODULE("main") /* this module name for Q_ASSERT() */
|
|
|
|
/* The TimeBomb AO =======================================================*/
|
|
$declare${AOs::TimeBomb}
|
|
|
|
$define${AOs::TimeBomb}
|
|
|
|
static QEvt const *timeBomb_queue[10];
|
|
static TimeBomb timeBomb;
|
|
QActive *AO_TimeBomb = &timeBomb.super;
|
|
|
|
/* the main function =========================================================*/
|
|
int main() {
|
|
|
|
BSP_init(); /* initialize the BSP */
|
|
QF_init(); /* initialize QP/C */
|
|
|
|
/* create AO and start it */
|
|
TimeBomb_ctor(&timeBomb);
|
|
QACTIVE_START(AO_TimeBomb,
|
|
2U,
|
|
timeBomb_queue,
|
|
sizeof(timeBomb_queue)/sizeof(timeBomb_queue[0]),
|
|
(void *)0, 0U,
|
|
(void *)0);
|
|
|
|
QF_run(); /* run QP/C... */
|
|
return 0; /* NOTE: the scheduler does NOT return */
|
|
}
|
|
</text>
|
|
</file>
|
|
<!--${.::my_file1.c}-->
|
|
<file name="my_file1.c">
|
|
<text>/* TimeBomb/Button with QP/C framework */
|
|
#include "qpc.h" /* QP/C API */
|
|
#include "bsp.h"
|
|
|
|
Q_DEFINE_THIS_MODULE("my_file1") /* this module name for Q_ASSERT() */
|
|
|
|
$define${AOs::TimeBomb::ctor}
|
|
</text>
|
|
</file>
|
|
<!--${.::my_file2.c}-->
|
|
<file name="my_file2.c">
|
|
<text>/* TimeBomb/Button with QP/C framework */
|
|
#include "qpc.h" /* QP/C API */
|
|
#include "bsp.h"
|
|
|
|
Q_DEFINE_THIS_MODULE("my_file2") /* this module name for Q_ASSERT() */
|
|
|
|
$define${AOs}
|
|
</text>
|
|
</file>
|
|
<!--${.::my_file3.c}-->
|
|
<file name="my_file3.c">
|
|
<text>/* TimeBomb/Button with QP/C framework */
|
|
#include "qpc.h" /* QP/C API */
|
|
#include "bsp.h"
|
|
|
|
Q_DEFINE_THIS_MODULE("my_file3") /* this module name for Q_ASSERT() */
|
|
|
|
$define1 ${AOs::TimeBomb::SM::armed}
|
|
</text>
|
|
</file>
|
|
</directory>
|
|
</model>
|