Update docs and fix bugs (#149)
Improved the docs for the 3 main Tactility projects. I also fixed some inaccuracies and bugs in certain APIs as I went through the code.
This commit is contained in:
committed by
GitHub
parent
ff4287e2ce
commit
415096c3b2
@@ -13,8 +13,6 @@
|
||||
|
||||
namespace tt {
|
||||
|
||||
class ScopedMutexUsage;
|
||||
|
||||
/**
|
||||
* Wrapper for FreeRTOS xSemaphoreCreateMutex and xSemaphoreCreateRecursiveMutex
|
||||
* Can be used in IRQ mode (within ISR context)
|
||||
@@ -38,56 +36,64 @@ public:
|
||||
explicit Mutex(Type type = TypeNormal);
|
||||
~Mutex() override;
|
||||
|
||||
TtStatus acquire(uint32_t timeoutTicks) const;
|
||||
/** Attempt to lock the mutex. Blocks until timeout passes or lock is acquired.
|
||||
* @param[in] timeout
|
||||
* @return status result
|
||||
*/
|
||||
TtStatus acquire(TickType_t timeout) const;
|
||||
|
||||
/** Attempt to unlock the mutex.
|
||||
* @return status result
|
||||
*/
|
||||
TtStatus release() const;
|
||||
|
||||
bool lock(uint32_t timeoutTicks) const override { return acquire(timeoutTicks) == TtStatusOk; }
|
||||
/** Attempt to lock the mutex. Blocks until timeout passes or lock is acquired.
|
||||
* @param[in] timeout
|
||||
* @return success result
|
||||
*/
|
||||
bool lock(TickType_t timeout) const override { return acquire(timeout) == TtStatusOk; }
|
||||
|
||||
/** Attempt to unlock the mutex.
|
||||
* @return success result
|
||||
*/
|
||||
bool unlock() const override { return release() == TtStatusOk; }
|
||||
|
||||
/** @return the owner of the thread */
|
||||
ThreadId getOwner() const;
|
||||
};
|
||||
|
||||
/** Allocate Mutex
|
||||
*
|
||||
* @param[in] type The mutex type
|
||||
*
|
||||
* @return pointer to Mutex instance
|
||||
* @param[in] type The mutex type
|
||||
* @return pointer to Mutex instance
|
||||
*/
|
||||
|
||||
[[deprecated("use class")]]
|
||||
Mutex* tt_mutex_alloc(Mutex::Type type);
|
||||
|
||||
/** Free Mutex
|
||||
*
|
||||
* @param mutex The Mutex instance
|
||||
* @param[in] mutex The Mutex instance
|
||||
*/
|
||||
[[deprecated("use class")]]
|
||||
void tt_mutex_free(Mutex* mutex);
|
||||
|
||||
/** Acquire mutex
|
||||
*
|
||||
* @param mutex The Mutex instance
|
||||
* @param[in] timeout The timeout
|
||||
*
|
||||
* @return The status.
|
||||
* @param[in] mutex
|
||||
* @param[in] timeout
|
||||
* @return the status result
|
||||
*/
|
||||
[[deprecated("use class")]]
|
||||
TtStatus tt_mutex_acquire(Mutex* mutex, uint32_t timeout);
|
||||
TtStatus tt_mutex_acquire(Mutex* mutex, TickType_t timeout);
|
||||
|
||||
/** Release mutex
|
||||
*
|
||||
* @param mutex The Mutex instance
|
||||
*
|
||||
* @return The status.
|
||||
* @param[in] mutex The Mutex instance
|
||||
* @return the status result
|
||||
*/
|
||||
[[deprecated("use class")]]
|
||||
TtStatus tt_mutex_release(Mutex* mutex);
|
||||
|
||||
/** Get mutex owner thread id
|
||||
*
|
||||
* @param mutex The Mutex instance
|
||||
*
|
||||
* @return The thread identifier.
|
||||
* @param[in] mutex The Mutex instance
|
||||
* @return The thread identifier.
|
||||
*/
|
||||
[[deprecated("use class")]]
|
||||
ThreadId tt_mutex_get_owner(Mutex* mutex);
|
||||
|
||||
Reference in New Issue
Block a user