qpcpp/doxygen/snippets/qf_start.cpp
Quantum Leaps 890c8e7d8c 5.1.1
2013-10-10 20:01:51 -04:00

17 lines
686 B
C++

static Philo l_philo[N]; // N Philosopher active objects
static QEvt const *l_philQueueSto[N][N]; // storage for Philo event queues
static int l_philoStk[N][256]; // stacks for the Philosopher active objects
main() {
. . .
for (n = 0; n < N; ++n) {
TableEvt ie; // initialization event for the Philosopher HSM
ie.philNum = n;
l_philo[n].start((uint8_t)(n*10 + 1), // priority
l_philoQueueSto[n], Q_DIM(l_philoQueueSto[n]), // queue
l_philoStk[n], sizeof(l_philoStk[n]), // uC/OS-II stack
&ie); // initialization event
}
. . .
}