master/pdo_mapping.c
changeset 838 3cb5769059f4
parent 826 70aeae0de217
child 839 e0757d452fc9
equal deleted inserted replaced
837:133528cfd528 838:3cb5769059f4
   117 
   117 
   118 /** Adds a Pdo to the mapping.
   118 /** Adds a Pdo to the mapping.
   119  *
   119  *
   120  * \return 0 on success, else < 0
   120  * \return 0 on success, else < 0
   121  */
   121  */
   122 int ec_pdo_mapping_add_pdo(
   122 int ec_pdo_mapping_add_pdo_copy(
   123         ec_pdo_mapping_t *pm, /**< Pdo mapping. */
   123         ec_pdo_mapping_t *pm, /**< Pdo mapping. */
   124         const ec_pdo_t *pdo /**< Pdo to add. */
   124         const ec_pdo_t *pdo /**< Pdo to add. */
   125         )
   125         )
   126 {
   126 {
   127     ec_pdo_t *mapped_pdo;
   127     ec_pdo_t *mapped_pdo;
   267 
   267 
   268     ec_pdo_mapping_clear_pdos(pm);
   268     ec_pdo_mapping_clear_pdos(pm);
   269 
   269 
   270     // Pdo already mapped?
   270     // Pdo already mapped?
   271     list_for_each_entry(other_pdo, &other->pdos, list) {
   271     list_for_each_entry(other_pdo, &other->pdos, list) {
   272         if (ec_pdo_mapping_add_pdo(pm, other_pdo))
   272         if (ec_pdo_mapping_add_pdo_copy(pm, other_pdo))
   273             return -1;
   273             return -1;
   274     }
   274     }
   275     
   275     
   276     return 0;
   276     return 0;
   277 }
   277 }