diff --git a/EXRAIL2MacroReset.h b/EXRAIL2MacroReset.h index 5ca2e91..d44b244 100644 --- a/EXRAIL2MacroReset.h +++ b/EXRAIL2MacroReset.h @@ -196,7 +196,7 @@ #define ENDTASK #define ESTOP #define EXRAIL -#define EXTT_TURNTABLE(id,home,description) +#define EXTT_TURNTABLE(id,vpin,home,description) #define FADE(pin,value,ms) #define FOFF(func) #define FOLLOW(route) diff --git a/EXRAILMacros.h b/EXRAILMacros.h index 31bf0db..8e7fbb9 100644 --- a/EXRAILMacros.h +++ b/EXRAILMacros.h @@ -224,7 +224,7 @@ const FSH * RMFT2::getTurnoutDescription(int16_t turnoutid) { #undef DCC_TURNTABLE #define DCC_TURNTABLE(id,home,description...) O_DESC(id,description) #undef EXTT_TURNTABLE -#define EXTT_TURNTABLE(id,home,description...) O_DESC(id,description) +#define EXTT_TURNTABLE(id,vpin,home,description...) O_DESC(id,description) const FSH * RMFT2::getTurntableDescription(int16_t turntableId) { switch (turntableId) { @@ -354,7 +354,7 @@ int RMFT2::onLCCLookup[RMFT2::countLCCLookup]; #define ESTOP OPCODE_SPEED,V(1), #define EXRAIL #ifndef IO_NO_HAL -#define EXTT_TURNTABLE(id,home,description...) OPCODE_EXTTTURNTABLE,V(id),OPCODE_PAD,V(home), +#define EXTT_TURNTABLE(id,vpin,home,description...) OPCODE_EXTTTURNTABLE,V(id),OPCODE_PAD,V(vpin),OPCODE_PAD,V(home), #endif #define FADE(pin,value,ms) OPCODE_SERVO,V(pin),OPCODE_PAD,V(value),OPCODE_PAD,V(PCA9685::ProfileType::UseDuration|PCA9685::NoPowerOff),OPCODE_PAD,V(ms/100L), #define FOFF(func) OPCODE_FOFF,V(func), diff --git a/Turntables.cpp b/Turntables.cpp index daa71fa..ba143cb 100644 --- a/Turntables.cpp +++ b/Turntables.cpp @@ -183,7 +183,7 @@ using DevState = IODevice::DeviceStateEnum; return tto; } } - // if (!IODevice::exists(vpin)) return nullptr; + if (!IODevice::exists(vpin)) return nullptr; if (IODevice::getStatus(vpin) == DevState::DEVSTATE_FAILED) return nullptr; if (Turntable::getByVpin(vpin)) return nullptr; tto = (Turntable *)new EXTTTurntable(id, vpin);