mirror of https://github.com/arendst/Tasmota.git
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) {
|
||||
switch (ShutterGlobal.position_mode) {
|
||||
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;
|
||||
case SHT_TIME:
|
||||
case SHT_TIME_UP_DOWN:
|
||||
|
|
Loading…
Reference in New Issue