Fixed incorrect struct access in sendPDO() and inserted a missing variable in sendOnePDOEvent(). These errors occured at compile-time when configuring the project with './configure --debug=PDO' or './configure --debug=WAR'.
authorskratochwil
Mon, 20 Jun 2011 15:03:54 +0200
changeset 660 cff8e50333e8
parent 659 1041153c5fd2
child 661 06494ae5b2b6
Fixed incorrect struct access in sendPDO() and inserted a missing variable in sendOnePDOEvent(). These errors occured at compile-time when configuring the project with './configure --debug=PDO' or './configure --debug=WAR'.
src/pdo.c
--- a/src/pdo.c	Wed Apr 13 16:29:59 2011 +0200
+++ b/src/pdo.c	Mon Jun 20 15:03:54 2011 +0200
@@ -487,8 +487,8 @@
 {
   /*store_as_last_message */
   d->PDO_status[pdoNum].last_message = *pdo;
-  MSG_WAR (0x396D, "sendPDO cobId :", UNS16_LE(pdo.cob_id));
-  MSG_WAR (0x396E, "     Nb octets  : ", pdo.len);
+  MSG_WAR (0x396D, "sendPDO cobId :", UNS16_LE(pdo->cob_id));
+  MSG_WAR (0x396E, "     Nb octets  : ", pdo->len);
 
   canSend (d->canHandle, pdo);
 }
@@ -512,6 +512,7 @@
 UNS8
 sendOnePDOevent (CO_Data * d, UNS8 pdoNum)
 {
+  UNS8 *pTransmissionType;
   UNS16 offsetObjdict;
   Message pdo;
   if (!d->CurrentCommunicationState.csPDO ||
@@ -521,6 +522,8 @@
     }
 
   offsetObjdict = (UNS16) (d->firstIndex->PDO_TRS + pdoNum);
+  pTransmissionType = (UNS8 *) d->objdict[offsetObjdict].pSubindex[2].pObject;
+
   MSG_WAR (0x3968, "  PDO is on EVENT. Trans type : ",
            *pTransmissionType);