Additional limit check on tilt changes (#18364)

* limit check on tilt position

* limit check on tilt changes
This commit is contained in:
stefanbode 2023-04-08 09:40:38 +02:00 committed by GitHub
parent 545c6a3511
commit 86be6c8a3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -1428,7 +1428,7 @@ void CmndShutterPosition(void)
//override tiltposition if explicit set (shutterbutton)
if (Shutter[index].tilt_target_pos_override != -128) {
Shutter[index].tilt_target_pos = Shutter[index].tilt_target_pos_override;
Shutter[index].tilt_target_pos = tmin(tmax( Shutter[index].tilt_config[0],Shutter[index].tilt_target_pos_override ), Shutter[index].tilt_config[1]);
Shutter[index].tilt_target_pos_override = -128;
}

View File

@ -1343,7 +1343,7 @@ void CmndShutterPosition(void)
// manual override of tiltposition
if (Shutter[index].tilt_target_pos_override != -128) {
Shutter[index].tilt_target_pos = Shutter[index].tilt_target_pos_override;
Shutter[index].tilt_target_pos = tmin(tmax( Shutter[index].tilt_config[0],Shutter[index].tilt_target_pos_override ), Shutter[index].tilt_config[1]);
Shutter[index].tilt_target_pos_override = -128;
}