mirror of
https://github.com/TomHarte/CLK.git
synced 2024-10-02 19:54:35 +00:00
With the new PLL implementation, switching to a deeper window size returns the Acorn tape parser to: working.
This commit is contained in:
parent
ba83dfd454
commit
e71d13c090
@ -61,8 +61,10 @@ void DigitalPhaseLockedLoop::post_phase_offset(int phase, int offset) {
|
|||||||
total_divisor += multiple;
|
total_divisor += multiple;
|
||||||
total_spacing += offset;
|
total_spacing += offset;
|
||||||
}
|
}
|
||||||
window_length_ = total_spacing / total_divisor;
|
if(total_divisor) {
|
||||||
window_length_ = std::max(std::min(window_length_, clocks_per_bit_ + tolerance_), clocks_per_bit_ - tolerance_);
|
window_length_ = total_spacing / total_divisor;
|
||||||
|
window_length_ = std::max(std::min(window_length_, clocks_per_bit_ + tolerance_), clocks_per_bit_ - tolerance_);
|
||||||
|
}
|
||||||
|
|
||||||
int error = phase - (window_length_ >> 1);
|
int error = phase - (window_length_ >> 1);
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ template <typename SymbolType> class PLLParser:
|
|||||||
/// Instantiates a new parser with the supplied @c tape.
|
/// Instantiates a new parser with the supplied @c tape.
|
||||||
PLLParser(int clock_rate, int clocks_per_bit, int tolerance) :
|
PLLParser(int clock_rate, int clocks_per_bit, int tolerance) :
|
||||||
clock_rate_(clock_rate),
|
clock_rate_(clock_rate),
|
||||||
pll_(clocks_per_bit, tolerance, 3),
|
pll_(clocks_per_bit, tolerance, 15),
|
||||||
input_bit_counter_(0),
|
input_bit_counter_(0),
|
||||||
input_pattern_(0),
|
input_pattern_(0),
|
||||||
was_high_(false) {
|
was_high_(false) {
|
||||||
|
Loading…
Reference in New Issue
Block a user