mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Added the PLL phase adjustment stuff to the decoder. Much better decodes.
This commit is contained in:
@@ -4,6 +4,14 @@
|
|||||||
#include "decoders/fluxdecoder.h"
|
#include "decoders/fluxdecoder.h"
|
||||||
#include "lib/decoders/decoders.pb.h"
|
#include "lib/decoders/decoders.pb.h"
|
||||||
|
|
||||||
|
/* This is a port of the samdisk code:
|
||||||
|
*
|
||||||
|
* https://github.com/simonowen/samdisk/blob/master/src/FluxDecoder.cpp
|
||||||
|
*
|
||||||
|
* I'm not actually terribly sure how it works, but it does, and much better
|
||||||
|
* than my code.
|
||||||
|
*/
|
||||||
|
|
||||||
FluxDecoder::FluxDecoder(FluxmapReader* fmr, nanoseconds_t bitcell,
|
FluxDecoder::FluxDecoder(FluxmapReader* fmr, nanoseconds_t bitcell,
|
||||||
const DecoderProto& config):
|
const DecoderProto& config):
|
||||||
_fmr(fmr),
|
_fmr(fmr),
|
||||||
@@ -71,6 +79,12 @@ bool FluxDecoder::readBit()
|
|||||||
|
|
||||||
_clock = std::min(std::max(_clock_min, _clock), _clock_max);
|
_clock = std::min(std::max(_clock_min, _clock), _clock_max);
|
||||||
|
|
||||||
|
/* I'm not sure what this does, but the original comment is:
|
||||||
|
* Authentic PLL: Do not snap the timing window to each flux transition
|
||||||
|
*/
|
||||||
|
|
||||||
|
_flux = _flux * (1.0 - _pll_phase);
|
||||||
|
|
||||||
_goodbits++;
|
_goodbits++;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user