1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-02 20:30:00 +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:
Thomas Harte 2017-07-16 17:12:12 -04:00
parent ba83dfd454
commit e71d13c090
2 changed files with 5 additions and 3 deletions

View File

@ -61,8 +61,10 @@ void DigitalPhaseLockedLoop::post_phase_offset(int phase, int offset) {
total_divisor += multiple;
total_spacing += offset;
}
window_length_ = total_spacing / total_divisor;
window_length_ = std::max(std::min(window_length_, clocks_per_bit_ + tolerance_), clocks_per_bit_ - tolerance_);
if(total_divisor) {
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);

View File

@ -160,7 +160,7 @@ template <typename SymbolType> class PLLParser:
/// Instantiates a new parser with the supplied @c tape.
PLLParser(int clock_rate, int clocks_per_bit, int tolerance) :
clock_rate_(clock_rate),
pll_(clocks_per_bit, tolerance, 3),
pll_(clocks_per_bit, tolerance, 15),
input_bit_counter_(0),
input_pattern_(0),
was_high_(false) {