Ejemplo n.º 1
0
Archivo: cli.c Proyecto: ageamiu/cdb
/*${AOs::CLI_ctor} .........................................................*/
void CLI_ctor(void) {
    CLI* me = &l_cli;

    QActive_ctor( &me->super, Q_STATE_CAST( &CLI_initial ));
    QTimeEvt_ctor( &me->blinkEvt, BLINK_SIG );
    QTimeEvt_ctor( &me->rollEvt, ROLL_SIG );
}
Ejemplo n.º 2
0
/*${AOs::FlashMgr_ctor} ....................................................*/
void FlashMgr_ctor(void) {
    FlashMgr *me = &l_FlashMgr;
    QActive_ctor(&me->super, (QStateHandler)&FlashMgr_initial);
    QTimeEvt_ctor(&me->flashTimerEvt, FLASH_TIMEOUT_SIG);
    QTimeEvt_ctor(&me->flashOpTimerEvt, FLASH_OP_TIMEOUT_SIG);
    QTimeEvt_ctor(&me->ramTimerEvt, RAM_TIMEOUT_SIG);
}
Ejemplo n.º 3
0
/* @(/1/21) ................................................................*/
void QGprs_ctor(void) {
    QGprs *me = &l_Gprs;
    QActive_ctor(&me->super, Q_STATE_CAST(&QGprs_initial));
    QTimeEvt_ctor(&me->m_Timer, Q_TIMEOUT_SIG);
    QTimeEvt_ctor(&me->m_LEDTimer, GPRS_LED_TIMEOUT_SIG);
    QTimeEvt_ctor(&me->m_retrieveTimer, GPRS_RETRIEVE_TIMEOUT_SIG);
    QTimeEvt_ctor(&me->m_PingTimer, GPRS_PING_TIMEOUT_SIG);
    QTimeEvt_ctor(&me->m_retrieveTimer, GPRS_RETRIEVE_TIMEOUT_SIG);
}
Ejemplo n.º 4
0
/*..........................................................................*/
void Tunnel_ctor(void) {
    uint8_t n;
    Tunnel *me = &l_tunnel;
    QActive_ctor(&me->super, (QStateHandler)&Tunnel_initial);
    QTimeEvt_ctor(&me->blinkTimeEvt,  BLINK_TIMEOUT_SIG);
    QTimeEvt_ctor(&me->screenTimeEvt, SCREEN_TIMEOUT_SIG);
    for (n = 0; n < GAME_MINES_MAX; ++n) {
        me->mine1_pool[n] = Mine1_ctor(n); /* instantiate Mine1 in the pool */
        me->mine2_pool[n] = Mine2_ctor(n); /* instantiate Mine2 in the pool */
        me->mines[n] = (QHsm *)0;                     /* mine 'n' is unused */
    }
    me->last_mine_x = 0;   /* the last mine at the right edge of the tunnel */
    me->last_mine_y = 0;
}
/*..........................................................................*/
void AlarmMgr_ctor(void) {
    AlarmMgr *me = &l_alarmmgr;

    QActive_ctor(&me->super, (QStateHandler)&AlarmMgr_initial);
    QTimeEvt_ctor(&me->timer, TIMEOUT_SIG);

    QPSet8_clear(&me->active_alarms);
}
/* @(/2/0/1) ...............................................................*/
void Philo_ctor(void) {
    uint8_t n;
    Philo *me;
    for (n = 0; n < N_PHILO; ++n) {
        me = &l_philo[n];
        QActive_ctor(&me->super, (QStateHandler)&Philo_initial);
        QTimeEvt_ctor(&me->timeEvt, TIMEOUT_SIG);
    }
}
Ejemplo n.º 7
0
/*${AOs::SerialMgr_ctor} ...................................................*/
void SerialMgr_ctor(void) {
    SerialMgr *me = &l_SerialMgr;
    QActive_ctor(&me->super, (QStateHandler)&SerialMgr_initial);
    QTimeEvt_ctor(&me->serialTimerEvt, UART_DMA_TIMEOUT_SIG);

    /* Initialize the deferred event queue and storage for it */
    QEQueue_init(
        &me->deferredEvtQueue,
        (QEvt const **)( me->deferredEvtQSto ),
        Q_DIM(me->deferredEvtQSto)
    );
}
/*..........................................................................*/
void LwIPMgr_ctor(void) {
    LwIPMgr *me = &l_lwIPMgr;

    QActive_ctor(&me->super, (QStateHandler)&LwIPMgr_initial);
    QTimeEvt_ctor(&me->te_LWIP_SLOW_TICK, LWIP_SLOW_TICK_SIG);
}
Ejemplo n.º 9
0
/* @(/1/31) ................................................................*/
void QCAN_ctor(void) {
    QCAN *me = &l_Can;
    QActive_ctor(&me->super, Q_STATE_CAST(&QCAN_initial));
    QTimeEvt_ctor(&me->m_tickTimer, PER_SECOND_SIG);
}
Ejemplo n.º 10
0
/* @(/1/32) ................................................................*/
void QACCDetector_ctor(void) {
    QACCDetector *me = &l_ACCDetector;
    QActive_ctor(&me->super, Q_STATE_CAST(&QACCDetector_initial));

    QTimeEvt_ctor(&me->m_Timer, Q_TIMEOUT_SIG);
}
Ejemplo n.º 11
0
/* @(/2/2) .................................................................*/
void CoffeeAO_ctor(CoffeeAO* me) {
    QActive_ctor(&me->super, (QStateHandler)&CoffeeAO_initial);
    Alarm_ctor(&me->alarm);                /* orthogonal component ctor */
    QTimeEvt_ctor(&me->timeEvt, TICK_SIG);       /* private time event ctor */
}
Ejemplo n.º 12
0
/*..........................................................................*/
void AlarmClock_ctor(AlarmClock *me) {                      /* default ctor */
    QActive_ctor(&me->super, (QStateHandler)&AlarmClock_initial);
    Alarm_ctor(&me->alarm);                /* orthogonal component ctor */
    QTimeEvt_ctor(&me->timeEvt, TICK_SIG);       /* private time event ctor */
}
Ejemplo n.º 13
0
/* @(/1/2) .................................................................*/
void Blinky_ctor(void) {
        Blinky *me = &l_blinky;

        QActive_ctor(&me->super, Q_STATE_CAST(&Blinky_initial));
        QTimeEvt_ctor(&me->timeEvt, TIMEOUT_SIG);
}
Ejemplo n.º 14
0
void LPJ_ctor(void) {
    LPJ *me = &l_LPJ;
    QActive_ctor(&me->super, (QStateHandler)&LPJ_initial);
    QTimeEvt_ctor(&me->timeEvent, TickTime_SIG);
}