#include #if (USE_XF_IDF_STM32_EVENT_QUEUE_CLASS != 0) #include #include "eventqueue.h" // TODO done: Implement code for XFEventQueue class XFEventQueue::XFEventQueue(){ } XFEventQueue::~XFEventQueue(){ } bool XFEventQueue::empty() const { return queue_.empty(); } bool XFEventQueue::push(const XFEvent *pEvent, bool fromISR) { if(!fromISR) mutex_.lock(); queue_.push(pEvent); if(!fromISR) mutex_.unlock(); return true; } const XFEvent* XFEventQueue::front() { return queue_.front(); } void XFEventQueue::pop() { mutex_.lock(); queue_.pop(); mutex_.unlock(); } bool XFEventQueue::pend() { // Method cannot be used in an IDF! Waiting within // this method would block the whole XF return false; } #endif // USE_XF_IDF_STM32_EVENT_QUEUE_CLASS