Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0259d3ec61 |
+11
-11
@@ -43,10 +43,10 @@ static int32_t CCModeReadCurrent(CCMode *CC){
|
||||
CC->BatteryV = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_VOLT, spi_ADC_rxbuf);
|
||||
|
||||
// if Iin connect to battery +, Vout connect to battery -
|
||||
CC->BatteryV = CC->BatteryV - (CC->value - CC_ZERO_POINT)*10/1e5; // I_set * 10R = V_Iin2GND (mA * ohm)
|
||||
// CC->BatteryV = CC->BatteryV - (CC->value - CC_ZERO_POINT)*10/1e5; // I_set * 10R = V_Iin2GND (mA * ohm)
|
||||
|
||||
// if Iin connect to battery -, Vout connect to battery +
|
||||
// CC->BatteryV = CC->BatteryV + (CC->value - CC_ZERO_POINT)*10/1e5; // I_set * 10R = V_Iin2GND (mA * ohm)
|
||||
CC->BatteryV = CC->BatteryV + (CC->value - CC_ZERO_POINT)*10/1e5; // I_set * 10R = V_Iin2GND (mA * ohm)
|
||||
|
||||
VoltCurrentSwitch++;
|
||||
}
|
||||
@@ -83,15 +83,15 @@ static int32_t CCModeVoltOut(CCMode *CC){
|
||||
MeasureCurrent = CC->_MeasureData;
|
||||
CCModeDACControl(IUCCurrent - MeasureCurrent);
|
||||
|
||||
// NotifyCurrent[0] = (uint8_t) (IUCCurrent >> 24);
|
||||
// NotifyCurrent[1] = (uint8_t) ((IUCCurrent & 0x00FF0000) >> 16);
|
||||
// NotifyCurrent[2] = (uint8_t) ((IUCCurrent & 0x0000FF00) >> 8);
|
||||
// NotifyCurrent[3] = (uint8_t) (IUCCurrent & 0x000000FF);
|
||||
//
|
||||
// NotifyImpedance[0] = (uint8_t) (MeasureCurrent >> 24);
|
||||
// NotifyImpedance[1] = (uint8_t) ((MeasureCurrent & 0x00FF0000) >> 16);
|
||||
// NotifyImpedance[2] = (uint8_t) ((MeasureCurrent & 0x0000FF00) >> 8);
|
||||
// NotifyImpedance[3] = (uint8_t) (MeasureCurrent & 0x000000FF);
|
||||
NotifyCurrent[0] = (uint8_t) (IUCCurrent >> 24);
|
||||
NotifyCurrent[1] = (uint8_t) ((IUCCurrent & 0x00FF0000) >> 16);
|
||||
NotifyCurrent[2] = (uint8_t) ((IUCCurrent & 0x0000FF00) >> 8);
|
||||
NotifyCurrent[3] = (uint8_t) (IUCCurrent & 0x000000FF);
|
||||
|
||||
NotifyImpedance[0] = (uint8_t) (MeasureCurrent >> 24);
|
||||
NotifyImpedance[1] = (uint8_t) ((MeasureCurrent & 0x00FF0000) >> 16);
|
||||
NotifyImpedance[2] = (uint8_t) ((MeasureCurrent & 0x0000FF00) >> 8);
|
||||
NotifyImpedance[3] = (uint8_t) (MeasureCurrent & 0x000000FF);
|
||||
|
||||
// DACCode2Real2Notify(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
|
||||
// if(IUCCurrent > 1000){
|
||||
|
||||
Reference in New Issue
Block a user