Skip to content

Commit

Permalink
Fix build of esp8266 train implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsracz committed Jun 20, 2024
1 parent b15b4d1 commit 7a7a2fc
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ class ESPHuzzahTrain : public openlcb::TrainImpl
void set_speed(openlcb::SpeedType speed) override
{
lastSpeed_ = speed;
estop = false;
g_speed_controller.call_speed(speed);
if (f0)
{
Expand All @@ -257,10 +258,16 @@ class ESPHuzzahTrain : public openlcb::TrainImpl
/** Sets the train to emergency stop. */
void set_emergencystop() override
{
// g_speed_controller.call_estop();
g_speed_controller.call_estop();
lastSpeed_.set_mph(0); // keeps direction
estop = true;
}

bool get_emergencystop() override
{
return estop;
}

/** Sets the value of a function.
* @param address is a 24-bit address of the function to set. For legacy DCC
* locomotives, see @ref TractionDefs for the address definitions (0=light,
Expand Down Expand Up @@ -331,6 +338,7 @@ class ESPHuzzahTrain : public openlcb::TrainImpl
openlcb::SpeedType lastSpeed_ = 0.0;
bool f0 = false;
bool f1 = false;
bool estop = false;
};

const char kFdiXml[] =
Expand Down

0 comments on commit 7a7a2fc

Please sign in to comment.