mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-12-23 21:01:25 +01:00
Update IO_PCA9685.cpp
This commit is contained in:
parent
afd94f0645
commit
c58a126dfc
@ -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().
|
||||||
|
Loading…
Reference in New Issue
Block a user