def clearDownSource(self): """Disable the down counting source to the counter. """ if self.downSource is not None and self.allocatedDownSource: self.downSource.free() self.allocatedDownSource = False self.downSource = None hal.clearCounterDownSource(self._counter)
def _freeCounter(counter): hal.setCounterUpdateWhenEmpty(counter, True) hal.clearCounterUpSource(counter) hal.clearCounterDownSource(counter) hal.freeCounter(counter)