From ba20b5cd23ae74c1f4f925b7b8d3a84dbd42fd9e Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 19 Nov 2007 13:44:24 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@98 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARM7-LPC214x-GCC/chcore.h | 1 + src/chmsg.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/demos/ARM7-LPC214x-GCC/chcore.h b/demos/ARM7-LPC214x-GCC/chcore.h index 268cae39b..5217e30f6 100644 --- a/demos/ARM7-LPC214x-GCC/chcore.h +++ b/demos/ARM7-LPC214x-GCC/chcore.h @@ -101,6 +101,7 @@ extern void chSysUnlock(void); (INT_REQUIRED_STACK) + \ (n)) +/* It requires zero bytes, but better be safe.*/ #define IDLE_THREAD_STACK_SIZE 8 void _IdleThread(void *p) __attribute__((noreturn)); diff --git a/src/chmsg.c b/src/chmsg.c index 0f24b24aa..b70ebbcfe 100644 --- a/src/chmsg.c +++ b/src/chmsg.c @@ -37,9 +37,9 @@ t_msg chMsgSend(Thread *tp, t_msg msg) { chSysLock(); fifo_insert(currp, &tp->p_msgqueue); + currp->p_msg = msg; if (tp->p_state == PRWTMSG) chSchReadyI(tp); - currp->p_msg = msg; chSchGoSleepS(PRSNDMSG); msg = currp->p_rdymsg; @@ -184,7 +184,10 @@ void chMsgRelease(t_msg msg) { chSysLock(); -// if (!chMsgIsPendingI(currp) +#ifdef CH_USE_DEBUG + if (!chMsgIsPendingI(currp)) + chDbgPanic("chmsg.c, chMsgRelease()\r\n"); +#endif chSchWakeupS(fifo_remove(&currp->p_msgqueue), msg); chSysUnlock(); -- cgit v1.2.3