Fix overflow

This commit is contained in:
stefanbode 2019-10-13 09:36:53 +02:00 committed by GitHub
parent 7b316f48f1
commit 9602546f01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -91,7 +91,7 @@ int32_t ShutterPercentToRealPosition(uint8_t percent,uint8_t index)
if (Settings.shutter_set50percent[index] != 50) { if (Settings.shutter_set50percent[index] != 50) {
return percent <= 5 ? Settings.shuttercoeff[2][index] * percent : Settings.shuttercoeff[1][index] * percent + Settings.shuttercoeff[0][index]; return percent <= 5 ? Settings.shuttercoeff[2][index] * percent : Settings.shuttercoeff[1][index] * percent + Settings.shuttercoeff[0][index];
} else { } else {
uint16_t realpos; uint32_t realpos;
// check against DIV 0 // check against DIV 0
for (uint8_t j=0 ; j < 5 ; j++) { for (uint8_t j=0 ; j < 5 ; j++) {
if (Settings.shuttercoeff[j][index] == 0) { if (Settings.shuttercoeff[j][index] == 0) {