Skip to content

fix Sync-initiated PDO transmissions#66

Merged
mcbridejc merged 2 commits into
mcbridejc:mainfrom
SebKuzminsky:tpdo-sync-counter
Apr 29, 2026
Merged

fix Sync-initiated PDO transmissions#66
mcbridejc merged 2 commits into
mcbridejc:mainfrom
SebKuzminsky:tpdo-sync-counter

Conversation

@SebKuzminsky
Copy link
Copy Markdown
Contributor

PDO transmission_type 1-240 means "send this PDO every N Sync packets".

There was a bug in the Sync counting logic that made it only work on the "first Nth" Sync packet, because the PDO's sync counter did not reset to zero when the PDO transmission happened.

Luckily the AtomicCell API includes a fetch_update() function that lets the caller pass in an update closure.

This commit switches from fetch_add() to fetch_update() with a closure that increments the sync counter, but also makes it reset to 0 when transmission happens.

PDO transmission_type 1-240 means "send this PDO every N Sync packets".

There was a bug in the Sync counting logic that made it only work on the
"first Nth" Sync packet, because the PDO's sync counter did not reset
to zero when the PDO transmission happened.

Luckily the AtomicCell API includes a fetch_update() function that lets
the caller pass in an update closure.

This commit switches from fetch_add() to fetch_update() with a closure
that increments the sync counter, but also makes it reset to 0 when
transmission happens.
@mcbridejc
Copy link
Copy Markdown
Owner

Thanks!

@mcbridejc mcbridejc merged commit c8fed69 into mcbridejc:main Apr 29, 2026
2 checks passed
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