mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 18:56:38 +00:00
Merge pull request #8756 from stefanbode/patch-13
#8721 fix 8.3 issues. Currently only ONE Shutter with Stepper Motors
This commit is contained in:
commit
55f9b23f61
@ -206,7 +206,7 @@ void ShutterInit(void)
|
||||
Shutter.pwm_frequency[i] = 0;
|
||||
Shutter.accelerator[i] = 0;
|
||||
analogWriteFreq(Shutter.pwm_frequency[i]);
|
||||
analogWrite(Pin(GPIO_PWM1, i), 50);
|
||||
ExecuteCommandPower(Settings.shutter_startrelay[i]+2, 0, SRC_SHUTTER);
|
||||
}
|
||||
}
|
||||
|
||||
@ -364,7 +364,8 @@ void ShutterUpdatePosition(void)
|
||||
while (RtcSettings.pulse_counter[i] < (uint32_t)(Shutter.target_position[i]-Shutter.start_position[i])*Shutter.direction[i]*Shutter.max_pwm_frequency/2000) {
|
||||
delay(1);
|
||||
}
|
||||
analogWrite(Pin(GPIO_PWM1, i), 0);
|
||||
//analogWrite(Pin(GPIO_PWM1, i), 0); // removed with 8.3 because of reset caused by watchog
|
||||
ExecuteCommandPower(Settings.shutter_startrelay[i]+2, 0, SRC_SHUTTER);
|
||||
Shutter.real_position[i] = ShutterCounterBasedPosition(i);
|
||||
AddLog_P2(LOG_LEVEL_DEBUG, PSTR("SHT: Real %d, pulsecount %d, start %d"), Shutter.real_position[i],RtcSettings.pulse_counter[i], Shutter.start_position[i]);
|
||||
|
||||
@ -460,6 +461,7 @@ void ShutterWaitForMotorStop(uint32_t i)
|
||||
delay(50);
|
||||
}
|
||||
analogWrite(Pin(GPIO_PWM1, i), 0);
|
||||
ExecuteCommandPower(Settings.shutter_startrelay[i]+2, 0, SRC_SHUTTER);
|
||||
Shutter.real_position[i] = ShutterCounterBasedPosition(i);
|
||||
} else {
|
||||
ExecuteCommandPower(Settings.shutter_startrelay[i], 0, SRC_SHUTTER);
|
||||
@ -902,6 +904,9 @@ void CmndShutterPosition(void)
|
||||
ExecuteCommandPower(Settings.shutter_startrelay[index] +1, new_shutterdirection == 1 ? 0 : 1, SRC_SHUTTER);
|
||||
// power on
|
||||
ExecuteCommandPower(Settings.shutter_startrelay[index], 1, SRC_SHUTTER);
|
||||
if (SHT_OFF_ON__OPEN_CLOSE_STEPPER == Shutter.mode) {
|
||||
ExecuteCommandPower(Settings.shutter_startrelay[index]+2, 1, SRC_SHUTTER);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// now start the motor for the right direction, work for momentary and normal shutters.
|
||||
|
Loading…
x
Reference in New Issue
Block a user