[CV] try to fix auto
This commit is contained in:
+12
-8
@@ -38,23 +38,27 @@ static int32_t IT_Plot(WorkMode *WorkModeData) {
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
#define CURRENT_MODE WorkModeData->IV
|
||||
#define CURRENT_MODE WorkModeData->IT
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// read ADC current
|
||||
int32_t RealCurrent = 0, RealVolt = 0;
|
||||
static uint8_t PreviousGain = GAIN_AUTO;
|
||||
static uint8_t PreviousGain = GAIN_200R;
|
||||
|
||||
if(INSTRUCTION.AutoGainEnable){
|
||||
if(INSTRUCTION.eliteFxn == IV_CURVE){
|
||||
if (PreviousGain != INSTRUCTION.ADCGainLevel){
|
||||
PreviousGain = INSTRUCTION.ADCGainLevel;
|
||||
ReadCurrent(spi_ADC_rxbuf);
|
||||
}
|
||||
}
|
||||
RealCurrent = AutoGainReadCurrent(spi_ADC_rxbuf);
|
||||
if(PreviousGain != INSTRUCTION.ADCGainLevel){
|
||||
PreviousGain = INSTRUCTION.ADCGainLevel;
|
||||
CURRENT_MODE->_MeasureData = AutoGainReadCurrent(spi_ADC_rxbuf);
|
||||
CURRENT_MODE->_MeasureData = AutoGainReadCurrent(spi_ADC_rxbuf);
|
||||
}
|
||||
if(PreviousGain != INSTRUCTION.ADCGainLevel){
|
||||
PreviousGain = INSTRUCTION.ADCGainLevel;
|
||||
CURRENT_MODE->_MeasureData = AutoGainReadCurrent(spi_ADC_rxbuf);
|
||||
CURRENT_MODE->_MeasureData = AutoGainReadCurrent(spi_ADC_rxbuf);
|
||||
}
|
||||
}
|
||||
else{
|
||||
ReadCurrent(spi_ADC_rxbuf);
|
||||
|
||||
+4
-1
@@ -153,7 +153,10 @@ static void EliteDACControl(WorkMode *WorkModeData) {
|
||||
if ((INSTRUCTION.eliteFxn == IV_CURVE) || (INSTRUCTION.eliteFxn == CV_CURVE)) {
|
||||
// output a certain voltage and put it into NotifyVolt
|
||||
VoltScan(WorkModeData);
|
||||
// DACCode2Real2Notify(VoltScan(WorkModeData));
|
||||
|
||||
if(INSTRUCTION.eliteFxn == CV_CURVE){
|
||||
DACCode2Real2Notify(VoltScan(WorkModeData));
|
||||
}
|
||||
}
|
||||
|
||||
else if (INSTRUCTION.eliteFxn == ZT_CURVE){
|
||||
|
||||
Reference in New Issue
Block a user