From bcb250bacfc8b2e7a60810dd5b20d0f1da737863 Mon Sep 17 00:00:00 2001 From: peteGSX Date: Fri, 1 Sep 2023 18:30:02 +1000 Subject: [PATCH] Broadcasts working --- IO_EXTurntable.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/IO_EXTurntable.cpp b/IO_EXTurntable.cpp index bf06e62..59a65d9 100644 --- a/IO_EXTurntable.cpp +++ b/IO_EXTurntable.cpp @@ -71,6 +71,12 @@ void EXTurntable::_loop(unsigned long currentMicros) { uint8_t readBuffer[1]; I2CManager.read(_I2CAddress, readBuffer, 1); _stepperStatus = readBuffer[0]; + if (_stepperStatus < 2) { + if (_stepperStatus != _previousStatus) { + _broadcastStatus(_firstVpin, _stepperStatus); + _previousStatus = _stepperStatus; + } + } // DIAG(F("Turntable-EX returned status: %d"), _stepperStatus); delayUntil(currentMicros + 500000); // Wait 500ms before checking again, turntables turn slowly } @@ -83,10 +89,6 @@ int EXTurntable::_read(VPIN vpin) { if (_stepperStatus > 1) { return false; } else { - if (_stepperStatus != _previousStatus) { - _broadcastStatus(vpin, _stepperStatus); - _previousStatus = _stepperStatus; - } return _stepperStatus; } }