auto shift bug fix

This commit is contained in:
Benny Liu
2019-08-16 17:56:14 +08:00
parent c31bbef8f5
commit bb521437db
@@ -206,18 +206,17 @@ static void IT_Plot() {
// read ADC volt
ADCGainControl(ADCGain);
ADCChannelSelect(ADC_CH_CURRENT);
CPUdelay(16000);
ADC_read(spi_ADC_rxbuf);
uint16_t rawdata = ((uint16_t) (spi_ADC_rxbuf[0] << 8 )) | (spi_ADC_rxbuf[1]);
CPUdelay(16000);
if(ADC_overflow(ADCGain, rawdata)){
break;
}
}
CPUdelay(16000);
ADC_read(spi_ADC_rxbuf);
// decode ADC value and put it into notify buffer
DecodeADCValue(ADCGain, ADC_CH_CURRENT, spi_ADC_rxbuf);
}