mirror of
https://gitlab.com/etherlab.org/ethercat.git
synced 2026-02-06 03:41:52 +08:00
Added ec_sync_get_pdo_type().
This commit is contained in:
@@ -195,3 +195,26 @@ void ec_sync_clear_pdos(
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
*/
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user