Skip to content

Commit f48a942

Browse files
committed
Shutdown an already running periodic PDO before starting a new one
1 parent f4098c1 commit f48a942

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

canopen/pdo/base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,10 @@ def start(self, period=None):
441441
442442
:param float period: Transmission period in seconds
443443
"""
444+
# Stop an already running transmission if we have one, otherwise we
445+
# overwrite the reference and can lose our handle to shut it down
446+
self.stop()
447+
444448
if period is not None:
445449
self.period = period
446450

0 commit comments

Comments
 (0)