qpc/doxygen/snippets/qs_sigDic.c

20 lines
627 B
C
Raw Normal View History

2013-09-30 12:54:30 -04:00
QState Table_initial(Table * const me, QEvt const *) {
2012-08-14 18:07:04 -04:00
uint8_t n;
2015-04-28 13:45:35 -04:00
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 */
2012-08-14 18:07:04 -04:00
2013-09-30 12:54:30 -04:00
QS_FUN_DICTIONARY(&Table_serving);
2012-08-14 18:07:04 -04:00
2015-12-24 14:33:20 -05:00
QActive_subscribe(&me->super, HUNGRY_SIG);
QActive_subscribe(&me->super, DONE_SIG);
QActive_subscribe(&me->super, TERMINATE_SIG);
2012-08-14 18:07:04 -04:00
2015-12-24 14:33:20 -05:00
for (n = 0U; n < N; ++n) {
2012-08-14 18:07:04 -04:00
me->fork[n] = FREE;
2015-12-24 14:33:20 -05:00
me->isHungry[n] = 0U;
2012-08-14 18:07:04 -04:00
}
return Q_TRAN(&Table_serving);
}