1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-06-29 18:45:23 +02:00

Do not call onRailSyncOnLookup/onRailSyncOffLookup when NULL

This commit is contained in:
Harald Barth 2025-04-18 00:22:20 +02:00
parent 97f50910f6
commit b63703a365
2 changed files with 8 additions and 5 deletions

View File

@ -1359,10 +1359,13 @@ void RMFT2::powerEvent(int16_t track, bool overload) {
void RMFT2::railsyncEvent(bool on) { void RMFT2::railsyncEvent(bool on) {
if (Diag::CMD) if (Diag::CMD)
DIAG(F("railsyncEvent : %d"), on); DIAG(F("railsyncEvent : %d"), on);
if (on) if (on) {
if (onRailSyncOnLookup)
onRailSyncOnLookup->handleEvent(F("RAILSYNCON"), 0); onRailSyncOnLookup->handleEvent(F("RAILSYNCON"), 0);
else } else {
if (onRailSyncOffLookup)
onRailSyncOffLookup->handleEvent(F("RAILSYNCOFF"), 0); onRailSyncOffLookup->handleEvent(F("RAILSYNCOFF"), 0);
}
} }
#endif #endif
// This function is used when setting pins so that a SET or RESET // This function is used when setting pins so that a SET or RESET

View File

@ -1 +1 @@
#define GITHUB_SHA "devel-202504171929Z" #define GITHUB_SHA "devel-202504172219Z"