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

Servo positioning - correct handling of profile 0.

Ensure that profile 0 uses the duration parameter to calculate the number of steps.
This commit is contained in:
Neil McKechnie 2021-08-27 16:59:04 +01:00
parent 6ebf908802
commit f8858b952e

View File

@ -161,8 +161,7 @@ void PCA9685::_writeAnalogue(VPIN vpin, int value, uint8_t profile, uint16_t dur
// Animated profile. Initiate the appropriate action.
s->currentProfile = profile;
uint8_t profileValue = profile & ~NoPowerOff; // Mask off 'don't-power-off' bit.
s->numSteps = profileValue==Instant ? 1 :
profileValue==Fast ? 10 : // 0.5 seconds
s->numSteps = profileValue==Fast ? 10 : // 0.5 seconds
profileValue==Medium ? 20 : // 1.0 seconds
profileValue==Slow ? 40 : // 2.0 seconds
profileValue==Bounce ? sizeof(_bounceProfile)-1 : // ~ 1.5 seconds