1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-07-28 18:03:45 +02:00

Remove 'activate' functions from turnout classes.

Remove the static 'activate' function and rename the virtual 'activate' function to 'setClosedInternal'.
This commit is contained in:
Neil McKechnie
2021-08-22 14:07:16 +01:00
parent 39a69e340e
commit 0875d27b0a
2 changed files with 12 additions and 16 deletions

View File

@@ -106,11 +106,11 @@
return false;
}
// Static activate function is invoked from close(), throw() etc. to perform the
// Static setClosed function is invoked from close(), throw() etc. to perform the
// common parts of the turnout operation. Code which is specific to a turnout
// type should be placed in the virtual function activate(bool) which is
// type should be placed in the virtual function setClosedInternal(bool) which is
// called from here.
bool Turnout::activate(uint16_t id, bool closeFlag) {
bool Turnout::setClosed(uint16_t id, bool closeFlag) {
#ifdef EESTOREDEBUG
if (closeFlag)
DIAG(F("Turnout::close(%d)"), id);
@@ -119,7 +119,7 @@
#endif
Turnout *tt = Turnout::get(id);
if (!tt) return false;
bool ok = tt->activate(closeFlag);
bool ok = tt->setClosedInternal(closeFlag);
if (ok) {
// Write byte containing new closed/thrown state to EEPROM if required. Note that eepromAddress