From 165bcc4a0708ff3252fe73156eace36b5980dbf9 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 27 Mar 2008 12:33:31 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@249 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- src/lib/ch.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/lib/ch.cpp') diff --git a/src/lib/ch.cpp b/src/lib/ch.cpp index ad4be5f4d..d1e739915 100644 --- a/src/lib/ch.cpp +++ b/src/lib/ch.cpp @@ -70,13 +70,11 @@ namespace chibios_rt { * chibios_rt::BaseThread * *------------------------------------------------------------------------*/ static msg_t thdstart(void *arg) { - BaseThread *btp = (BaseThread *)arg; - return btp->Main(); + return ((BaseThread *)arg)->Main(); } BaseThread::BaseThread(tprio_t prio, tmode_t mode, void *workspace, size_t wsize) { - msg_t thdstart(void *arg); thread_ref = chThdCreate(prio, mode, workspace, wsize, thdstart, this); } @@ -149,7 +147,7 @@ namespace chibios_rt { bool BaseThread::IsPendingMessage(void) { - return chMsgIsPendingI(thread_ref); + return chMsgIsPendingI(currp); } #endif /* CH_USE_MESSAGES */ @@ -188,6 +186,13 @@ namespace chibios_rt { chSemSignal(&sem); } + +#ifdef CH_USE_SEMSW + msg_t Semaphore::SignalWait(Semaphore *ssem, Semaphore *wsem) { + + return chSemSignalWait(&ssem->sem, &wsem->sem); + } +#endif /* CH_USE_SEMSW */ #endif /* CH_USE_SEMAPHORES */ #ifdef CH_USE_MUTEXES -- cgit v1.2.3