You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: events/include/events/EventQueue.h
+27-7Lines changed: 27 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -86,6 +86,17 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
86
86
*/
87
87
~EventQueue();
88
88
89
+
/** Dispatch events
90
+
*
91
+
* Executes events for the specified number of milliseconds.
92
+
*
93
+
* The dispatch_for() function is guaranteed to terminate after the elapsed wait.
94
+
*
95
+
* @param ms Time to wait for events in milliseconds, expressed as a
96
+
* Chrono duration.
97
+
*/
98
+
voiddispatch_for(duration ms);
99
+
89
100
/** Dispatch events
90
101
*
91
102
* Executes events until the specified milliseconds have passed.
@@ -96,23 +107,32 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
96
107
* to terminate. When called with a timeout of 0, the dispatch function
97
108
* does not wait and is IRQ safe.
98
109
*
110
+
* NOTE: Since the majority of the event library was updated to use
111
+
* Chrono types (as part of the Mbed 6 release), this function will not
112
+
* function as expected. Please update to use the new dispatch functions
113
+
* to ensure correct functionality.
114
+
*
99
115
* @param ms Time to wait for events in milliseconds, a negative
100
116
* value will dispatch events indefinitely
101
117
* (default to -1)
102
118
*/
119
+
MBED_DEPRECATED_SINCE("mbed-os-6.7.0", "Use dispatch_for() to pass a chrono duration, not an integer millisecond count. For example use `5s` rather than `5000`.")
103
120
voiddispatch(int ms = -1);
104
121
105
122
/** Dispatch events without a timeout
106
123
*
107
-
* This is equivalent to EventQueue::dispatch with no arguments, but
108
-
* avoids overload ambiguities when passed as a callback.
124
+
* Executes events indefinitely unless the dispatch loop is forcibly broken.
125
+
* @See break_dispatch()
109
126
*
110
-
* @see EventQueue::dispatch
111
127
*/
112
-
voiddispatch_forever()
113
-
{
114
-
dispatch();
115
-
}
128
+
voiddispatch_forever();
129
+
130
+
/** Dispatch currently queued events only and then terminate
131
+
*
132
+
* In this case the dispatch function does not wait.
0 commit comments