Rework. Improve doxygen documentation

This commit is contained in:
Henrik Stickann
2022-05-08 03:15:08 +02:00
parent 0fe1be1863
commit b09de25c62
14 changed files with 340 additions and 117 deletions

View File

@@ -0,0 +1,41 @@
#ifndef STA_RTOS2_QUEUE_TPP
#define STA_RTOS2_QUEUE_TPP
#ifndef STA_RTOS2_QUEUE_HPP
# error "Internal header. Use <sta/rtos2/queue.hpp> instead."
#endif // !STA_RTOS2_QUEUE_HPP
#include <sta/assert.hpp>
namespace sta
{
template <typename T>
Rtos2Queue<T>::Rtos2Queue(osMessageQueueId_t * handle)
: handle_{handle}
{
STA_ASSERT(handle != nullptr);
}
template <typename T>
bool Rtos2Queue<T>::put(const Message & msg, uint32_t timeout /* = osWaitForever */)
{
return (osOK == osMessageQueuePut(*handle_, &msg, 0, timeout));
}
template <typename T>
bool Rtos2Queue<T>::get(Message * outMsg, uint32_t timeout /* = osWaitForever */)
{
uint8_t prio;
return (osOK == osMessageQueueGet(*handle_, outMsg, &prio, timeout));
}
template <typename T>
uint32 Rtos2Queue<T>::available() const
{
return osMessageQueueGetCount(*handle_);
}
} // namespace sta
#endif // STA_RTOS2_QUEUE_TPP