Skip to content
Snippets Groups Projects
Commit a154aaeb authored by Florian Pose's avatar Florian Pose
Browse files

Added ec_sync_get_pdo_type().

parent 3e8398d8
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
/*****************************************************************************/
......@@ -83,6 +83,8 @@ void ec_sync_config(const ec_sync_t *, uint8_t *);
int ec_sync_add_pdo(ec_sync_t *, const ec_pdo_t *);
void ec_sync_clear_pdos(ec_sync_t *);
ec_pdo_type_t ec_sync_get_pdo_type(const ec_sync_t *);
/*****************************************************************************/
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment