/*..........................................................................*/ 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)); }
/*${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 ); }
/*${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; }
/*${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); }
/** * constructor **/ void MenuAO_ctor(void) { MenuAO* me = &l_MenuAO; QActive_ctor(&me->super, (QStateHandler)&MenuAO_initial); me->brewStrength = Medium; me->waitingForSetTime = false; }
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); }
/*..........................................................................*/ 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); } }
/* @(/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); }
/*..........................................................................*/ 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); } }
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; }
/*${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 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 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))); }
/*..........................................................................*/ void Segment_ctor(void) { Segment *me = &l_segment; QActive_ctor(&me->super, (QStateHandler)(Segment_initial)); }
/*..........................................................................*/ void Ped_ctor(void) { QActive_ctor((QActive *)&AO_Ped, (QStateHandler)&Ped_initial); }
/* @(/1/37) ................................................................*/ void QPrinter_ctor(void) { QPrinter *me = &l_QPrinter; QActive_ctor(&me->super, Q_STATE_CAST(&QPrinter_initial)); }
/*${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); }
/*..........................................................................*/ void Sensor_ctor(void) { QActive_ctor((QActive *)&AO_Sensor, (QStateHandler)&Sensor_initial); }
/* @(/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); }
void Ble_ctor(void) { Ble* const me = &l_Ble; QActive_ctor(&me->super, Q_STATE_CAST(&Ble_initial)); }
/* @(/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); }
/*--------------------------------------------------------------------------*/ void Cruncher_ctor(void) { QActive_ctor(&AO_Cruncher.super, Q_STATE_CAST(&Cruncher_initial)); }
/*..........................................................................*/ void TServer_ctor(void) { QActive_ctor((QActive *)&AO_TServer, (QStateHandler)&TServer_initial); }
/* @(/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)); }