* Fix #18198

Fix wrong movement with tilt if additional endstop defined

* simplify
This commit is contained in:
stefanbode 2023-03-16 14:38:04 +01:00 committed by GitHub
parent 09255d6373
commit d0f4637611
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1274,8 +1274,8 @@ void CmndShutterPosition(void)
(abs(Shutter[index].target_position - Shutter[index].real_position ) > Shutter[index].min_realPositionChange ||
abs(Shutter[index].tilt_target_pos - Shutter[index].tilt_real_pos ) > Shutter[index].min_TiltChange) ) {
if (Settings->shutter_options[index] & 4) {
if (0 == target_pos_percent) Shutter[index].target_position -= 1 * RESOLUTION * STEPS_PER_SECOND;
if (100 == target_pos_percent) Shutter[index].target_position += 1 * RESOLUTION * STEPS_PER_SECOND;
if (0 == target_pos_percent && Shutter[index].real_position > 0) Shutter[index].target_position -= 1 * RESOLUTION * STEPS_PER_SECOND;
if (100 == target_pos_percent && Shutter[index].real_position < Shutter[index].open_max) Shutter[index].target_position += 1 * RESOLUTION * STEPS_PER_SECOND;
}
int8_t new_shutterdirection;
if (abs(Shutter[index].target_position - Shutter[index].real_position ) > Shutter[index].min_realPositionChange) {