Elite 1.4-re IV avg out at steptime-1

This commit is contained in:
alan
2019-09-05 10:35:49 +08:00
parent e649bd9a25
commit 474e3cb8d9
@@ -226,7 +226,7 @@ static int32_t DecodeADCValue(uint8_t ADCGain, uint8_t ADCChannel, uint8_t *ADC_
ADCRealCurrent_long += DecodeADCCurrent(ADCGain, ADC_measure);
avg_number++;
if (StepTimeCounter == INSTRUCTION.StepTime) {
if (StepTimeCounter == INSTRUCTION.StepTime - 1) {
ADCRealCurrent_long = ADCRealCurrent_long / avg_number;
NotifyCurrent[0] = (uint8_t) (ADCRealCurrent_long >> 24);
NotifyCurrent[1] = (uint8_t) ((ADCRealCurrent_long & 0x00FF0000) >> 16);