master/sync.c
changeset 748 6c8801bd547f
parent 746 ef0f6eb5cd7c
child 758 8fa6f825eb7d
equal deleted inserted replaced
747:ac8a822c3e5b 748:6c8801bd547f
   193         kfree(pdo);
   193         kfree(pdo);
   194     }
   194     }
   195 }
   195 }
   196 
   196 
   197 /*****************************************************************************/
   197 /*****************************************************************************/
       
   198 
       
   199 /**
       
   200  */
       
   201 
       
   202 ec_pdo_type_t ec_sync_get_pdo_type(
       
   203         const ec_sync_t *sync /**< EtherCAT sync manager */
       
   204         )
       
   205 {
       
   206     int index = sync->index;
       
   207 
       
   208     if (sync->slave && sync->slave->sii_mailbox_protocols) {
       
   209         index -= 2;
       
   210     }
       
   211 
       
   212     if (index < 0 || index > 1) {
       
   213         EC_WARN("ec_sync_get_pdo_type(): invalid sync manager index.\n");
       
   214         return EC_RX_PDO;
       
   215     }
       
   216 
       
   217     return (ec_pdo_type_t) index;
       
   218 }
       
   219 
       
   220 /*****************************************************************************/