Checking if TPDO was valid was wrong (pdo.c)
authorluis
Tue, 02 Oct 2007 10:32:11 +0200
changeset 298 dba062c5c3c1
parent 297 639e5ec5a120
child 299 506f9700b9fb
Checking if TPDO was valid was wrong (pdo.c)
There were some declarations after statements in pdo.c that caused some compilers to complaint
src/pdo.c
--- a/src/pdo.c	Mon Oct 01 17:17:35 2007 +0200
+++ b/src/pdo.c	Tue Oct 02 10:32:11 2007 +0200
@@ -460,7 +460,7 @@
     case state3:
       if (/*d->objdict[offsetObjdict].bSubCount < 5 || not necessary with objdictedit (always 5)*/
           /* check if TPDO is not valid */ 
-          *(UNS32*)d->objdict[offsetObjdict].pSubindex[0].pObject & 0x8000) {
+          *(UNS32*)d->objdict[offsetObjdict].pSubindex[1].pObject & 0x80000000) {
 	  MSG_WAR(0x3960, "Not a valid PDO ", 0x1800 + pdoNum);
 	  /*Go next TPDO*/
 	  status = state11;
@@ -525,10 +525,14 @@
 	   	/* No changes -> go to next pdo*/
 		status = state11;
 	}else{
+		
+		UNS16 EventTimerDuration;
+        UNS16 InhibitTimerDuration;
+		
 		MSG_WAR(0x306A, "Changes TPDO number : ", pdoNum);
 		/* Changes detected -> transmit message */
-        UNS16 EventTimerDuration = *(UNS16*)d->objdict[offsetObjdict].pSubindex[5].pObject;
-        UNS16 InhibitTimerDuration = *(UNS16*)d->objdict[offsetObjdict].pSubindex[3].pObject;
+        EventTimerDuration = *(UNS16*)d->objdict[offsetObjdict].pSubindex[5].pObject;
+        InhibitTimerDuration = *(UNS16*)d->objdict[offsetObjdict].pSubindex[3].pObject;
         
 		status = state5;