Exemple #1
0
/*..........................................................................*/
void Philo_ctor(void) {                    /* instantiate all Philo objects */
    QActive_ctor(&AO_Philo0.super, (QStateHandler)&Philo_initial);
    QActive_ctor(&AO_Philo1.super, (QStateHandler)&Philo_initial);
    QActive_ctor(&AO_Philo2.super, (QStateHandler)&Philo_initial);
    //QActive_ctor(&AO_Philo3.super, (QStateHandler)&Philo_initial);
    //QActive_ctor(&AO_Philo4.super, (QStateHandler)&Philo_initial);
}
/*******************************************************************************
 * Code
 ******************************************************************************/
void LEDSEQ_Creator(uint16_t led)
{
    LedSeq * const me = &AO_LedSeq;
    me->led = led;

    QActive_ctor(&me->super, Q_STATE_CAST(&LEDSEQ_Init));
}
Exemple #3
0
/*${AOs::USBTask_ctor} .....................................................*/
void USBTask_ctor(void) {
    USBTask* me = &l_usbtask;

    QActive_ctor( &me->super, Q_STATE_CAST( &USBTask_initial ));
    //QTimeEvt_ctor( &me->blinkEvt, BLINK_SIG );
    //QTimeEvt_ctor( &me->rollEvt, ROLL_SIG );
}
Exemple #4
0
/*${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 );
}
/*..........................................................................*/
void ModIo2Mgr_ctor(void) {
    ModIo2Mgr *me = &l_modIo2Mgr;

    QActive_ctor(&me->super, (QStateHandler)&ModIo2Mgr_initial);

    me->aoExampleData = 0;
}
Exemple #6
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);
}
Exemple #7
0
/**
 * constructor
 **/
void MenuAO_ctor(void)
{
    MenuAO* me = &l_MenuAO;
    QActive_ctor(&me->super, (QStateHandler)&MenuAO_initial);

    me->brewStrength = Medium;
    me->waitingForSetTime = false;
}
Exemple #8
0
void ui_ctor(void)
{
	QActive_ctor((QActive*)(&ui), (QStateHandler)(&uiInitial));
	ui.ti = INVALIDTI;
	ui.cal = get_calibration();
	ui.deferredSignal = 0;
	ui.deferredParam = 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);
}
Exemple #10
0
/*..........................................................................*/
void Philo_ctor(void) {                    /* instantiate all Philo objects */
    uint8_t n;
    Philo *me;
    for (n = 0; n < N_PHILO; ++n) {
        me = &l_philo[n];
        QActive_ctor(&me->super, (QStateHandler)&Philo_initial);
        QTimeEvt_ctorX(&me->timeEvt, &me->super, TIMEOUT_SIG, 0U);
    }
}
Exemple #11
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);
}
Exemple #12
0
/*..........................................................................*/
void Oper_ctor(uint8_t min, uint8_t max, uint8_t every) {
    Oper *me = &AO_Oper;

    QActive_ctor(&me->super, (QStateHandler)&Oper_initial);
    me->bomb_min  = min;
    me->bomb_max  = max;
    me->bomb_prev = min;
    me->interval  = every;
}
/* @(/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);
    }
}
Exemple #14
0
void twi_ctor(void)
{
	SERIALSTR("twi_ctor()\r\n");

	QActive_ctor((QActive*)(&twi), (QStateHandler)&twiInitial);
	twi_init();
	twi.requests[0] = 0;
	twi.requests[1] = 0;
	twi.requestIndex = 0;
	twi.ready = 0;
}
Exemple #15
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)
    );
}
Exemple #16
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;
}
Exemple #17
0
void buttons_ctor(void)
{
	QActive_ctor((QActive*)(&buttons), (QStateHandler)buttons_initial);

	buttons.up_counter = 0;

	SERIALSTR("(b1)");

	QHsm_ctor((QHsm*)(&(buttons.button1)), (QStateHandler)button_initial);
	buttons.button1.press_signal = BUTTON_1_PRESS_SIGNAL;
	buttons.button1.long_press_signal = BUTTON_1_LONG_PRESS_SIGNAL;
	buttons.button1.repeat_signal = BUTTON_1_REPEAT_SIGNAL;
	buttons.button1.release_signal = BUTTON_1_RELEASE_SIGNAL;
	QHsm_init((QHsm*)(&(buttons.button1)));

	QHsm_ctor((QHsm*)(&(buttons.button2)), (QStateHandler)button_initial);
	buttons.button2.press_signal = BUTTON_2_PRESS_SIGNAL;
	buttons.button2.long_press_signal = BUTTON_2_LONG_PRESS_SIGNAL;
	buttons.button2.repeat_signal = BUTTON_2_REPEAT_SIGNAL;
	buttons.button2.release_signal = BUTTON_2_RELEASE_SIGNAL;
	QHsm_init((QHsm*)(&(buttons.button2)));

	QHsm_ctor((QHsm*)(&(buttons.button3)), (QStateHandler)button_initial);
	buttons.button3.press_signal = BUTTON_3_PRESS_SIGNAL;
	buttons.button3.long_press_signal = BUTTON_3_LONG_PRESS_SIGNAL;
	buttons.button3.repeat_signal = BUTTON_3_REPEAT_SIGNAL;
	buttons.button3.release_signal = BUTTON_3_RELEASE_SIGNAL;
	QHsm_init((QHsm*)(&(buttons.button3)));

	QHsm_ctor((QHsm*)(&(buttons.button4)), (QStateHandler)button_initial);
	buttons.button4.press_signal = BUTTON_4_PRESS_SIGNAL;
	buttons.button4.long_press_signal = BUTTON_4_LONG_PRESS_SIGNAL;
	buttons.button4.repeat_signal = BUTTON_4_REPEAT_SIGNAL;
	buttons.button4.release_signal = BUTTON_4_RELEASE_SIGNAL;
	QHsm_init((QHsm*)(&(buttons.button4)));

}
Exemple #18
0
/*..........................................................................*/
void Segment_ctor(void)
{
	Segment *me = &l_segment;
	QActive_ctor(&me->super, (QStateHandler)(Segment_initial));
}
Exemple #19
0
/*..........................................................................*/
void Ped_ctor(void) {
    QActive_ctor((QActive *)&AO_Ped, (QStateHandler)&Ped_initial);
}
Exemple #20
0
/* @(/1/37) ................................................................*/
void QPrinter_ctor(void) {
    QPrinter *me = &l_QPrinter;
    QActive_ctor(&me->super, Q_STATE_CAST(&QPrinter_initial));
}
Exemple #21
0
/*${AOs::Blinky_ctor} ......................................................*/
static void Blinky_ctor(void) {
    Blinky * const me = &AO_Blinky;
    QActive_ctor(&me->super, Q_STATE_CAST(&Blinky_initial));
}
/*..........................................................................*/
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);
}
Exemple #23
0
/*..........................................................................*/
void Sensor_ctor(void) {
    QActive_ctor((QActive *)&AO_Sensor, (QStateHandler)&Sensor_initial);
}
Exemple #24
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);
}
Exemple #25
0
void Ble_ctor(void) {
    Ble* const me = &l_Ble;
    QActive_ctor(&me->super, Q_STATE_CAST(&Ble_initial));
}
Exemple #26
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);
}
Exemple #27
0
/*--------------------------------------------------------------------------*/
void Cruncher_ctor(void) {
    QActive_ctor(&AO_Cruncher.super, Q_STATE_CAST(&Cruncher_initial));
}
Exemple #28
0
/*..........................................................................*/
void TServer_ctor(void) {
    QActive_ctor((QActive *)&AO_TServer, (QStateHandler)&TServer_initial);
}
Exemple #29
0
/* @(/1/38) ................................................................*/
void QIR_ctor(void) {
    QIR *me = &l_QIR;
    QActive_ctor(&me->super, Q_STATE_CAST(&QIR_initial));

    //QTimeEvt_ctor(&me->m_Timer, Q_TIMEOUT_SIG);
}
/*${components::aoGrinder_constructor} .....................................*/
void aoGrinder_constructor(void) {
    QActive_ctor(&AO_Grinder.super, Q_STATE_CAST(&aoGrinder_initial));
}