mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-27 01:56:14 +01:00
Initialise turnouts to Closed by default
Ensure that the servo, VPIN and LCN turnouts are all initialised to closed if no initial state is provided in the create call or in EEPROM. This applies irrespective of the RCN-213 configuration settings.
This commit is contained in:
parent
f0cd96fed3
commit
69c4733f2b
11
Turnouts.h
11
Turnouts.h
|
@ -186,8 +186,7 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Create function
|
// Create function
|
||||||
// If the initial state isn't specified, use true for RCN-213 consistency and false for DCC++ classic compatibility.
|
static Turnout *create(uint16_t id, VPIN vpin, uint16_t thrownPosition, uint16_t closedPosition, uint8_t profile, bool closed=true);
|
||||||
static Turnout *create(uint16_t id, VPIN vpin, uint16_t thrownPosition, uint16_t closedPosition, uint8_t profile, bool closed = !useClassicTurnoutCommands);
|
|
||||||
|
|
||||||
// Load a Servo turnout definition from EEPROM. The common Turnout data has already been read at this point.
|
// Load a Servo turnout definition from EEPROM. The common Turnout data has already been read at this point.
|
||||||
static Turnout *load(struct TurnoutData *turnoutData);
|
static Turnout *load(struct TurnoutData *turnoutData);
|
||||||
|
@ -223,7 +222,7 @@ public:
|
||||||
// Load a VPIN turnout definition from EEPROM. The common Turnout data has already been read at this point.
|
// Load a VPIN turnout definition from EEPROM. The common Turnout data has already been read at this point.
|
||||||
static Turnout *load(struct TurnoutData *turnoutData);
|
static Turnout *load(struct TurnoutData *turnoutData);
|
||||||
void print(Print *stream) override;
|
void print(Print *stream) override;
|
||||||
|
// Flag whether DCC Accessory packets are to contain 1=close/0=throw(RCN-213) or 1=throw/0-close (DCC++ Classic)
|
||||||
static const bool rcn213Compliant;
|
static const bool rcn213Compliant;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -250,8 +249,7 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Create function
|
// Create function
|
||||||
// If the initial state isn't specified, use true for RCN-213 consistency and false for DCC++ classic compatibility.
|
static Turnout *create(uint16_t id, VPIN vpin, bool closed=true);
|
||||||
static Turnout *create(uint16_t id, VPIN vpin, bool closed=!useClassicTurnoutCommands);
|
|
||||||
|
|
||||||
// Load a VPIN turnout definition from EEPROM. The common Turnout data has already been read at this point.
|
// Load a VPIN turnout definition from EEPROM. The common Turnout data has already been read at this point.
|
||||||
static Turnout *load(struct TurnoutData *turnoutData);
|
static Turnout *load(struct TurnoutData *turnoutData);
|
||||||
|
@ -279,8 +277,7 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Create function
|
// Create function
|
||||||
// If the initial state isn't specified, use true for RCN-213 consistency and false for DCC++ classic compatibility.
|
static Turnout *create(uint16_t id, bool closed=true);
|
||||||
static Turnout *create(uint16_t id, bool closed=!useClassicTurnoutCommands);
|
|
||||||
|
|
||||||
|
|
||||||
bool setClosedInternal(bool close) override;
|
bool setClosedInternal(bool close) override;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user