Simple "Blinky" example for the QP active object framework
Fork of qp_dpp by
main.cpp@7:80bbc7a6c78c, 2014-10-12 (annotated)
- Committer:
- QL
- Date:
- Sun Oct 12 18:56:53 2014 +0000
- Revision:
- 7:80bbc7a6c78c
- Parent:
- 4:6189d844a1a2
Simple "Blinky" example for the QP active object framework
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
QL | 0:efb9ac8d1a88 | 1 | #include "qp_port.h" |
QL | 7:80bbc7a6c78c | 2 | #include "blinky.h" |
QL | 0:efb9ac8d1a88 | 3 | #include "bsp.h" |
QL | 0:efb9ac8d1a88 | 4 | |
QL | 0:efb9ac8d1a88 | 5 | //............................................................................ |
QL | 7:80bbc7a6c78c | 6 | int main(void) { |
QL | 7:80bbc7a6c78c | 7 | static QP::QEvt const *blinkyQueueSto[5]; |
QL | 7:80bbc7a6c78c | 8 | //static QP::QSubscrList subscrSto[MAX_PUB_SIG]; |
QL | 7:80bbc7a6c78c | 9 | //static QF_MPOOL_EL(QP::QEvt) smlPoolSto[10]; // small pool |
QL | 4:6189d844a1a2 | 10 | |
QL | 4:6189d844a1a2 | 11 | QP::QF::init(); // initialize the framework and the underlying RT kernel |
QL | 3:81ceb3127876 | 12 | |
QL | 0:efb9ac8d1a88 | 13 | BSP_init(); // initialize the BSP |
QL | 7:80bbc7a6c78c | 14 | |
QL | 7:80bbc7a6c78c | 15 | //QP::QF::psInit(&subscrSto[0], Q_DIM(subscrSto)); // init publish-subscribe |
QL | 3:81ceb3127876 | 16 | |
QL | 0:efb9ac8d1a88 | 17 | // initialize event pools... |
QL | 7:80bbc7a6c78c | 18 | //QP::QF::poolInit(&smlPoolSto[0], sizeof(smlPoolSto), |
QL | 7:80bbc7a6c78c | 19 | // sizeof(smlPoolSto[0])); |
QL | 0:efb9ac8d1a88 | 20 | |
QL | 0:efb9ac8d1a88 | 21 | // start the active objects... |
QL | 7:80bbc7a6c78c | 22 | AO_Blinky->start(1U, |
QL | 7:80bbc7a6c78c | 23 | &blinkyQueueSto[0], Q_DIM(blinkyQueueSto), |
QL | 4:6189d844a1a2 | 24 | static_cast<void *>(0), 0U); |
QL | 4:6189d844a1a2 | 25 | |
QL | 4:6189d844a1a2 | 26 | return QP::QF::run(); // run the QF application |
QL | 4:6189d844a1a2 | 27 | } |