qpc/doxygen/snippets/qs_sigDic.c
Quantum Leaps f165ec4842 5.6.0-beta
2015-12-24 14:33:20 -05:00

20 lines
627 B
C

QState Table_initial(Table * const me, QEvt const *) {
uint8_t n;
QS_SIG_DICTIONARY(HUNGRY_SIG, me); /* output signal dictionary QS record */
QS_SIG_DICTIONARY(DONE_SIG, me); /* output signal dictionary QS record */
QS_SIG_DICTIONARY(EAT_SIG, 0); /* output signal dictionary QS record */
QS_FUN_DICTIONARY(&Table_serving);
QActive_subscribe(&me->super, HUNGRY_SIG);
QActive_subscribe(&me->super, DONE_SIG);
QActive_subscribe(&me->super, TERMINATE_SIG);
for (n = 0U; n < N; ++n) {
me->fork[n] = FREE;
me->isHungry[n] = 0U;
}
return Q_TRAN(&Table_serving);
}