1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-23 08:06:13 +01:00

Move Turnout code from .h to .cpp.

Move implementation of Turnout::printState from Turnouts.h to Turnouts.cpp.  No functional changes.
This commit is contained in:
Neil McKechnie 2021-08-22 22:30:09 +01:00
parent 7b47b86143
commit fdaa7b51b9
2 changed files with 6 additions and 4 deletions

View File

@ -74,6 +74,11 @@
turnoutlistHash++; turnoutlistHash++;
} }
void Turnout::printState(Print *stream) {
StringFormatter::send(stream, F("<H %d %d>\n"),
_turnoutData.id, _turnoutData.closed ^ useLegacyTurnoutBehaviour);
}
// Remove nominated turnout from turnout linked list and delete the object. // Remove nominated turnout from turnout linked list and delete the object.
bool Turnout::remove(uint16_t id) { bool Turnout::remove(uint16_t id) {
Turnout *tt,*pp=NULL; Turnout *tt,*pp=NULL;

View File

@ -114,10 +114,7 @@ public:
inline bool isType(uint8_t type) { return _turnoutData.turnoutType == type; } inline bool isType(uint8_t type) { return _turnoutData.turnoutType == type; }
inline uint16_t getId() { return _turnoutData.id; } inline uint16_t getId() { return _turnoutData.id; }
inline Turnout *next() { return _nextTurnout; } inline Turnout *next() { return _nextTurnout; }
inline void printState(Print *stream) { void printState(Print *stream);
StringFormatter::send(stream, F("<H %d %d>\n"),
_turnoutData.id, _turnoutData.closed ^ useLegacyTurnoutBehaviour);
}
/* /*
* Virtual functions * Virtual functions
*/ */