Elite 1.4-re error fix
This commit is contained in:
+9
-8
@@ -877,21 +877,22 @@ static void update_ZM_instruction(uint8 *ins) {
|
||||
|
||||
// decode ADC measure value
|
||||
ADCRealValue = DecodeADCValue(ins[3], ins[4], spi_ADC_rxbuf);
|
||||
int32_t Vout = (int32_t) (ADCRealValue / 1);;
|
||||
|
||||
// test ADC output through CIS
|
||||
if(ins[4] == ADC_CH_VOLT){
|
||||
// return ADC volt measure
|
||||
CIS_buf[5] = (uint8_t) (ADCRealValue >> 24);
|
||||
CIS_buf[6] = (uint8_t) ((ADCRealValue & 0x00110000) >> 16);
|
||||
CIS_buf[7] = (uint8_t) ((ADCRealValue & 0x00001100) >> 8);
|
||||
CIS_buf[8] = (uint8_t) (ADCRealValue & 0x00000011);
|
||||
CIS_buf[5] = (uint8_t) (Vout >> 24);
|
||||
CIS_buf[6] = (uint8_t) ((Vout & 0x00110000) >> 16);
|
||||
CIS_buf[7] = (uint8_t) ((Vout & 0x00001100) >> 8);
|
||||
CIS_buf[8] = (uint8_t) (Vout & 0x00000011);
|
||||
}
|
||||
else if(ins[4] == ADC_CH_CURRENT){
|
||||
// return ADC current measure
|
||||
CIS_buf[1] = (uint8_t) (ADCRealValue >> 24);
|
||||
CIS_buf[2] = (uint8_t) ((ADCRealValue & 0x00110000) >> 16);
|
||||
CIS_buf[3] = (uint8_t) ((ADCRealValue & 0x00001100) >> 8);
|
||||
CIS_buf[4] = (uint8_t) (ADCRealValue & 0x00000011);
|
||||
CIS_buf[1] = (uint8_t) (Vout >> 24);
|
||||
CIS_buf[2] = (uint8_t) ((Vout & 0x00110000) >> 16);
|
||||
CIS_buf[3] = (uint8_t) ((Vout & 0x00001100) >> 8);
|
||||
CIS_buf[4] = (uint8_t) (Vout & 0x00000011);
|
||||
}
|
||||
else{
|
||||
// CIS = 0xFF...FF using as an error report
|
||||
|
||||
Reference in New Issue
Block a user