mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-24 19:26:37 +00:00
Merge pull request #9336 from stefanbode/patch-4
Fix int16 overflow on large open times
This commit is contained in:
commit
d34be3009f
@ -560,7 +560,7 @@ int32_t ShutterCalculatePosition(uint32_t i)
|
|||||||
if (Shutter[i].direction != 0) {
|
if (Shutter[i].direction != 0) {
|
||||||
switch (ShutterGlobal.position_mode) {
|
switch (ShutterGlobal.position_mode) {
|
||||||
case SHT_COUNTER:
|
case SHT_COUNTER:
|
||||||
return ((int32_t)RtcSettings.pulse_counter[i]*Shutter[i].direction*STEPS_PER_SECOND*RESOLUTION / ShutterGlobal.open_velocity_max)+Shutter[i].start_position;
|
return ((int32_t)RtcSettings.pulse_counter[i]*Shutter[i].direction*STEPS_PER_SECOND / ShutterGlobal.open_velocity_max * RESOLUTION)+Shutter[i].start_position;
|
||||||
break;
|
break;
|
||||||
case SHT_TIME:
|
case SHT_TIME:
|
||||||
case SHT_TIME_UP_DOWN:
|
case SHT_TIME_UP_DOWN:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user