osal: cmsis_os2: fix warning
* '&' has lower precedence than '==' * variable 'timeout' is uninitialized when used within its own initialization Signed-off-by: Jingru <jingru@synopsys.com>
This commit is contained in:
@@ -588,18 +588,18 @@ uint32_t osEventFlagsWait(osEventFlagsId_t ef_id,
|
|||||||
} else {
|
} else {
|
||||||
k_event_flag_t flag_match;
|
k_event_flag_t flag_match;
|
||||||
k_opt_t opt_pend = 0;
|
k_opt_t opt_pend = 0;
|
||||||
k_tick_t timeout =
|
timeout =
|
||||||
(timeout == 0 || timeout == osWaitForever) ? TOS_TIME_FOREVER : timeout;
|
((timeout == 0) || (timeout == osWaitForever)) ? TOS_TIME_FOREVER : timeout;
|
||||||
if (options & 0x01 == 0) {
|
if (options & (0x01 == 0)) {
|
||||||
opt_pend |= TOS_OPT_EVENT_PEND_ANY;
|
opt_pend |= TOS_OPT_EVENT_PEND_ANY;
|
||||||
} else {
|
} else {
|
||||||
opt_pend |= TOS_OPT_EVENT_PEND_ALL;
|
opt_pend |= TOS_OPT_EVENT_PEND_ALL;
|
||||||
}
|
}
|
||||||
if (options & 0x02 == 0) {
|
if (options & (0x02 == 0)) {
|
||||||
opt_pend |= TOS_OPT_EVENT_PEND_CLR;
|
opt_pend |= TOS_OPT_EVENT_PEND_CLR;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = tos_event_pend(eventId, (k_event_flag_t)flags, &flag_match, timeout,
|
err = tos_event_pend(eventId, (k_event_flag_t)flags, &flag_match, (k_tick_t)timeout,
|
||||||
opt_pend);
|
opt_pend);
|
||||||
rflags = err == K_ERR_NONE ? (uint32_t)flag_match
|
rflags = err == K_ERR_NONE ? (uint32_t)flag_match
|
||||||
: (uint32_t)errno_knl2cmsis(err);
|
: (uint32_t)errno_knl2cmsis(err);
|
||||||
|
Reference in New Issue
Block a user