From b328c1cbac55d6ed9ab4708611e20961a28f27f1 Mon Sep 17 00:00:00 2001 From: chenchaoqun Date: Mon, 27 Jul 2020 11:36:57 +0800 Subject: [PATCH] [modify] if ... else if constructs to be terminated with an else clause, which other option is invalid and delete surplus space. --- src/ipc.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ipc.c b/src/ipc.c index 8e8c4db842..876d8df3a1 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -1080,6 +1080,13 @@ rt_err_t rt_event_send(rt_event_t event, rt_uint32_t set) status = RT_EOK; } } + else + { + /* enable interrupt */ + rt_hw_interrupt_enable(level); + + return -RT_EINVAL; + } /* move node to the next */ n = n->next; @@ -1186,10 +1193,10 @@ rt_err_t rt_event_recv(rt_event_t event, { /* no waiting */ thread->error = -RT_ETIMEOUT; - + /* enable interrupt */ rt_hw_interrupt_enable(level); - + return -RT_ETIMEOUT; } else