Hi Ti:
Bool Semaphore_pend(Semaphore_Object *sem, UInt32 timeout) ,what is the time unit of timeout? milliscond?
I didn't found the related information;
Thanks
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi Ti:
Bool Semaphore_pend(Semaphore_Object *sem, UInt32 timeout) ,what is the time unit of timeout? milliscond?
I didn't found the related information;
Thanks
Hello Yao,
See the following from the SYS/BIOS documentation, Semaphores are under TI-RTOS Kernel Runtime APIs and Configuration (cdoc) --> All Modules:
Semaphore_pend()
Wait for a semaphore
Bool Semaphore_pend(Semaphore_Handle handle, UInt32 timeout);
ARGUMENTS
handle — handle of a previously-created Semaphore instance object
timeout — return after this many system time units
RETURNS
TRUE if successful, FALSE if timeout
DETAILS
If the semaphore count is greater than zero (available), this function decrements the count and returns TRUE. If the semaphore count is zero (unavailable), this function suspends execution of the current task until post() is called or the timeout expires.
A timeout value of BIOS_WAIT_FOREVER causes the task to wait indefinitely for its semaphore to be posted.
A timeout value of BIOS_NO_WAIT causes Semaphore_pend to return immediately.
Also this E2E thread for an explanation of System Time Unit: https://e2e.ti.com/support/legacy_forums/embedded/tirtos/f/355/p/193525/691979#691979