Update xdrv_27_shutter.ino

#12849 Additional side effect correction
This commit is contained in:
stefanbode 2021-09-05 22:07:50 +02:00 committed by GitHub
parent 225d757834
commit 5ef1ec5d0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -431,7 +431,7 @@ void ShutterDecellerateForStop(uint8_t i)
//prepare for stop PWM //prepare for stop PWM
Shutter[i].accelerator = 0; Shutter[i].accelerator = 0;
Shutter[i].pwm_velocity = 0; Shutter[i].pwm_velocity = 0;
while (RtcSettings.pulse_counter[i] < (uint32_t)(Shutter[i].target_position-Shutter[i].start_position)*Shutter[i].direction*ShutterGlobal.open_velocity_max/RESOLUTION/STEPS_PER_SECOND) { while (RtcSettings.pulse_counter[i] < (uint32_t)(Shutter[i].target_position-Shutter[i].start_position)*Shutter[i].direction*ShutterGlobal.open_velocity_max/RESOLUTION/STEPS_PER_SECOND && missing_steps > 0) {
} }
analogWrite(Pin(GPIO_PWM1, i), 0); // removed with 8.3 because of reset caused by watchog analogWrite(Pin(GPIO_PWM1, i), 0); // removed with 8.3 because of reset caused by watchog
Shutter[i].real_position = ShutterCalculatePosition(i); Shutter[i].real_position = ShutterCalculatePosition(i);
@ -1084,7 +1084,6 @@ void CmndShutterPosition(void)
} }
int8_t new_shutterdirection = Shutter[index].real_position < Shutter[index].target_position ? 1 : -1; int8_t new_shutterdirection = Shutter[index].real_position < Shutter[index].target_position ? 1 : -1;
if (Shutter[index].direction == -new_shutterdirection) { if (Shutter[index].direction == -new_shutterdirection) {
Shutter[index].target_position = Shutter[index].start_position;
ShutterPowerOff(index); ShutterPowerOff(index);
} }
if (Shutter[index].direction != new_shutterdirection) { if (Shutter[index].direction != new_shutterdirection) {