Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TivaDCC Change Half Zero Resynchronization to a Full Zero #653

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/freertos_drivers/ti/TivaDCC.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -1069,9 +1069,27 @@ TivaDCC<HW>::TivaDCC(const char *name, RailcomDriver *railcom_driver)
/// @todo tune this bit to line up with the bit stream starting after the
/// railcom cutout.
fill_timing(DCC_RC_ONE, 57 << 1, 57, 57 << 1);

// The following #if switch controls whether or not the
// "generate_railcom_halfzero()" will actually generate a half zero bit
// or if it will in actuality generate a full zero bit. It was determined
// that the half zero workaround does not work with some older decoders,
// but the full zero workaround does. It also works with older decoders
// that needed the half zero, so it seems to be a true super-set workaround.
//
// There is an issue filed to reevaluate this after more field data is
// collected. The idea was to make the most minimal change necessary
// until more data can be collected.
// https://github.com/bakerstu/openmrn/issues/652
#if 0
// A small pulse in one direction then a half zero bit in the other
// direction.
fill_timing(DCC_RC_HALF_ZERO, 100 + 56, 56, 100 + 56, 5);
#else
// A full zero bit inserted following the RailCom cutout.
fill_timing(DCC_RC_HALF_ZERO, 100 << 1, 100, 100 << 1, 5);
#endif

// At the end of the packet the resync process will happen, which means that
// we modify the timer registers in synchronous mode instead of double
// buffering to remove any drift that may have happened during the packet.
Expand Down