mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/rtos2-utils.git
synced 2025-06-10 18:15:59 +00:00
Change class prefix from RTOS to Rtos
This commit is contained in:
parent
75f939436e
commit
57d0dd0bcd
@ -17,13 +17,13 @@ namespace sta
|
||||
*
|
||||
* @ingroup STA_RTOS_API
|
||||
*/
|
||||
class RTOSMutex : public Mutex
|
||||
class RtosMutex : public Mutex
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @param handle CMSIS RTOS2 mutex
|
||||
*/
|
||||
RTOSMutex(osMutexId_t * handle);
|
||||
RtosMutex(osMutexId_t * handle);
|
||||
|
||||
void acquire() override;
|
||||
void release() override;
|
||||
|
@ -20,7 +20,7 @@ namespace sta
|
||||
* @ingroup STA_RTOS_API
|
||||
*/
|
||||
template <typename T>
|
||||
class RTOSQueue
|
||||
class RtosQueue
|
||||
{
|
||||
public:
|
||||
using Message = T; /**< Queue message type */
|
||||
@ -29,7 +29,7 @@ namespace sta
|
||||
/**
|
||||
* @param handle CMSIS RTOS2 queue handle
|
||||
*/
|
||||
RTOSQueue(osMessageQueueId_t * handle);
|
||||
RtosQueue(osMessageQueueId_t * handle);
|
||||
|
||||
/**
|
||||
* @brief Place message in queue.
|
||||
|
@ -11,27 +11,27 @@
|
||||
namespace sta
|
||||
{
|
||||
template <typename T>
|
||||
RTOSQueue<T>::RTOSQueue(osMessageQueueId_t * handle)
|
||||
RtosQueue<T>::RtosQueue(osMessageQueueId_t * handle)
|
||||
: handle_{handle}
|
||||
{
|
||||
STA_ASSERT(handle != nullptr);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool RTOSQueue<T>::put(const Message & msg, uint32_t timeout /* = osWaitForever */)
|
||||
bool RtosQueue<T>::put(const Message & msg, uint32_t timeout /* = osWaitForever */)
|
||||
{
|
||||
return (osOK == osMessageQueuePut(*handle_, &msg, 0, timeout));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool RTOSQueue<T>::get(Message * outMsg, uint32_t timeout /* = osWaitForever */)
|
||||
bool RtosQueue<T>::get(Message * outMsg, uint32_t timeout /* = osWaitForever */)
|
||||
{
|
||||
uint8_t prio;
|
||||
return (osOK == osMessageQueueGet(*handle_, outMsg, &prio, timeout));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
uint32 RTOSQueue<T>::available() const
|
||||
uint32 RtosQueue<T>::available() const
|
||||
{
|
||||
return osMessageQueueGetCount(*handle_);
|
||||
}
|
||||
|
@ -17,13 +17,13 @@ namespace sta
|
||||
*
|
||||
* @ingroup STA_RTOS_API
|
||||
*/
|
||||
class RTOSSignal : public Signal
|
||||
class RtosSignal : public Signal
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @param semaphore CMSIS RTOS2 semaphore
|
||||
*/
|
||||
RTOSSignal(osSemaphoreId_t * semaphore);
|
||||
RtosSignal(osSemaphoreId_t * semaphore);
|
||||
|
||||
void notify() override;
|
||||
bool peek() override;
|
||||
|
@ -3,16 +3,16 @@
|
||||
|
||||
namespace sta
|
||||
{
|
||||
RTOSMutex::RTOSMutex(osMutexId_t * handle)
|
||||
RtosMutex::RtosMutex(osMutexId_t * handle)
|
||||
: handle_{handle}
|
||||
{}
|
||||
|
||||
void RTOSMutex::acquire()
|
||||
void RtosMutex::acquire()
|
||||
{
|
||||
osMutexAcquire(*handle_, osWaitForever);
|
||||
}
|
||||
|
||||
void RTOSMutex::release()
|
||||
void RtosMutex::release()
|
||||
{
|
||||
osMutexRelease(*handle_);
|
||||
}
|
||||
|
@ -3,26 +3,26 @@
|
||||
|
||||
namespace sta
|
||||
{
|
||||
RTOSSignal::RTOSSignal(osSemaphoreId_t * semaphore)
|
||||
RtosSignal::RtosSignal(osSemaphoreId_t * semaphore)
|
||||
: semaphore_{semaphore}
|
||||
{}
|
||||
|
||||
void RTOSSignal::notify()
|
||||
void RtosSignal::notify()
|
||||
{
|
||||
osSemaphoreRelease(*semaphore_);
|
||||
}
|
||||
|
||||
bool RTOSSignal::peek()
|
||||
bool RtosSignal::peek()
|
||||
{
|
||||
return (osSemaphoreGetCount(*semaphore_) != 0);
|
||||
}
|
||||
|
||||
bool RTOSSignal::test()
|
||||
bool RtosSignal::test()
|
||||
{
|
||||
return (osSemaphoreAcquire(*semaphore_, 0) == osOK);
|
||||
}
|
||||
|
||||
void RTOSSignal::wait()
|
||||
void RtosSignal::wait()
|
||||
{
|
||||
osSemaphoreAcquire(*semaphore_, osWaitForever);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user