#ifndef STA_RTOS_QUEUE_TPP #define STA_RTOS_QUEUE_TPP #ifndef STA_RTOS_QUEUE_HPP # error "Internal header. Use instead." #endif // !STA_RTOS_QUEUE_HPP #include namespace sta { template RtosQueue::RtosQueue(osMessageQueueId_t * handle) : handle_{handle} { STA_ASSERT(handle != nullptr); } template bool RtosQueue::put(const Message & msg, uint32_t timeout /* = osWaitForever */) { return (osOK == osMessageQueuePut(*handle_, &msg, 0, timeout)); } template bool RtosQueue::get(Message * outMsg, uint32_t timeout /* = osWaitForever */) { uint8_t prio; return (osOK == osMessageQueueGet(*handle_, outMsg, &prio, timeout)); } template uint32 RtosQueue::available() const { return osMessageQueueGetCount(*handle_); } } // namespace sta #endif // STA_RTOS_QUEUE_TPP