Enable motordelay for tilt operations (#18330)

* implement motordelay also for tilt operations

* enable motordelay for tilt operations

* Update xdrv_27_esp32_shutter.ino
This commit is contained in:
stefanbode 2023-04-04 17:45:33 +02:00 committed by GitHub
parent f109d6ff72
commit b287d05098
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -977,8 +977,8 @@ int32_t ShutterCalculatePosition(uint32_t i)
case SHT_TIME_UP_DOWN:
case SHT_TIME_GARAGE:
if (Shutter[i].tilt_config[2] > 0) {
if (Shutter[i].time <= Shutter[i].venetian_delay) {
Shutter[i].tilt_real_pos = (Shutter[i].tilt_start_pos + ((Shutter[i].direction * (int16_t)Shutter[i].time * (Shutter[i].tilt_config[1]-Shutter[i].tilt_config[0])) / Shutter[i].tilt_config[2]));
if (Shutter[i].time <= Shutter[i].venetian_delay+Shutter[i].motordelay) {
Shutter[i].tilt_real_pos = (Shutter[i].tilt_start_pos + ((Shutter[i].direction * (int16_t)(Shutter[i].time - tmin(Shutter[i].motordelay, Shutter[i].time)) * (Shutter[i].tilt_config[1]-Shutter[i].tilt_config[0])) / Shutter[i].tilt_config[2]));
} else {
Shutter[i].tilt_real_pos = Shutter[i].direction == 1 ? Shutter[i].tilt_config[1] : Shutter[i].tilt_config[0];
}

View File

@ -815,8 +815,8 @@ int32_t ShutterCalculatePosition(uint32_t i)
case SHT_TIME_UP_DOWN:
case SHT_TIME_GARAGE:
if (Shutter[i].tilt_config[2] > 0) {
if (Shutter[i].time <= Shutter[i].venetian_delay) {
Shutter[i].tilt_real_pos = (Shutter[i].tilt_start_pos + ((Shutter[i].direction * (int16_t)Shutter[i].time * (Shutter[i].tilt_config[1]-Shutter[i].tilt_config[0])) / Shutter[i].tilt_config[2]));
if (Shutter[i].time <= Shutter[i].venetian_delay+Shutter[i].motordelay) {
Shutter[i].tilt_real_pos = (Shutter[i].tilt_start_pos + ((Shutter[i].direction * (int16_t)(Shutter[i].time - tmin(Shutter[i].motordelay, Shutter[i].time)) * (Shutter[i].tilt_config[1]-Shutter[i].tilt_config[0])) / Shutter[i].tilt_config[2]));
} else {
Shutter[i].tilt_real_pos = Shutter[i].direction == 1 ? Shutter[i].tilt_config[1] : Shutter[i].tilt_config[0];
}