mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-26 23:52:26 +00:00
Attempted to simplify, very slightly.
This commit is contained in:
parent
015cea494d
commit
5c1614ce7b
@ -26,19 +26,19 @@ DigitalPhaseLockedLoop::DigitalPhaseLockedLoop(int clocks_per_bit, int tolerance
|
|||||||
|
|
||||||
void DigitalPhaseLockedLoop::run_for_cycles(int number_of_cycles)
|
void DigitalPhaseLockedLoop::run_for_cycles(int number_of_cycles)
|
||||||
{
|
{
|
||||||
// check whether this triggers any 0s
|
|
||||||
_phase += number_of_cycles;
|
_phase += number_of_cycles;
|
||||||
|
int windows_crossed = _phase / _window_length;
|
||||||
|
if(windows_crossed)
|
||||||
|
{
|
||||||
|
// check whether this triggers any 0s, if anybody cares
|
||||||
if(_delegate)
|
if(_delegate)
|
||||||
{
|
{
|
||||||
while(_phase > _window_length)
|
if(_window_was_filled) windows_crossed--;
|
||||||
{
|
for(int c = 0; c < windows_crossed; c++)
|
||||||
if(!_window_was_filled) _delegate->digital_phase_locked_loop_output_bit(0);
|
_delegate->digital_phase_locked_loop_output_bit(0);
|
||||||
|
}
|
||||||
|
|
||||||
_window_was_filled = false;
|
_window_was_filled = false;
|
||||||
_phase -= _window_length;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_phase %= _window_length;
|
_phase %= _window_length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user