git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@165 35acf78f-673a-0410-8e92-d51de3d6d3f4

master
gdisirio 2008-01-07 10:49:59 +00:00
parent dc39fea05e
commit 14d3b059c2
4 changed files with 16 additions and 20 deletions

View File

@ -159,6 +159,9 @@
<File
RelativePath="..\..\src\chmsg.c">
</File>
<File
RelativePath="..\..\src\chmtx.c">
</File>
<File
RelativePath="..\..\src\chqueues.c">
</File>
@ -185,13 +188,6 @@
RelativePath="..\..\ports\Win32\simcom.c">
</File>
</Filter>
<Filter
Name="test"
Filter="">
<File
RelativePath="..\..\test\test.c">
</File>
</Filter>
</Filter>
<Filter
Name="Header Files"
@ -230,6 +226,9 @@
<File
RelativePath="..\..\src\include\messages.h">
</File>
<File
RelativePath="..\..\src\include\mutexes.h">
</File>
<File
RelativePath="..\..\src\include\queues.h">
</File>

View File

@ -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");

View File

@ -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

View File

@ -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;
/*