Merge pull request #167 from OpenEtherCATsociety/fix/download_variable_using_CA

Fix padding of index 0 for object type variable
fix/reset_esc_repeat_ack
nakarlsson 2024-02-05 16:38:10 +01:00 committed by GitHub
commit 05bf6c6726
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 2 deletions

View File

@ -556,8 +556,11 @@ static uint32_t complete_access_subindex_loop(const _objd *objd,
}
}
/* Subindex 0 is padded to 16 bit */
size += (nsub == 0) ? 16 : bitlen;
/* Subindex 0 is padded to 16 bit if not object type VARIABLE.
* For VARIABLE use true bitsize.
*/
size +=
((nsub == 0) && (SDOobjects[nidx].objtype != OTYPE_VAR)) ? 16 : bitlen;
nsub++;
if ((max_bytes > 0) && (BITS2BYTES(size) >= max_bytes))