Download RI78V4 Real-Time Operating System User`s Manual: Coding

Transcript
RI78V4 V2.00.00
CHAPTER 12 SERVICE CALLS
pol_sem
Outline
Acquire semaphore resource (polling).
C format
ER
pol_sem ( ID semid );
Assembly format
MOV
CALL
A, #semid
!!_pol_sem
Parameter(s)
I/O
Parameter
I
ID
semid;
Description
ID number of the semaphore from which resource is acquired.
Explanation
This service call acquires a resource from the semaphore specified by parameter semid (subtracts 0x1 from the
semaphore counter).
If a resource could not be acquired from the target semaphore (semaphore counter is set to 0x0) when this service call
is issued, the counter manipulation processing is not performed but "E_TMOUT" is returned.
Return value
Macro
E_OK
E_TMOUT
Value
0
-50
R20UT3375EJ0100 Rev.1.00
2015.03.25
Description
Normal completion.
Polling failure.
Page 190 of 309