master/sync.c
changeset 879 9b395c5646ab
parent 873 ec01ba291896
child 912 6630f4dbcfd2
equal deleted inserted replaced
878:40c379697ebf 879:9b395c5646ab
    54         )
    54         )
    55 {
    55 {
    56     sync->slave = slave;
    56     sync->slave = slave;
    57     sync->index = index;    
    57     sync->index = index;    
    58 
    58 
    59     ec_pdo_mapping_init(&sync->mapping);
    59     ec_pdo_list_init(&sync->pdos);
    60     sync->mapping_source = EC_SYNC_MAPPING_NONE;
    60     sync->assign_source = EC_ASSIGN_NONE;
    61 }
    61 }
    62 
    62 
    63 /*****************************************************************************/
    63 /*****************************************************************************/
    64 
    64 
    65 /** Copy constructor.
    65 /** Copy constructor.
    74    sync->physical_start_address = other->physical_start_address;
    74    sync->physical_start_address = other->physical_start_address;
    75    sync->length = other->length;
    75    sync->length = other->length;
    76    sync->control_register = other->control_register;
    76    sync->control_register = other->control_register;
    77    sync->enable = other->enable;
    77    sync->enable = other->enable;
    78    
    78    
    79    ec_pdo_mapping_init(&sync->mapping);
    79    ec_pdo_list_init(&sync->pdos);
    80    ec_pdo_mapping_copy(&sync->mapping, &other->mapping);
    80    ec_pdo_list_copy(&sync->pdos, &other->pdos);
    81 
    81 
    82    sync->mapping_source = other->mapping_source;
    82    sync->assign_source = other->assign_source;
    83 }
    83 }
    84 
    84 
    85 /*****************************************************************************/
    85 /*****************************************************************************/
    86 
    86 
    87 /** Destructor.
    87 /** Destructor.
    88  */
    88  */
    89 void ec_sync_clear(
    89 void ec_sync_clear(
    90         ec_sync_t *sync /**< EtherCAT sync manager. */
    90         ec_sync_t *sync /**< EtherCAT sync manager. */
    91         )
    91         )
    92 {
    92 {
    93     ec_pdo_mapping_clear(&sync->mapping);
    93     ec_pdo_list_clear(&sync->pdos);
    94 }
    94 }
    95 
    95 
    96 /*****************************************************************************/
    96 /*****************************************************************************/
    97 
    97 
    98 /** Initializes a sync manager configuration page with SII data.
    98 /** Initializes a sync manager configuration page with SII data.
   127 int ec_sync_add_pdo(
   127 int ec_sync_add_pdo(
   128         ec_sync_t *sync, /**< EtherCAT sync manager. */
   128         ec_sync_t *sync, /**< EtherCAT sync manager. */
   129         const ec_pdo_t *pdo /**< Pdo to map. */
   129         const ec_pdo_t *pdo /**< Pdo to map. */
   130         )
   130         )
   131 {
   131 {
   132     return ec_pdo_mapping_add_pdo_copy(&sync->mapping, pdo);
   132     return ec_pdo_list_add_pdo_copy(&sync->pdos, pdo);
   133 }
   133 }
   134 
   134 
   135 /*****************************************************************************/
   135 /*****************************************************************************/
   136 
   136 
   137 /** Get direction covered by sync manager.
   137 /** Get direction covered by sync manager.