Skip to content

Commit 9f04913

Browse files
kegilbertCruz Monrreal II
authored andcommitted
Change EventFlag timeout paramter
Matches rest of RTOS class timeout parameters by using the unit name. Remove ambigious statement in reference to 0 ms being no-timeout as a timeout of 0 causes the function to not block and return immediately (osWaitForever is used as no timeout as it will wait forever)
1 parent 8fa17b8 commit 9f04913

File tree

8 files changed

+21
-21
lines changed

8 files changed

+21
-21
lines changed

rtos/EventFlags.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,28 +62,28 @@ uint32_t EventFlags::get() const
6262
return osEventFlagsGet(_id);
6363
}
6464

65-
uint32_t EventFlags::wait_all(uint32_t flags, uint32_t timeout, bool clear)
65+
uint32_t EventFlags::wait_all(uint32_t flags, uint32_t millisec, bool clear)
6666
{
67-
return wait(flags, osFlagsWaitAll, timeout, clear);
67+
return wait(flags, osFlagsWaitAll, millisec, clear);
6868
}
6969

70-
uint32_t EventFlags::wait_any(uint32_t flags, uint32_t timeout, bool clear)
70+
uint32_t EventFlags::wait_any(uint32_t flags, uint32_t millisec, bool clear)
7171
{
72-
return wait(flags, osFlagsWaitAny, timeout, clear);
72+
return wait(flags, osFlagsWaitAny, millisec, clear);
7373
}
7474

7575
EventFlags::~EventFlags()
7676
{
7777
osEventFlagsDelete(_id);
7878
}
7979

80-
uint32_t EventFlags::wait(uint32_t flags, uint32_t opt, uint32_t timeout, bool clear)
80+
uint32_t EventFlags::wait(uint32_t flags, uint32_t opt, uint32_t millisec, bool clear)
8181
{
8282
if (clear == false) {
8383
opt |= osFlagsNoClear;
8484
}
8585

86-
return osEventFlagsWait(_id, flags, opt, timeout);
86+
return osEventFlagsWait(_id, flags, opt, millisec);
8787
}
8888

8989
}

rtos/EventFlags.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,23 +87,23 @@ class EventFlags : private mbed::NonCopyable<EventFlags> {
8787

8888
/** Wait for all of the specified event flags to become signaled.
8989
@param flags the flags to wait for (default: 0 -- no flags).
90-
@param timeout timeout value or 0 in case of no time-out (default: osWaitForever).
90+
@param millisec timeout value (default: osWaitForever).
9191
@param clear clear specified event flags after waiting for them (default: true).
9292
@return event flags before clearing or error code if highest bit set (see @a osFlagsError for details).
9393
94-
@note You may call this function from ISR context if the timeout parameter is set to 0.
94+
@note You may call this function from ISR context if the millisec parameter is set to 0.
9595
*/
96-
uint32_t wait_all(uint32_t flags = 0, uint32_t timeout = osWaitForever, bool clear = true);
96+
uint32_t wait_all(uint32_t flags = 0, uint32_t millisec = osWaitForever, bool clear = true);
9797

9898
/** Wait for any of the specified event flags to become signaled.
9999
@param flags the flags to wait for (default: 0 -- no flags).
100-
@param timeout timeout value or 0 in case of no timeout (default: osWaitForever).
100+
@param millisec timeout value (default: osWaitForever).
101101
@param clear clear specified event flags after waiting for them (default: true).
102102
@return event flags before clearing or error code if highest bit set (see @a osFlagsError for details).
103103
104-
@note This function may be called from ISR context if the timeout parameter is set to 0.
104+
@note This function may be called from ISR context if the millisec parameter is set to 0.
105105
*/
106-
uint32_t wait_any(uint32_t flags = 0, uint32_t timeout = osWaitForever, bool clear = true);
106+
uint32_t wait_any(uint32_t flags = 0, uint32_t millisec = osWaitForever, bool clear = true);
107107

108108
/** EventFlags destructor.
109109
@@ -113,7 +113,7 @@ class EventFlags : private mbed::NonCopyable<EventFlags> {
113113

114114
private:
115115
void constructor(const char *name = NULL);
116-
uint32_t wait(uint32_t flags, uint32_t opt, uint32_t timeout, bool clear);
116+
uint32_t wait(uint32_t flags, uint32_t opt, uint32_t millisec, bool clear);
117117
osEventFlagsId_t _id;
118118
mbed_rtos_storage_event_flags_t _obj_mem;
119119
};

rtos/Mail.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class Mail : private mbed::NonCopyable<Mail<T, queue_sz> > {
131131

132132
/** Get a mail from the queue.
133133
*
134-
* @param millisec Timeout value or 0 in case of no timeout (default: osWaitForever).
134+
* @param millisec Timeout value (default: osWaitForever).
135135
*
136136
* @return Event that contains mail information or error code.
137137
* @retval osEventMessage Message received.

rtos/Mutex.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class Mutex : private mbed::NonCopyable<Mutex> {
9595
9696
@deprecated Do not use this function. This function has been replaced with lock(), trylock() and trylock_for() functions.
9797
98-
@param millisec timeout value or 0 in case of no time-out.
98+
@param millisec timeout value.
9999
@return status code that indicates the execution status of the function:
100100
@a osOK the mutex has been obtained.
101101
@a osErrorTimeout the mutex could not be obtained in the given time.
@@ -117,7 +117,7 @@ class Mutex : private mbed::NonCopyable<Mutex> {
117117
bool trylock();
118118

119119
/** Try to lock the mutex for a specified time
120-
@param millisec timeout value or 0 in case of no time-out.
120+
@param millisec timeout value.
121121
@return true if the mutex was acquired, false otherwise.
122122
@note the underlying RTOS may have a limit to the maximum wait time
123123
due to internal 32-bit computations, but this is guaranteed to work if the

rtos/Queue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class Queue : private mbed::NonCopyable<Queue<T, queue_sz> > {
167167
* share the same priority level, they are retrieved in first-in, first-out
168168
* (FIFO) order.
169169
*
170-
* @param millisec Timeout value or 0 in case of no time-out.
170+
* @param millisec Timeout value.
171171
* (default: osWaitForever).
172172
*
173173
* @return Event information that includes the message in event. Message

rtos/Semaphore.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class Semaphore : private mbed::NonCopyable<Semaphore> {
6060
Semaphore(int32_t count, uint16_t max_count);
6161

6262
/** Wait until a Semaphore resource becomes available.
63-
@param millisec timeout value or 0 in case of no time-out. (default: osWaitForever).
63+
@param millisec timeout value. (default: osWaitForever).
6464
@return number of available tokens, before taking one; or -1 in case of incorrect parameters
6565
6666
@note You may call this function from ISR context if the millisec parameter is set to 0.

rtos/ThisThread.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ uint32_t flags_wait_any(uint32_t flags, bool clear = true);
105105

106106
/** Wait for all of the specified Thread Flags to become signaled for the current thread.
107107
@param flags specifies the flags to wait for
108-
@param millisec timeout value or 0 in case of no time-out.
108+
@param millisec timeout value.
109109
@param clear whether to clear the specified flags after waiting for them. (default: true)
110110
@return actual thread flags before clearing, which may not satisfy the wait
111111
@note You cannot call this function from ISR context.
@@ -129,7 +129,7 @@ uint32_t flags_wait_all_until(uint32_t flags, uint64_t millisec, bool clear = tr
129129

130130
/** Wait for any of the specified Thread Flags to become signaled for the current thread.
131131
@param flags specifies the flags to wait for
132-
@param millisec timeout value or 0 in case of no time-out.
132+
@param millisec timeout value.
133133
@param clear whether to clear the specified flags after waiting for them. (default: true)
134134
@return actual thread flags before clearing, which may not satisfy the wait
135135
@note You cannot call this function from ISR context.

rtos/Thread.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ class Thread : private mbed::NonCopyable<Thread> {
414414

415415
/** Wait for one or more Thread Flags to become signaled for the current RUNNING thread.
416416
@param signals wait until all specified signal flags are set or 0 for any single signal flag.
417-
@param millisec timeout value or 0 in case of no time-out. (default: osWaitForever).
417+
@param millisec timeout value. (default: osWaitForever).
418418
@return event flag information or error code. @note if @a millisec is set to 0 and flag is no set the event carries osOK value.
419419
420420
@note You cannot call this function from ISR context.

0 commit comments

Comments
 (0)