From 9602546f013e1e7a52087f382655c7bf1e13e477 Mon Sep 17 00:00:00 2001 From: stefanbode Date: Sun, 13 Oct 2019 09:36:53 +0200 Subject: [PATCH] Fix overflow --- sonoff/xdrv_27_shutter.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonoff/xdrv_27_shutter.ino b/sonoff/xdrv_27_shutter.ino index efc6ac6f3..7c0f989d1 100644 --- a/sonoff/xdrv_27_shutter.ino +++ b/sonoff/xdrv_27_shutter.ino @@ -91,7 +91,7 @@ int32_t ShutterPercentToRealPosition(uint8_t percent,uint8_t index) if (Settings.shutter_set50percent[index] != 50) { return percent <= 5 ? Settings.shuttercoeff[2][index] * percent : Settings.shuttercoeff[1][index] * percent + Settings.shuttercoeff[0][index]; } else { - uint16_t realpos; + uint32_t realpos; // check against DIV 0 for (uint8_t j=0 ; j < 5 ; j++) { if (Settings.shuttercoeff[j][index] == 0) {