master/sdo.c
changeset 963 01702c78fe0a
parent 962 ea83a7aab57a
child 991 2548ca639b1f
equal deleted inserted replaced
962:ea83a7aab57a 963:01702c78fe0a
   152     kfree(sdo);
   152     kfree(sdo);
   153 }
   153 }
   154 
   154 
   155 /*****************************************************************************/
   155 /*****************************************************************************/
   156 
   156 
   157 /** Get and Sdo entry from an Sdo via its subindex.
   157 /** Get an Sdo entry from an Sdo via its subindex.
   158  * 
   158  * 
   159  * \retval >0 Pointer to the requested Sdo entry.
   159  * \retval >0 Pointer to the requested Sdo entry.
   160  * \retval NULL Sdo entry not found.
   160  * \retval NULL Sdo entry not found.
   161  */
   161  */
   162 ec_sdo_entry_t *ec_sdo_get_entry(
   162 ec_sdo_entry_t *ec_sdo_get_entry(
   165         )
   165         )
   166 {
   166 {
   167     ec_sdo_entry_t *entry;
   167     ec_sdo_entry_t *entry;
   168 
   168 
   169     list_for_each_entry(entry, &sdo->entries, list) {
   169     list_for_each_entry(entry, &sdo->entries, list) {
   170         if (entry->subindex != subindex) continue;
   170         if (entry->subindex != subindex)
       
   171             continue;
       
   172         return entry;
       
   173     }
       
   174 
       
   175     return NULL;
       
   176 }
       
   177 
       
   178 /*****************************************************************************/
       
   179 
       
   180 /** Get an Sdo entry from an Sdo via its subindex.
       
   181  *
       
   182  * const version.
       
   183  * 
       
   184  * \retval >0 Pointer to the requested Sdo entry.
       
   185  * \retval NULL Sdo entry not found.
       
   186  */
       
   187 const ec_sdo_entry_t *ec_sdo_get_entry_const(
       
   188         const ec_sdo_t *sdo, /**< Sdo. */
       
   189         uint8_t subindex /**< Entry subindex. */
       
   190         )
       
   191 {
       
   192     const ec_sdo_entry_t *entry;
       
   193 
       
   194     list_for_each_entry(entry, &sdo->entries, list) {
       
   195         if (entry->subindex != subindex)
       
   196             continue;
   171         return entry;
   197         return entry;
   172     }
   198     }
   173 
   199 
   174     return NULL;
   200     return NULL;
   175 }
   201 }