= &Blinky1_inst.super;
= &Blinky2_inst.super;
QActive_ctor(&me->super, Q_STATE_CAST(&Blinky1_initial));
QTimeEvt_ctorX(&me->te, &me->super, TIMEOUT_SIG, 0U);
QTimeEvt_armX(&me->te, 2U, 2U);
for (uint32_t volatile i = 1500U; i != 0U; --i) {
BSP_ledGreenOn();
BSP_ledGreenOff();
}
QActive_ctor(&me->super, Q_STATE_CAST(&Blinky2_initial));
for (uint32_t volatile i = 3*1500U; i != 0U; --i) {
BSP_ledBlueOn();
BSP_ledBlueOff();
}
#include "qpc.h"
#include "bsp.h"
Q_DEFINE_THIS_FILE
$declare ${AOs}
static QEvt const *blinky1_queue[10];
static QEvt const *blinky2_queue[10];
int main(void) {
BSP_init();
QF_init();
/* initialize and start Blinky1 AO */
Blinky1_ctor(&Blinky1_inst);
QACTIVE_START(&Blinky1_inst,
5U, /* priority */
blinky1_queue, Q_DIM(blinky1_queue), /* event queue */
(void *)0, 0, /* stack memory, stack size (not used) */
(void *)0); /* extra parameter (not used) */
/* initialize and start Blinky2 AO */
Blinky2_ctor(&Blinky2_inst);
QACTIVE_START(&Blinky2_inst,
2U, /* priority */
blinky2_queue, Q_DIM(blinky2_queue), /* event queue */
(void *)0, 0, /* stack memory, stack size (not used) */
(void *)0); /* extra parameter (not used) */
/* transfer control to the RTOS to run the threads */
return QF_run();
}
/*=======================================================================*/
$define ${AO_ptrs}
$define ${AOs}