This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ARM (ARTX) wait_flags ,event_flags ,clear_flags value what? how? why?

In Examples or help

void os_evt_set (U16 event_flags,
OS_TID task);
#include <ARTX.h>

void task1 (void) __task {
.
.
os_evt_set (0x0003, tsk2);
.
.
}

#include <ARTX.h>

void task1 (void) __task {
OS_RESULT result;

result = os_evt_wait_or (0x0003, 500);
if (result == OS_R_TMO) {
printf("Event wait timeout.\n");
}
else {
printf("Event received.\n");
}
.
.
}


I see C:\Keil\ARM\ARTX\Examples\Traffic project

but how to define value of flags?
os_evt_set (0x0002, t_command);
what why ? 0x0002?

os_evt_clr (0x0003, t_command);
what 0x0003 ?


--------------------------------------------
void keyread (void) __task {
while (1) { /* endless loop */
if ((IOPIN0 & key) == 0) { /* if key pressed */
os_evt_set (0x0010, t_lights); /* send signal to task lights */
}
os_dly_wait (5); /* wait for timeout: 5 ticks */
}
}
---------------------
os_evt_set (0x0010, t_lights)
0x0010 why?

Table of event_flags,wait_flags?

thank you

0