Merge pull request #590 from pathletboy/master

[Kernel] allow parameter "recved" can be NULL in function "rt_event_recv"
This commit is contained in:
Bernard Xiong 2015-11-23 14:16:11 +08:00
commit e63a458647
1 changed files with 3 additions and 2 deletions

View File

@ -1086,7 +1086,7 @@ RTM_EXPORT(rt_event_send);
* @param option the receive option, either RT_EVENT_FLAG_AND or * @param option the receive option, either RT_EVENT_FLAG_AND or
* RT_EVENT_FLAG_OR should be set. * RT_EVENT_FLAG_OR should be set.
* @param timeout the waiting time * @param timeout the waiting time
* @param recved the received event * @param recved the received event, if you don't care, RT_NULL can be set.
* *
* @return the error code * @return the error code
*/ */
@ -1139,7 +1139,8 @@ rt_err_t rt_event_recv(rt_event_t event,
if (status == RT_EOK) if (status == RT_EOK)
{ {
/* set received event */ /* set received event */
*recved = (event->set & set); if (recved)
*recved = (event->set & set);
/* received event */ /* received event */
if (option & RT_EVENT_FLAG_CLEAR) if (option & RT_EVENT_FLAG_CLEAR)