2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-25 11:18:27 +08:00

suservo: fix restart timing

This commit is contained in:
Robert Jördens 2018-04-25 15:19:49 +00:00
parent c304b6207a
commit 105068ad90

View File

@ -26,7 +26,7 @@ class Servo(Module):
self.start = Signal()
t_restart = t_cycle - t_adc
assert t_restart > 0
cnt = Signal(max=t_restart)
cnt = Signal(max=t_restart + 1)
cnt_done = Signal()
token = Signal(2)
self.done = Signal()
@ -44,7 +44,7 @@ class Servo(Module):
cnt.eq(cnt - 1),
),
If(self.adc.start,
cnt.eq(t_restart - 1),
cnt.eq(t_restart),
),
If(self.adc.done,
token[0].eq(0)