Skip to content

Commit 9c944f0

Browse files
author
Amanda Butler
authored
Move example in EventFlags.md
Move example to external repo, as in PR #803
1 parent d8c54d6 commit 9c944f0

File tree

1 file changed

+2
-31
lines changed

1 file changed

+2
-31
lines changed

docs/api/rtos/EventFlags.md

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,10 @@
44

55
The EventFlags class provides a mechanism for setting and waiting for specific conditions. It provides a generic way of notifying other threads about conditions or events. You can think of each instance of the EventFlags class as an event channel. There are 31 different flags available for each event.
66

7-
### EventFlag class reference
7+
### EventFlags class reference
88

99
[![View code](https://www.mbed.com/embed/?type=library)](https://os.mbed.com/docs/v5.10/mbed-os-api-doxy/classrtos_1_1_event_flags.html)
1010

1111
### EventFlags example
1212

13-
Below is an example of EventFlags usage, where one thread is generating events every 1s, and the second thread is waiting for the events and executing some action.
14-
15-
<span class="images">![](https://s3-us-west-2.amazonaws.com/mbed-os-docs-images//eventflags_usage.png)</span>
16-
17-
```
18-
#include "mbed.h"
19-
20-
EventFlags event;
21-
22-
void worker_f()
23-
{
24-
while (true) {
25-
event.wait_all(0x1);
26-
27-
printf("Got signal!\r\n");
28-
}
29-
}
30-
31-
int main()
32-
{
33-
Thread worker;
34-
35-
worker.start(callback(worker_f));
36-
37-
while (true) {
38-
wait(1);
39-
event.set(0x1);
40-
}
41-
}
42-
```
13+
[![View Example](https://www.mbed.com/embed/?url=https://github.com/ARMmbed/mbed-os-examples-docs_only/EventFlags)](https://github.com/ARMmbed/mbed-os-examples-docs_only/blob/master/EventFlags/main.cpp)

0 commit comments

Comments
 (0)