Closed timkrentz closed 6 years ago
Can we safely flip lines 42 and 43 in timPort.py? Thus executing the wait before checking the 'started' event. This way, when halt() clears the "started" threading event during a wait, the halt() will interrupt the current clock interval
I would suggest to check the started
flag before sending the message:
if self.active.is_set() and self.started.is_set():
timer.halt() does not work immediately, and allows a subsequent call to on_timer().
Replication: Using /riaps-pycom/test/TimerS/PeriodicTimer.py, add self.periodic.halt() at the end of on_periodic(), like the below:
Then run the app with the RIAPS control GUI. I got the below output:
Notice the two logger messages from on_periodic() five seconds apart, even though self.periodic.halt() was (or should have been) called at the end of the first on_periodic() call. From here, the app logged nothing, implying that the periodic timer was then halted.