qpcpp/doxygen/snippets/qxk_start.cpp

35 lines
1.3 KiB
C++
Raw Normal View History

2020-07-18 17:58:58 -04:00
#include "qpcpp.hpp"
. . .
//............................................................................
2015-12-31 14:56:37 -05:00
int main() {
static QP::QEvt const *tableQueueSto[N_PHILO];
static QP::QEvt const *philoQueueSto[N_PHILO][N_PHILO];
2020-07-18 17:58:58 -04:00
. . .
// stacks and queues for the extended test threads
static QP::QEvt const *test1QueueSto[5];
static uint64_t test1StackSto[64];
static QP::QEvt const *test2QueueSto[5];
static uint64_t test2StackSto[64];
2015-12-31 14:56:37 -05:00
QP::QF::init(); // initialize the framework and the underlying RT kernel
2020-07-18 17:58:58 -04:00
BSP::init(); // initialize the BSP
. . .
// start the extended Test1 thread
DPP::XT_Test1->start( // <== start an extended thread
1U, // QP prio of the thread
test1QueueSto, // event queue storage
Q_DIM(test1QueueSto), // queue length [events]
test1StackSto, // stack storage
sizeof(test1StackSto)); // stack size [bytes]
2015-12-31 14:56:37 -05:00
. . .
2020-07-18 17:58:58 -04:00
DPP::AO_Table->start( // <== start a basic thread (AO)
N_PHILO + 7U, // QP priority of the AO
tableQueueSto, // event queue storage
Q_DIM(tableQueueSto), // queue length [events]
nullptr, 0U); // no stack storage
2015-12-31 14:56:37 -05:00
return QP::QF::run(); // run the QF application
}