aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/src/chmsg.c
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-03-03 11:01:09 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-03-03 11:01:09 +0000
commitfbd65c1f6ae3c802467ab99f4b2fe9c7c084972e (patch)
treecafc124edd19ce4f3b676a9de703f7a0aefed409 /os/rt/src/chmsg.c
parent3d1a86e9fb0b9495a726dab534e97c063b5f368b (diff)
downloadChibiOS-fbd65c1f6ae3c802467ab99f4b2fe9c7c084972e.tar.gz
ChibiOS-fbd65c1f6ae3c802467ab99f4b2fe9c7c084972e.tar.bz2
ChibiOS-fbd65c1f6ae3c802467ab99f4b2fe9c7c084972e.zip
MISRA-related fixes.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7711 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt/src/chmsg.c')
-rw-r--r--os/rt/src/chmsg.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/os/rt/src/chmsg.c b/os/rt/src/chmsg.c
index 72f662341..d757efd77 100644
--- a/os/rt/src/chmsg.c
+++ b/os/rt/src/chmsg.c
@@ -93,11 +93,13 @@ msg_t chMsgSend(thread_t *tp, msg_t msg) {
ctp->p_msg = msg;
ctp->p_u.wtobjp = &tp->p_msgqueue;
msg_insert(ctp, &tp->p_msgqueue);
- if (tp->p_state == CH_STATE_WTMSG)
+ if (tp->p_state == CH_STATE_WTMSG) {
chSchReadyI(tp);
+ }
chSchGoSleepS(CH_STATE_SNDMSGQ);
msg = ctp->p_u.rdymsg;
chSysUnlock();
+
return msg;
}
@@ -119,11 +121,13 @@ thread_t *chMsgWait(void) {
thread_t *tp;
chSysLock();
- if (!chMsgIsPendingI(currp))
+ if (!chMsgIsPendingI(currp)) {
chSchGoSleepS(CH_STATE_WTMSG);
+ }
tp = queue_fifo_remove(&currp->p_msgqueue);
tp->p_state = CH_STATE_SNDMSG;
chSysUnlock();
+
return tp;
}