Changed canfestival plugin runtime template to reflect recent changes on unix.
authoretisserant
Sat, 24 May 2008 15:56:43 +0200
changeset 156 f2b35f4285b8
parent 155 515f3fbd1173
child 157 2e6d52c17cab
Changed canfestival plugin runtime template to reflect recent changes on unix.
plugins/canfestival/cf_runtime.c
--- a/plugins/canfestival/cf_runtime.c	Sat May 24 15:55:46 2008 +0200
+++ b/plugins/canfestival/cf_runtime.c	Sat May 24 15:56:43 2008 +0200
@@ -57,9 +57,6 @@
         setState(&nodename##_Data, Stopped);\
         LeaveMutex();\
         canClose(&nodename##_Data);\
-        #if !defined(WIN32) || defined(__CYGWIN__)\
-        		TimerCleanup();\
-        #endif\
     }
 
 void __cleanup_%(locstr)s()
@@ -70,13 +67,13 @@
     if(init_level-- > 0)
         StopTimerLoop(&Exit);
 
+    #if !defined(WIN32) || defined(__CYGWIN__)
+   		TimerCleanup();
+    #endif
 }
 
 #define NODE_OPEN(nodename)\
-	#if !defined(WIN32) || defined(__CYGWIN__)\
-		TimerInit();\
-	#endif\
-	nodename##_Data.preOperational = nodename##_preOperational;\
+    nodename##_Data.preOperational = nodename##_preOperational;\
     if(!canOpen(&nodename##Board,&nodename##_Data)){\
         printf("Cannot open " #nodename " Board (%%s,%%s)\n",nodename##Board.busname, nodename##Board.baudrate);\
         return -1;\
@@ -92,7 +89,10 @@
         return -1;
     }
 #endif      
-
+	#if !defined(WIN32) || defined(__CYGWIN__)
+		TimerInit();
+	#endif
+	
     %(nodes_open)s
 
     // Start timer thread