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

changes made for railcom and CV programming changes #139

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "protocol.hxx"

/// Name of wifi accesspoint to connect to.
char WIFI_SSID[] = "moreland5107";
char WIFI_SSID[] = "CS_Test";
/// Password of wifi connection. If empty, use no encryption.
char WIFI_PASS[] = "synergy1";
char WIFI_PASS[] = "cstesting";
/// Hostname at which the OpenLCB hub is at.
char WIFI_HUB_HOSTNAME[] = "10.0.0.7";
/// Port number of the OpenLCB hub.
Expand Down
4 changes: 2 additions & 2 deletions src/freertos_drivers/ti/TivaDCC.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -945,13 +945,13 @@ TivaDCC<HW>::TivaDCC(const char *name, RailcomDriver* railcom_driver)

unsigned h_deadband = 2 * (HW::H_DEADBAND_DELAY_NSEC / 1000);
unsigned railcom_part = 0;
fill_timing(RAILCOM_CUTOUT_PRE, 6 - railcom_part, 0);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code here has an invariant that railcom_part is always set to the absolute microsecond that the sum of the previous RAILCOM_CUTOUT_XXX segments represent. This is used to compute the length of next part by a simple subtraction.
You broke this invariant, and after your changes it is impossible to reason what this code does. Please restore this invariant so we can merge this code.

fill_timing(RAILCOM_CUTOUT_PRE, 21, 0);
railcom_part = 6;
// was: 210
fill_timing(RAILCOM_CUTOUT_FIRST, 175 - railcom_part, 0);
railcom_part = 175;
fill_timing(RAILCOM_CUTOUT_SECOND, 471 - railcom_part, 0);
railcom_part = 471;
railcom_part = 555;
// remaining time
fill_timing(RAILCOM_CUTOUT_POST, 5*56*2 - railcom_part + h_deadband, 0);

Expand Down
3 changes: 3 additions & 0 deletions src/openlcb/TractionCvSpace.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ public:
~TractionCvSpace();

private:
// this value is taking into account CV's are 1-1024, in other parts of
// the code we account for the one off, at this point the valid range is
// 0-1023
static const unsigned MAX_CV = 1023;

bool set_node(Node *node) OVERRIDE;
Expand Down