src/pdo.c
changeset 670 e37511baf56b
parent 661 06494ae5b2b6
child 688 514108c6e4c4
child 711 4b64e17396af
--- a/src/pdo.c	Thu Oct 13 17:51:27 2011 +0200
+++ b/src/pdo.c	Wed Nov 02 22:37:24 2011 +0100
@@ -186,6 +186,7 @@
   UNS32 objDict;
   UNS16 offsetObjdict;
   UNS16 lastIndex;
+  TIMEVAL EventTimerDuration = 0;
 
   status = state2;
 
@@ -220,6 +221,7 @@
                   {
                     /* The cobId is recognized */
                     status = state4;
+                    EventTimerDuration = *(UNS16 *)d->objdict[offsetObjdict].pSubindex[5].pObject;
                     MSG_WAR (0x3936, "cobId found at index ",
                              0x1400 + numPdo);
                     break;
@@ -303,7 +305,12 @@
                       }
                     numMap++;
                   }             /* end loop while on mapped variables */
-
+                if (EventTimerDuration && d->RxPDO_EventTimers)
+                {
+                    DelAlarm (d->RxPDO_EventTimers[numPdo]);
+                    d->RxPDO_EventTimers[numPdo] = SetAlarm (d, numPdo, d->RxPDO_EventTimers_Handler,
+                    MS_TO_TIMEVAL (EventTimerDuration), 0);
+                }
                 return 0;
 
               }                 /* end switch status */
@@ -604,6 +611,11 @@
   sendOnePDOevent (d, (UNS8) pdoNum);
 }
 
+void
+_RxPDO_EventTimers_Handler(CO_Data *d, UNS32 pdoNum)
+{
+}
+
 /*!
 **
 **