From bea7e952fa334eeb69f27e01ab6a9b0155dd61cf Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 26 Feb 2022 17:41:48 +0800 Subject: [PATCH] edge_counter: restore keyword arguments --- artiq/coredevice/edge_counter.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/artiq/coredevice/edge_counter.py b/artiq/coredevice/edge_counter.py index 52357fd53..e560565fb 100644 --- a/artiq/coredevice/edge_counter.py +++ b/artiq/coredevice/edge_counter.py @@ -139,38 +139,37 @@ class EdgeCounter: """ return self.gate_both_mu(self.core.seconds_to_mu(duration)) - # NAC3TODO: restore keyword arguments in calls (https://git.m-labs.hk/M-Labs/nac3/issues/199) @kernel def gate_rising_mu(self, duration_mu: int64) -> int64: """See :meth:`gate_rising`.""" return self._gate_mu( - duration_mu, True, False) + duration_mu, count_rising=True, count_falling=False) @kernel def gate_falling_mu(self, duration_mu: int64) -> int64: """See :meth:`gate_falling`.""" return self._gate_mu( - duration_mu, False, True) + duration_mu, count_rising=False, count_falling=True) @kernel def gate_both_mu(self, duration_mu: int64) -> int64: """See :meth:`gate_both_mu`.""" return self._gate_mu( - duration_mu, True, True) + duration_mu, count_rising=True, count_falling=True) @kernel def _gate_mu(self, duration_mu: int64, count_rising: bool, count_falling: bool) -> int64: self.set_config( - count_rising, - count_falling, - False, - True) + count_rising=count_rising, + count_falling=count_falling, + send_count_event=False, + reset_to_zero=True) delay_mu(duration_mu) self.set_config( - False, - False, - True, - False) + count_rising=False, + count_falling=False, + send_count_event=True, + reset_to_zero=False) return now_mu() @kernel