From 14d3b059c225769038a0f3538f491cf6099dbb3e Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 7 Jan 2008 10:49:59 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@165 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/Win32-MSVS/ch.vcproj | 13 ++++++------- demos/Win32-MSVS/demo.c | 9 --------- readme.txt | 5 ++++- src/chmtx.c | 9 ++++++--- 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/demos/Win32-MSVS/ch.vcproj b/demos/Win32-MSVS/ch.vcproj index 3490c810b..0b27e2ffb 100644 --- a/demos/Win32-MSVS/ch.vcproj +++ b/demos/Win32-MSVS/ch.vcproj @@ -159,6 +159,9 @@ + + @@ -185,13 +188,6 @@ RelativePath="..\..\ports\Win32\simcom.c"> - - - - + + diff --git a/demos/Win32-MSVS/demo.c b/demos/Win32-MSVS/demo.c index 7f8bd6903..5a3bf167c 100644 --- a/demos/Win32-MSVS/demo.c +++ b/demos/Win32-MSVS/demo.c @@ -182,7 +182,6 @@ static t_msg ShellThread(void *arg) { PrintLineFDD(sd, " exit - Logout from ChibiOS/RT\r\n"); PrintLineFDD(sd, " time - Prints the system timer value\r\n"); PrintLineFDD(sd, " hello - Runs the Hello World demo thread\r\n"); - PrintLineFDD(sd, " test - Runs the System Test thread\r\n"); } else if (stricmp(lp, "exit") == 0) { if (checkend(sd)) @@ -204,14 +203,6 @@ static t_msg ShellThread(void *arg) { if (chThdWait(tp)) break; // Lost connection while executing the hello thread. } - else if (stricmp(lp, "test") == 0) { - if (checkend(sd)) - continue; - tp = chThdCreate(NORMALPRIO, 0, tarea, sizeof(tarea), - TestThread, arg); - if (chThdWait(tp)) - break; // Lost connection while executing the hello thread. - } else { PrintLineFDD(sd, lp); PrintLineFDD(sd, " ?\r\n"); diff --git a/readme.txt b/readme.txt index 0f872fe00..b00db6498 100644 --- a/readme.txt +++ b/readme.txt @@ -43,7 +43,10 @@ AVR-AT90CANx-GCC - Port on AVR AT90CAN128, not complete yet. - Added to the ARM demos load scripts the capability to load code in RAM instead flash, the function must be marked as: __attribute__((section(".ramtext"))) - The option -mlong-calls should be specified in the makefile too. + The option -mlong-calls should be specified in the makefile too or the + function declared with the "long-call" attribute. +- Fixed the MSVC demo project files. +- Fixed some syntax incompatibilites between GCC and MSVC into chmtx.c. *** 0.5.0 *** - NEW: Mutexes, the new mechanism provides a complete implementation of the diff --git a/src/chmtx.c b/src/chmtx.c index af2ac0262..25f3ce664 100644 --- a/src/chmtx.c +++ b/src/chmtx.c @@ -99,10 +99,11 @@ void chMtxLockS(Mutex *mp) { * @return \p TRUE if the mutex was successfully acquired else \p FALSE */ BOOL chMtxTryLock(Mutex *mp) { + BOOL b; chSysLock(); - BOOL b = chMtxTryLockS(mp); + b = chMtxTryLockS(mp); chSysUnlock(); return b; @@ -131,6 +132,7 @@ BOOL chMtxTryLockS(Mutex *mp) { * Unlocks the next owned mutex in reverse lock order. */ void chMtxUnlock(void) { + Mutex *mp; chSysLock(); @@ -140,7 +142,7 @@ void chMtxUnlock(void) { /* * Removes the top Mutex from the owned mutexes list and marks it as not owned. */ - Mutex *mp = currp->p_mtxlist; + mp = currp->p_mtxlist; currp->p_mtxlist = mp->m_next; mp->m_owner = NULL; /* @@ -172,6 +174,7 @@ void chMtxUnlock(void) { * @note This function does not reschedule internally. */ void chMtxUnlockS(void) { + Mutex *mp; chDbgAssert((currp->p_mtxlist != NULL) && (currp->p_mtxlist->m_owner == currp), "chmtx.c, chMtxUnlockS()"); @@ -179,7 +182,7 @@ void chMtxUnlockS(void) { /* * Removes the top Mutex from the owned mutexes list and marks it as not owned. */ - Mutex *mp = currp->p_mtxlist; + mp = currp->p_mtxlist; currp->p_mtxlist = mp->m_next; mp->m_owner = NULL; /* -- cgit v1.2.3