mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-12-25 13:41:23 +01:00
Broadcasts working
This commit is contained in:
parent
798241927f
commit
bcb250bacf
@ -71,6 +71,12 @@ void EXTurntable::_loop(unsigned long currentMicros) {
|
|||||||
uint8_t readBuffer[1];
|
uint8_t readBuffer[1];
|
||||||
I2CManager.read(_I2CAddress, readBuffer, 1);
|
I2CManager.read(_I2CAddress, readBuffer, 1);
|
||||||
_stepperStatus = readBuffer[0];
|
_stepperStatus = readBuffer[0];
|
||||||
|
if (_stepperStatus < 2) {
|
||||||
|
if (_stepperStatus != _previousStatus) {
|
||||||
|
_broadcastStatus(_firstVpin, _stepperStatus);
|
||||||
|
_previousStatus = _stepperStatus;
|
||||||
|
}
|
||||||
|
}
|
||||||
// DIAG(F("Turntable-EX returned status: %d"), _stepperStatus);
|
// DIAG(F("Turntable-EX returned status: %d"), _stepperStatus);
|
||||||
delayUntil(currentMicros + 500000); // Wait 500ms before checking again, turntables turn slowly
|
delayUntil(currentMicros + 500000); // Wait 500ms before checking again, turntables turn slowly
|
||||||
}
|
}
|
||||||
@ -83,10 +89,6 @@ int EXTurntable::_read(VPIN vpin) {
|
|||||||
if (_stepperStatus > 1) {
|
if (_stepperStatus > 1) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
if (_stepperStatus != _previousStatus) {
|
|
||||||
_broadcastStatus(vpin, _stepperStatus);
|
|
||||||
_previousStatus = _stepperStatus;
|
|
||||||
}
|
|
||||||
return _stepperStatus;
|
return _stepperStatus;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user