1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-23 21:01:25 +01:00

Merge branch 'ServoSignal' into TrackManager

This commit is contained in:
Asbelos 2022-04-29 17:09:13 +01:00
commit acd6e7560f

View File

@ -114,7 +114,6 @@ void PCA9685::_begin() {
// Device-specific write function, invoked from IODevice::write(). // Device-specific write function, invoked from IODevice::write().
// For this function, the configured profile is used. // For this function, the configured profile is used.
void PCA9685::_write(VPIN vpin, int value) { void PCA9685::_write(VPIN vpin, int value) {
if (_deviceState == DEVSTATE_FAILED) return;
#ifdef DIAG_IO #ifdef DIAG_IO
DIAG(F("PCA9685 Write Vpin:%d Value:%d"), vpin, value); DIAG(F("PCA9685 Write Vpin:%d Value:%d"), vpin, value);
#endif #endif
@ -125,7 +124,10 @@ void PCA9685::_write(VPIN vpin, int value) {
if (s != NULL) { if (s != NULL) {
// Use configured parameters // Use configured parameters
_writeAnalogue(vpin, value ? s->activePosition : s->inactivePosition, s->profile, s->duration); _writeAnalogue(vpin, value ? s->activePosition : s->inactivePosition, s->profile, s->duration);
} // else { /* ignorethe request */ } } else {
/* simulate digital pin on PWM */
_writeAnalogue(vpin, value ? 4095 : 0, Instant, 0);
}
} }
// Device-specific writeAnalogue function, invoked from IODevice::writeAnalogue(). // Device-specific writeAnalogue function, invoked from IODevice::writeAnalogue().