master/sync.c
changeset 748 6c8801bd547f
parent 746 ef0f6eb5cd7c
child 758 8fa6f825eb7d
--- a/master/sync.c	Thu Sep 20 12:33:58 2007 +0000
+++ b/master/sync.c	Thu Sep 20 12:57:28 2007 +0000
@@ -195,3 +195,26 @@
 }
 
 /*****************************************************************************/
+
+/**
+ */
+
+ec_pdo_type_t ec_sync_get_pdo_type(
+        const ec_sync_t *sync /**< EtherCAT sync manager */
+        )
+{
+    int index = sync->index;
+
+    if (sync->slave && sync->slave->sii_mailbox_protocols) {
+        index -= 2;
+    }
+
+    if (index < 0 || index > 1) {
+        EC_WARN("ec_sync_get_pdo_type(): invalid sync manager index.\n");
+        return EC_RX_PDO;
+    }
+
+    return (ec_pdo_type_t) index;
+}
+
+/*****************************************************************************/