diff --git a/OSBindings/Mac/Clock SignalTests/Bridges/DigitalPhaseLockedLoopBridge.h b/OSBindings/Mac/Clock SignalTests/Bridges/DigitalPhaseLockedLoopBridge.h index 9f39f0f7d..288305d6f 100644 --- a/OSBindings/Mac/Clock SignalTests/Bridges/DigitalPhaseLockedLoopBridge.h +++ b/OSBindings/Mac/Clock SignalTests/Bridges/DigitalPhaseLockedLoopBridge.h @@ -10,7 +10,7 @@ @interface DigitalPhaseLockedLoopBridge : NSObject -- (instancetype)initWithClocksPerBit:(NSUInteger)clocksPerBit tolerance:(NSUInteger)tolerance historyLength:(NSUInteger)historyLength; +- (instancetype)initWithClocksPerBit:(NSUInteger)clocksPerBit historyLength:(NSUInteger)historyLength; - (void)runForCycles:(NSUInteger)cycles; - (void)addPulse; diff --git a/OSBindings/Mac/Clock SignalTests/Bridges/DigitalPhaseLockedLoopBridge.mm b/OSBindings/Mac/Clock SignalTests/Bridges/DigitalPhaseLockedLoopBridge.mm index 7a4068f10..6bacff06d 100644 --- a/OSBindings/Mac/Clock SignalTests/Bridges/DigitalPhaseLockedLoopBridge.mm +++ b/OSBindings/Mac/Clock SignalTests/Bridges/DigitalPhaseLockedLoopBridge.mm @@ -19,42 +19,35 @@ class DigitalPhaseLockedLoopDelegate: public Storage::DigitalPhaseLockedLoop::De public: __weak DigitalPhaseLockedLoopBridge *bridge; - void digital_phase_locked_loop_output_bit(int value) - { + void digital_phase_locked_loop_output_bit(int value) { [bridge pushBit:value ? 1 : 0]; } }; -@implementation DigitalPhaseLockedLoopBridge -{ +@implementation DigitalPhaseLockedLoopBridge { std::unique_ptr _digitalPhaseLockedLoop; DigitalPhaseLockedLoopDelegate _delegate; } -- (instancetype)initWithClocksPerBit:(NSUInteger)clocksPerBit tolerance:(NSUInteger)tolerance historyLength:(NSUInteger)historyLength -{ +- (instancetype)initWithClocksPerBit:(NSUInteger)clocksPerBit historyLength:(NSUInteger)historyLength { self = [super init]; - if(self) - { - _digitalPhaseLockedLoop.reset(new Storage::DigitalPhaseLockedLoop((unsigned int)clocksPerBit, (unsigned int)tolerance, (unsigned int)historyLength)); + if(self) { + _digitalPhaseLockedLoop.reset(new Storage::DigitalPhaseLockedLoop((unsigned int)clocksPerBit, (unsigned int)historyLength)); _delegate.bridge = self; _digitalPhaseLockedLoop->set_delegate(&_delegate); } return self; } -- (void)runForCycles:(NSUInteger)cycles -{ +- (void)runForCycles:(NSUInteger)cycles { _digitalPhaseLockedLoop->run_for_cycles((unsigned int)cycles); } -- (void)addPulse -{ +- (void)addPulse { _digitalPhaseLockedLoop->add_pulse(); } -- (void)pushBit:(int)value -{ +- (void)pushBit:(int)value { _stream = (_stream << 1) | value; } diff --git a/OSBindings/Mac/Clock SignalTests/DPLLTests.swift b/OSBindings/Mac/Clock SignalTests/DPLLTests.swift index 67113b928..889efba23 100644 --- a/OSBindings/Mac/Clock SignalTests/DPLLTests.swift +++ b/OSBindings/Mac/Clock SignalTests/DPLLTests.swift @@ -26,22 +26,22 @@ class DPLLTests: XCTestCase { } func testPerfectInput() { - let pll = DigitalPhaseLockedLoopBridge(clocksPerBit: 100, tolerance: 20, historyLength: 3) + let pll = DigitalPhaseLockedLoopBridge(clocksPerBit: 100, historyLength: 3) testRegularNibblesOnPLL(pll!, bitLength: 100) } func testFastButRegular() { - let pll = DigitalPhaseLockedLoopBridge(clocksPerBit: 100, tolerance: 20, historyLength: 3) + let pll = DigitalPhaseLockedLoopBridge(clocksPerBit: 100, historyLength: 3) testRegularNibblesOnPLL(pll!, bitLength: 90) } func testSlowButRegular() { - let pll = DigitalPhaseLockedLoopBridge(clocksPerBit: 100, tolerance: 20, historyLength: 3) + let pll = DigitalPhaseLockedLoopBridge(clocksPerBit: 100, historyLength: 3) testRegularNibblesOnPLL(pll!, bitLength: 110) } func testTwentyPercentSinePattern() { - let pll = DigitalPhaseLockedLoopBridge(clocksPerBit: 100, tolerance: 20, historyLength: 3) + let pll = DigitalPhaseLockedLoopBridge(clocksPerBit: 100, historyLength: 3) var angle = 0.0 // clock in two 1s, a 0, and a 1, 200 times over