test CCmode output Volt

This commit is contained in:
alan
2019-10-07 16:39:20 +08:00
parent 477144dc24
commit bf36103499
@@ -69,17 +69,17 @@ static int32_t CCModeReadCurrent(CURRENT_USER_CODE *CurrentUserCode){
// decode ADC value and put it into notify buffer
Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
Real_Current = 877;
// Real_Current = 877;
CurrentUserCode->SetMeasureCurrent(CurrentUserCode, Real_Current);
NotifyVolt[0] = (uint8_t) (Real_Current >> 24);
NotifyVolt[1] = (uint8_t) ((Real_Current & 0x00FF0000) >> 16);
NotifyVolt[2] = (uint8_t) ((Real_Current & 0x0000FF00) >> 8);
NotifyVolt[3] = (uint8_t) (Real_Current & 0x000000FF);
NotifyCurrent[0] = (uint8_t) (Real_Current >> 24);
NotifyCurrent[1] = (uint8_t) ((Real_Current & 0x00FF0000) >> 16);
NotifyCurrent[2] = (uint8_t) ((Real_Current & 0x0000FF00) >> 8);
NotifyCurrent[3] = (uint8_t) (Real_Current & 0x000000FF);
// NotifyVolt[0] = (uint8_t) (Real_Current >> 24);
// NotifyVolt[1] = (uint8_t) ((Real_Current & 0x00FF0000) >> 16);
// NotifyVolt[2] = (uint8_t) ((Real_Current & 0x0000FF00) >> 8);
// NotifyVolt[3] = (uint8_t) (Real_Current & 0x000000FF);
//
// NotifyCurrent[0] = (uint8_t) (Real_Current >> 24);
// NotifyCurrent[1] = (uint8_t) ((Real_Current & 0x00FF0000) >> 16);
// NotifyCurrent[2] = (uint8_t) ((Real_Current & 0x0000FF00) >> 8);
// NotifyCurrent[3] = (uint8_t) (Real_Current & 0x000000FF);
return Real_Current;
}
@@ -102,11 +102,15 @@ static int32_t CCModeVoltOut(CURRENT_USER_CODE *CurrentUserCode){
}
}
// NotifyVolt[0] = (uint8_t) (Real_Current >> 24);
// NotifyVolt[1] = (uint8_t) ((Real_Current & 0x00FF0000) >> 16);
// NotifyVolt[2] = (uint8_t) ((Real_Current & 0x0000FF00) >> 8);
// NotifyVolt[3] = (uint8_t) (Real_Current & 0x000000FF);
NotifyVolt[0] = (uint8_t) (MeasureCurrent >> 24);
NotifyVolt[1] = (uint8_t) ((MeasureCurrent & 0x00FF0000) >> 16);
NotifyVolt[2] = (uint8_t) ((MeasureCurrent & 0x0000FF00) >> 8);
NotifyVolt[3] = (uint8_t) (MeasureCurrent & 0x000000FF);
NotifyCurrent[0] = (uint8_t) (MeasureCurrent >> 24);
NotifyCurrent[1] = (uint8_t) ((MeasureCurrent & 0x00FF0000) >> 16);
NotifyCurrent[2] = (uint8_t) ((MeasureCurrent & 0x0000FF00) >> 8);
NotifyCurrent[3] = (uint8_t) (MeasureCurrent & 0x000000FF);
// INSTRUCTION.VoltConstant = 24999 + 500;
// DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));