mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-24 11:16:34 +00:00
Fix shutter-stepper driver if >1 door moving
Accelerate and decelerate did not work properly on two pins with different frequencies. Was always synced to the last send frequency without PIN awareness. If moving two doors or more frequency must work for each door independent
This commit is contained in:
parent
7df607f471
commit
a627df0ad1
@ -175,8 +175,10 @@ void ShutterRtc50mS(void)
|
||||
if (Shutter[i].accelerator) {
|
||||
//AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("SHT: Accelerator i=%d -> %d"),i, Shutter[i].accelerator);
|
||||
ShutterUpdateVelocity(i);
|
||||
analogWriteFreq(Shutter[i].pwm_velocity);
|
||||
analogWrite(Pin(GPIO_PWM1, i), 50);
|
||||
digitalWrite(Pin(GPIO_PWM1, i), LOW);
|
||||
// Convert frequency into clock cycles
|
||||
uint32_t cc = microsecondsToClockCycles(1000000UL) / Shutter[i].pwm_velocity;
|
||||
startWaveformClockCycles(Pin(GPIO_PWM1, i), cc/2, cc/2, 0, -1, 0, false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user