]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/arducontrol.h
Use current monitoring to detect failed turnouts
[r2c2.git] / source / libr2c2 / arducontrol.h
index 555280985767a7e37ea512607a0337359ac11618..c3ca7a4106f570a418a6a7166a19a9048c1bcf67 100644 (file)
@@ -117,6 +117,7 @@ private:
 
                bool set(T v) { if(v==pending) return false; pending = v; ++serial; return true; }
                bool commit(unsigned short s) { if(s!=serial) return false; current = pending; return true; }
+               void rollback() { pending = current; ++serial; }
 
                operator T() const { return current; }
        };
@@ -173,6 +174,7 @@ private:
                unsigned address;
                unsigned bits;
                ControlledVariable<unsigned> state;
+               unsigned uncertain;
                unsigned target;
                Msp::Time::TimeDelta active_time;