def clearUpSource(self): """Disable the up counting source to the counter.""" if self.upSource is not None and self.allocatedUpSource: self.upSource.free() self.allocatedUpSource = False self.upSource = None hal.clearCounterUpSource(self._counter)
def _freeCounter(counter): hal.setCounterUpdateWhenEmpty(counter, True) hal.clearCounterUpSource(counter) hal.clearCounterDownSource(counter) hal.freeCounter(counter)