Skip to content

Commit

Permalink
Allow event timer value to control pdo period
Browse files Browse the repository at this point in the history
  • Loading branch information
grantweiss-RaymondCorp committed Aug 12, 2024
1 parent 4a8094e commit 0a9f50d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions canopen/pdo/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,11 @@ def start(self, period: Optional[float] = None) -> None:
# overwrite the reference and can lose our handle to shut it down
self.stop()

# Prefer period, then self.period, then use self.event_timer
if period is not None:
self.period = period
elif self.period is None and self.event_timer and self.trans_type >= 254:
self.period = self.event_timer / 1000

if not self.period:
raise ValueError("A valid transmission period has not been given")
Expand Down

0 comments on commit 0a9f50d

Please sign in to comment.