Leon Wehmeier / Mbed OS fiasco_max32630

Dependencies:   SoftSerial MAX14690 Buffer

Fork of rtos_threading_with_callback by mbed_example

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers txQueue.cpp Source File

txQueue.cpp

00001 #include "txQueue.h"
00002 #include "linkLayer.h"
00003 #include <vector>
00004 
00005 
00006 bool TxQueue::addPacket(linkPacket *lp)
00007 {
00008     q.put(lp, osWaitForever, lp->priority);
00009     return true;
00010 }
00011 linkPacket* TxQueue::getNext()
00012 {
00013     osEvent evt = q.get(osWaitForever);
00014     //if (evt.status == osEventMessage)
00015     //printf("%u", evt.status);
00016     return (linkPacket*)evt.value.p;; //TODO; error handling. https://os.mbed.com/docs/v5.7/mbed-os-api-doxy/classrtos_1_1_queue.html
00017 }