Fix mixer overflow (#7747)

This commit is contained in:
DanielGeA
2020-06-17 15:55:42 +02:00
committed by GitHub
parent e433685786
commit fca11fc6b6
3 changed files with 63 additions and 1 deletions
+1 -1
View File
@@ -947,7 +947,7 @@ void evalMixes(uint8_t tick10ms)
mixerCurrentFlightMode = p;
evalFlightModeMixes(p==fm ? e_perout_mode_normal : e_perout_mode_inactive_flight_mode, p==fm ? tick10ms : 0);
for (uint8_t i=0; i<MAX_OUTPUT_CHANNELS; i++)
sum_chans512[i] += (chans[i] >> 4) * fp_act[p];
sum_chans512[i] += limit<int32_t>(-0x6fff, chans[i] >> 4, 0x6fff) * fp_act[p];
weight += fp_act[p];
}
}