Added exclusion mechanism to TestMasterSlave finish code
authoretisserant
Thu, 30 Aug 2007 17:03:34 +0200
changeset 262 f1c892f3f93c
parent 261 dbcd80bcab82
child 263 d221d387ad2f
Added exclusion mechanism to TestMasterSlave finish code
examples/TestMasterSlave/TestMasterSlave.c
--- a/examples/TestMasterSlave/TestMasterSlave.c	Thu Aug 30 17:01:45 2007 +0200
+++ b/examples/TestMasterSlave/TestMasterSlave.c	Thu Aug 30 17:03:34 2007 +0200
@@ -222,12 +222,17 @@
 	// wait Ctrl-C
 	
 	pause();
+
 	eprintf("Finishing.\n");
-	
+    EnterMutex();
 	masterSendNMTstateChange (&TestMaster_Data, 0x02, NMT_Reset_Node);
+    LeaveMutex();
+
 	eprintf("reset\n");
 	// Stop master
+    EnterMutex();
 	setState(&TestMaster_Data, Stopped);
+    LeaveMutex();
 	
 	// Stop timer thread
 	StopTimerLoop();