diff --git a/DCCEXParser.cpp b/DCCEXParser.cpp index 4823e8e..e6bd814 100644 --- a/DCCEXParser.cpp +++ b/DCCEXParser.cpp @@ -1035,17 +1035,17 @@ bool DCCEXParser::parseI(Print *stream, int16_t params, int16_t p[]) case 0: // list turntable objects return Turntable::printAll(stream); - case 1: // delete turntable + case 1: // delete turntable if (!Turntable::remove(p[0])) return false; StringFormatter::send(stream, F("\n")); return true; - case 2: // - rotate to position for DCC turntables + case 2: // - rotate to position for DCC turntables DIAG(F("Rotate DCC turntable %d to position %d"), p[0], p[1]); return true; - case 3: // rotate to position for EX-Turntable + case 3: // rotate to position for EX-Turntable DIAG(F("Rotate EXTT turntable %d to angle %d with activity %d"), p[0], p[1], p[2]); return true; diff --git a/Turntables.cpp b/Turntables.cpp index 67dc8c0..5aaf9f0 100644 --- a/Turntables.cpp +++ b/Turntables.cpp @@ -74,7 +74,7 @@ bool Turntable::remove(uint16_t id) { pp->_nextTurntable = tto->_nextTurntable; } - // delete (EXTTTurntable *)tto; + delete (EXTTTurntable *)tto; turntablelistHash++; return true; diff --git a/Turntables.h b/Turntables.h index 2fa4255..c7bb394 100644 --- a/Turntables.h +++ b/Turntables.h @@ -57,6 +57,12 @@ protected: uint16_t id; } _turntableData; + // Linked list to store either positions (EXTT) or DCC addresses (DCC) + struct Position { + int16_t position; + Position *next; + }; + // Pointer to next turntable object Turntable *_nextTurntable = 0; @@ -146,7 +152,6 @@ private: struct EXTTTurntableData { uint8_t i2caddress; VPIN vpin; - long **positions; // Array of longs to store step positions } _exttTurntableData; // Constructor