Skip to content

Commit ebbbdcf

Browse files
committedJul 29, 2015
examples/tdr: cleanup
1 parent 278570f commit ebbbdcf

File tree

1 file changed

+4
-8
lines changed
  • examples/master/repository

1 file changed

+4
-8
lines changed
 

Diff for: ‎examples/master/repository/tdr.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -49,27 +49,23 @@ def run(self):
4949
print("rising: {:5g} ns, falling {:5g} ns".format(
5050
t_rise/1e-9, t_fall/1e-9))
5151

52-
def rep(self, t):
53-
self.t = t
54-
5552
@kernel
5653
def many(self, n, p):
5754
t = [0 for i in range(2)]
5855
self.core.break_realtime()
5956
for i in range(n):
6057
self.one(t, p)
61-
self.rep(t)
58+
self.t = t
6259

6360
@kernel
6461
def one(self, t, p):
62+
t0 = now_mu()
6563
with parallel:
6664
self.pmt0.gate_both_mu(2*p)
67-
with sequential:
68-
t0 = now_mu()
69-
self.ttl2.pulse_mu(p)
65+
self.ttl2.pulse_mu(p)
7066
for i in range(len(t)):
7167
ti = self.pmt0.timestamp_mu()
7268
if ti <= 0:
7369
raise PulseNotReceivedError
7470
t[i] += ti - t0
75-
self.pmt0.count()
71+
self.pmt0.count() # flush

0 commit comments

Comments
 (0)
Please sign in to comment.