forked from M-Labs/artiq
1
0
Fork 0

suservo: fix restart timing

This commit is contained in:
Robert Jördens 2018-04-25 15:19:49 +00:00
parent c304b6207a
commit 105068ad90
1 changed files with 2 additions and 2 deletions

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)