Skip to content

Commit

Permalink
Minor progress
Browse files Browse the repository at this point in the history
  • Loading branch information
peteGSX committed Aug 27, 2023
1 parent 1425da2 commit 2202cb0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions DCCEXParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1060,15 +1060,15 @@ bool DCCEXParser::parseI(Print *stream, int16_t params, int16_t p[])

default: // If we're here, it must be creating a turntable object
{
DIAG(F("Params: %d"), params);
if (params > 5 && params < 41 && p[1] == HASH_KEYWORD_EXTT) {
DIAG(F("Create EXTT turntable %d on vpin %d and address %d with %d positions"), p[0], p[2], p[3], params - 4);
if (Turntable::get(p[0])) return false;
if (!EXTTTurntable::create(p[0], (VPIN)p[2], (uint8_t)p[3])) return false;
Turntable *tto = Turntable::get(p[0]);
for ( uint8_t i = params - 4; i > 0; i--) {
for (uint8_t i = params - 4; i > 0; i--) {
tto->addPosition(p[i + 3]);
DIAG(F("Add position %d"), p[i + 3]);
}
tto->addPosition(0); // Need to add position 0 as 0 so positions start at 1
} else if (params > 3 && params < 39 && p[1] == HASH_KEYWORD_DCC) {
DIAG(F("Create DCC turntable %d at base address %d with %d positions"), p[0], p[2], params - 2);
} else {
Expand Down
1 change: 1 addition & 0 deletions IO_EXTurntable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ EXTurntable::EXTurntable(VPIN firstVpin, int nPins, I2CAddress I2CAddress) {
void EXTurntable::_begin() {
I2CManager.begin();
if (I2CManager.exists(_I2CAddress)) {
DIAG(F("EX-Turntable device found, I2C:%s"), _I2CAddress.toString());
#ifdef DIAG_IO
_display();
#endif
Expand Down

0 comments on commit 2202cb0

Please sign in to comment.