sync.c : fixed some endianize problem, and calback de-registering when re-starting service.
authoretisserant
Mon, 21 Apr 2008 16:37:27 +0200
changeset 443 994c99afb344
parent 442 010c26b9ba89
child 444 9a7f7bc82257
sync.c : fixed some endianize problem, and calback de-registering when re-starting service.
src/sync.c
--- a/src/sync.c	Mon Apr 21 16:34:51 2008 +0200
+++ b/src/sync.c	Mon Apr 21 16:37:27 2008 +0200
@@ -86,14 +86,14 @@
 **/ 
 void startSYNC(CO_Data* d)
 {
+	if(d->syncTimer != TIMER_NONE){
+		stopSYNC(d);
+	}
+
 	RegisterSetODentryCallBack(d, 0x1005, 0, &OnCOB_ID_SyncUpdate);
 	RegisterSetODentryCallBack(d, 0x1006, 0, &OnCOB_ID_SyncUpdate);
 
-	if(d->syncTimer != TIMER_NONE){
-		stopSYNC(d);
-	}
-	
-	if(*d->COB_ID_Sync & UNS32_LE(0x40000000) && *d->Sync_Cycle_Period)
+	if(*d->COB_ID_Sync & 0x40000000ul && *d->Sync_Cycle_Period)
 	{
 		d->syncTimer = SetAlarm(
 				d,