Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PDO mapping with OD_ARRAY entries #64

Merged
merged 1 commit into from
Feb 9, 2024

Conversation

nattgris
Copy link

@nattgris nattgris commented Feb 6, 2024

The second entry is returned from co_entry_find(), for array or record objects, when that entry has the OD_ARRAY flag set. So for these objects the mapped entry pointer in the PDO will always point to the same entry regardless of the subindex of the mapping.

Therefore, the PDO packing and unpacking must not consider the subindex field of the mapped entry when storing or fetching the value. Instead it needs to look at the actual mapped subindex to access the correct data.

The second entry is returned from co_entry_find(), for array or record
objects, when that entry has the OD_ARRAY flag set. So for these objects
the mapped entry pointer in the PDO will always point to the same entry
regardless of the subindex of the mapping.

Therefore, the PDO packing and unpacking must not consider the subindex
field of the mapped entry when storing or fetching the value. Instead it
needs to look at the actual mapped subindex to access the correct data.

Change-Id: I983f25bdeb10de72f7522d7a2f912e0c885e59fb
@hefloryd hefloryd merged commit ad68c17 into rtlabs-com:master Feb 9, 2024
1 check passed
@hefloryd
Copy link
Collaborator

hefloryd commented Feb 9, 2024

Great, thanks for the fix.

@nattgris nattgris deleted the pdo-array-mapping branch February 9, 2024 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants