Remove the _Edge base class from ClockCycles
Rationale:
* ClockCycles shares only one line of implementation with _Edge, and it's easier just to repeat it.
* ClockCycles doesn't make much sense as a subclass of _Edge
* _Edge is private anyway, so no consumer of the public API will care
@@ -280,12 +280,13 @@ def FallingEdge(signal):
return signal._f_edge
-class ClockCycles(_Edge):
+class ClockCycles(GPITrigger):
"""
Execution will resume after N rising edges or N falling edges
"""
def __init__(self, signal, num_cycles, rising=True):
- _Edge.__init__(self, signal)
+ super(ClockCycles, self).__init__()
+ self.signal = signal
self.num_cycles = num_cycles
if rising is True:
self._rising = 1
