try to fix IV mode

This commit is contained in:
weiting2
2019-11-04 11:43:31 +08:00
parent b0ac5bb6e6
commit 4875bb271a
3 changed files with 10 additions and 4 deletions
@@ -731,6 +731,10 @@ static int32_t DecodeADCValue(uint8_t ADCGain, uint8_t ADCChannel, uint8_t *ADC_
// IT curve
else {
ADCRealCurrent = DecodeADCCurrent(ADCGain, ADC_measure);
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);
ret = ADCRealCurrent;
}
@@ -37,6 +37,10 @@ static int32_t IT_Plot(WorkMode *WorkModeData) {
#define CURRENT_MODE WorkModeData->IT
break;
}
default{
#define CURRENT_MODE WorkModeData->IV
break;
}
}
// read ADC current
@@ -62,10 +66,7 @@ static int32_t IT_Plot(WorkMode *WorkModeData) {
// reset();
// }
// }
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;
}
@@ -204,6 +204,7 @@ static void EliteADCControl(WorkMode *WorkModeData) {
break;
}
default:{
IT_Plot(WorkModeData);
break;
}
}