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

Small improvement of PDO offset calculation.

parent f11ecfc1
No related branches found
No related tags found
No related merge requests found
......@@ -200,16 +200,15 @@ int ec_domain_reg_pdo_entry(
// Calculate offset (in sync manager) for process data pointer
bit_offset = 0;
byte_offset = 0;
list_for_each_entry(other_pdo, &sync->pdos, list) {
list_for_each_entry(other_entry, &other_pdo->entries, list) {
if (other_entry == entry) {
byte_offset = bit_offset / 8;
break;
}
if (other_entry == entry)
goto out;
bit_offset += other_entry->bit_length;
}
}
out:
byte_offset = bit_offset / 8;
// Allocate memory for data registration object
if (!(data_reg =
......
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