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

Added ec_sdo_get_entry_const().

parent 2aea597d
No related branches found
No related tags found
No related merge requests found
...@@ -154,7 +154,7 @@ void ec_sdo_clear( ...@@ -154,7 +154,7 @@ void ec_sdo_clear(
/*****************************************************************************/ /*****************************************************************************/
/** Get and Sdo entry from an Sdo via its subindex. /** Get an Sdo entry from an Sdo via its subindex.
* *
* \retval >0 Pointer to the requested Sdo entry. * \retval >0 Pointer to the requested Sdo entry.
* \retval NULL Sdo entry not found. * \retval NULL Sdo entry not found.
...@@ -167,7 +167,33 @@ ec_sdo_entry_t *ec_sdo_get_entry( ...@@ -167,7 +167,33 @@ ec_sdo_entry_t *ec_sdo_get_entry(
ec_sdo_entry_t *entry; ec_sdo_entry_t *entry;
list_for_each_entry(entry, &sdo->entries, list) { list_for_each_entry(entry, &sdo->entries, list) {
if (entry->subindex != subindex) continue; if (entry->subindex != subindex)
continue;
return entry;
}
return NULL;
}
/*****************************************************************************/
/** Get an Sdo entry from an Sdo via its subindex.
*
* const version.
*
* \retval >0 Pointer to the requested Sdo entry.
* \retval NULL Sdo entry not found.
*/
const ec_sdo_entry_t *ec_sdo_get_entry_const(
const ec_sdo_t *sdo, /**< Sdo. */
uint8_t subindex /**< Entry subindex. */
)
{
const ec_sdo_entry_t *entry;
list_for_each_entry(entry, &sdo->entries, list) {
if (entry->subindex != subindex)
continue;
return entry; return entry;
} }
......
...@@ -68,6 +68,7 @@ int ec_sdo_init(ec_sdo_t *, uint16_t, ec_slave_t *); ...@@ -68,6 +68,7 @@ int ec_sdo_init(ec_sdo_t *, uint16_t, ec_slave_t *);
void ec_sdo_destroy(ec_sdo_t *); void ec_sdo_destroy(ec_sdo_t *);
ec_sdo_entry_t *ec_sdo_get_entry(ec_sdo_t *, uint8_t); ec_sdo_entry_t *ec_sdo_get_entry(ec_sdo_t *, uint8_t);
const ec_sdo_entry_t *ec_sdo_get_entry_const(const ec_sdo_t *, uint8_t);
/*****************************************************************************/ /*****************************************************************************/
......
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