From f7557f143660e5bf22683bbc06a05ed1254b7d6f Mon Sep 17 00:00:00 2001 From: Asbelos Date: Thu, 20 Aug 2020 12:38:09 +0100 Subject: [PATCH] Turn out changes for WiThrottle --- Turnouts.cpp | 5 +++++ Turnouts.h | 1 + 2 files changed, 6 insertions(+) diff --git a/Turnouts.cpp b/Turnouts.cpp index 0343168..ceff11f 100644 --- a/Turnouts.cpp +++ b/Turnouts.cpp @@ -29,6 +29,7 @@ if (tt==NULL) return false; tt->activate(state); if(n>0) EEPROM.put(n,tt->data.tStatus); + turnoutlistHash++; return true; } @@ -68,6 +69,7 @@ bool Turnout::remove(int n){ pp->nextTurnout=tt->nextTurnout; free(tt); + turnoutlistHash++; return true; } @@ -150,8 +152,11 @@ Turnout *Turnout::create(int id){ firstTurnout=tt; tt->data.id=id; } + turnoutlistHash++; return tt; } /////////////////////////////////////////////////////////////////////////////// Turnout *Turnout::firstTurnout=NULL; +int Turnout::turnoutlistHash=0; //bump on every change so clients know when to refresh their lists + diff --git a/Turnouts.h b/Turnouts.h index 3287d76..6c08dc2 100644 --- a/Turnouts.h +++ b/Turnouts.h @@ -36,6 +36,7 @@ struct TurnoutData { class Turnout { public: static Turnout *firstTurnout; + static int turnoutlistHash; TurnoutData data; Turnout *nextTurnout; static bool activate(int n, bool state);