qpc/doxygen/snippets/qs_sigDic.c

20 lines
571 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;
2013-09-30 12:54:30 -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
2013-09-30 12:54:30 -04:00
subscribe(HUNGRY_SIG);
subscribe(DONE_SIG);
subscribe(TERMINATE_SIG);
2012-08-14 18:07:04 -04:00
for (n = 0; n < N; ++n) {
me->fork[n] = FREE;
me->isHungry[n] = 0;
}
return Q_TRAN(&Table_serving);
}