Everything

set_flg

iset_flg

Outline
Set eventflag.
C format
 ER      set_flg (ID flgid, FLGPTN setptn);
 ER      iset_flg (ID flgid, FLGPTN setptn);
Parameter(s)
I/O
Parameter
Description
I
 ID      flgid;
ID number of the eventflag.
I
 FLGPTN  setptn;
Bit pattern to set.

Explanation
These service calls set the result of ORing the bit pattern of the eventflag specified by parameter flgid and the bit pattern specified by parameter setptn as the bit pattern of the target eventflag.
After that, these service calls evaluate whether the wait condition of the tasks in the wait queue is satisfied. This evaluation is done in order of the wait queue. If the wait condition is satisfied, the relevant task is unlinked from the wait queue at the same time as bit pattern setting processing. As a result, the relevant task is moved from the WAITING state (WAITING state for an eventflag) to the READY state, or from the WAITING-SUSPENDED state to the SUSPENDED state. At this time, the bit pattern of the target event flag is cleared to 0 and this service call finishes processing if the TA_CLR attribute is specified for the target eventflag.
Return value
Macro
Value
Description
E_OK
0
Normal completion.
E_ID
-18
Invalid ID number.
- flgid < 0
- flgid > VTMAX_FLG
E_CTX
-25
Context error.
- This service call was issued in the CPU locked state.
- The iset_flg was issued from task.
- The set_flg was issued from non-task.
- This service call was issued in the status "PSW.IPL > kernel interrupt mask level".
E_MACV
-26
Memory access violation. (only for set_flg)
- Stack pointer points out of user stack for invoking task.
E_NOEXS
-42
Non-existent object.
- The eventflag specified by flgid does not exist.