@@ -33,9 +33,9 @@ namespace rtos {
33
33
/* * \addtogroup rtos */
34
34
/* * @{*/
35
35
36
- /* * The EventFlags class is used to signal to whom it may concern about an event has occured .
36
+ /* * The EventFlags class is used to signal or wait for an arbitrary event or events .
37
37
@note
38
- EventFlags support 31 flags so the MSB flag is ignored, it is used to return error code (osFlagsError)
38
+ EventFlags support 31 flags so the MSB flag is ignored, it is used to return an error code (@a osFlagsError)
39
39
@note
40
40
Memory considerations: The EventFlags control structures will be created on current thread's stack, both for the mbed OS
41
41
and underlying RTOS objects (static or dynamic RTOS memory pools are not being used).
@@ -52,35 +52,43 @@ class EventFlags : private mbed::NonCopyable<EventFlags> {
52
52
EventFlags (const char *name);
53
53
54
54
/* * Set the specified Event Flags.
55
- @param flags specifies the flags that shall be set. (default: 0x7fffffff)
56
- @return event flags after setting or error code if highest bit set (osFlagsError).
55
+ @param flags specifies the flags that shall be set.
56
+ @return event flags after setting or error code if highest bit set (@a osFlagsError).
57
57
*/
58
- uint32_t set (uint32_t flags = 0x7fffffff );
58
+ uint32_t set (uint32_t flags);
59
59
60
60
/* * Clear the specified Event Flags.
61
- @param flags specifies the flags that shall be cleared. (default: 0x7fffffff0 )
62
- @return event flags before clearing or error code if highest bit set (osFlagsError).
61
+ @param flags specifies the flags that shall be cleared. (default: 0x7fffffff - all flags )
62
+ @return event flags before clearing or error code if highest bit set (@a osFlagsError).
63
63
*/
64
64
uint32_t clear (uint32_t flags = 0x7fffffff );
65
65
66
- /* * Get the current Event Flags.
67
- @return current event flags.
66
+ /* * Get the currently set Event Flags.
67
+ @return set event flags.
68
68
*/
69
- uint32_t get ();
69
+ uint32_t get () const ;
70
70
71
- /* * Wait for one or more Event Flags to become signaled.
71
+ /* * Wait for all of the specified event flags to become signaled.
72
+ @param flags specifies the flags to wait for.
73
+ @param timeout timeout value or 0 in case of no time-out. (default: osWaitForever)
74
+ @param clear specifies wether to clear the flags after waiting for them. (default: true)
75
+ @return event flags before clearing or error code if highest bit set (@a osFlagsError).
76
+ */
77
+ uint32_t wait_all (uint32_t flags = 0 , uint32_t timeout = osWaitForever, bool clear = true );
78
+
79
+ /* * Wait for any of the specified event flags to become signaled.
72
80
@param flags specifies the flags to wait for. (default: 0)
73
81
@param timeout timeout value or 0 in case of no time-out. (default: osWaitForever)
74
- @return event flags before clearing or error code if highest bit set (osFlagsError).
75
- @note incase of flags 0 the function will wait to any flag and will not clear the flags,
76
- the user must clear the flags. otherwise the function to wait all specified flags and clear them.
82
+ @param clear specifies wether to clear the flags after waiting for them. (default: true)
83
+ @return event flags before clearing or error code if highest bit set (@a osFlagsError).
77
84
*/
78
- uint32_t wait (uint32_t flags = 0 , uint32_t timeout = osWaitForever);
85
+ uint32_t wait_any (uint32_t flags = 0 , uint32_t timeout = osWaitForever, bool clear = true );
79
86
80
87
~EventFlags ();
81
88
82
89
private:
83
90
void constructor (const char *name = NULL );
91
+ uint32_t wait (uint32_t flags, uint32_t opt, uint32_t timeout, bool clear);
84
92
osEventFlagsId_t _id;
85
93
osEventFlagsAttr_t _attr;
86
94
mbed_rtos_storage_event_flags_t _obj_mem;
0 commit comments