From efc28a2968f23048311d8ed24f5b1df1e64ae36b Mon Sep 17 00:00:00 2001 From: Bartek Szatkowski Date: Tue, 11 Jul 2017 14:58:55 +0100 Subject: [PATCH] RTOS: Mutex: Improve API docs --- rtos/Mutex.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/rtos/Mutex.h b/rtos/Mutex.h index 8f5c0e2adb..4f1ed8a6aa 100644 --- a/rtos/Mutex.h +++ b/rtos/Mutex.h @@ -53,17 +53,26 @@ public: /** Wait until a Mutex becomes available. @param millisec timeout value or 0 in case of no time-out. (default: osWaitForever) - @return status code that indicates the execution status of the function. + @return status code that indicates the execution status of the function: + @a osOK the mutex has been obtained. + @a osErrorTimeout the mutex could not be obtained in the given time. + @a osErrorParameter internal error. + @a osErrorResource the mutex could not be obtained when no timeout was specified. + @a osErrorISR this function cannot be called from the interrupt service routine. */ osStatus lock(uint32_t millisec=osWaitForever); /** Try to lock the mutex, and return immediately - @return true if the mutex was acquired, false otherwise. + @return true if the mutex was acquired, false otherwise. */ bool trylock(); /** Unlock the mutex that has previously been locked by the same thread - @return status code that indicates the execution status of the function. + @return status code that indicates the execution status of the function: + @a osOK the mutex has been released. + @a osErrorParameter internal error. + @a osErrorResource the mutex was not locked or the current thread wasn't the owner. + @a osErrorISR this function cannot be called from the interrupt service routine. */ osStatus unlock();