CV3 read Vscan, when cc i = 0

This commit is contained in:
YiChin
2020-04-20 13:39:07 +08:00
parent 116d4cfb76
commit a22253e384
4 changed files with 18 additions and 8 deletions
@@ -46,10 +46,19 @@ static int32_t CCModeReadCurrent(CCMode *CC){
else{
VoltCurrentSwitch = 0;
}
NotifyVolt[0] = (uint8_t) (CC->BatteryV >> 24);
NotifyVolt[1] = (uint8_t) ((CC->BatteryV & 0x00FF0000) >> 16);
NotifyVolt[2] = (uint8_t) ((CC->BatteryV & 0x0000FF00) >> 8);
NotifyVolt[3] = (uint8_t) (CC->BatteryV & 0x000000FF);
if(INSTRUCTION.VoVi_Switch == 2){
int32_t Vscan = ((INSTRUCTION.VoltConstant - 25000) * 1000 / 5) - CC->BatteryV;
NotifyVolt[0] = (uint8_t) (Vscan >> 24);
NotifyVolt[1] = (uint8_t) ((Vscan & 0x00FF0000) >> 16);
NotifyVolt[2] = (uint8_t) ((Vscan & 0x0000FF00) >> 8);
NotifyVolt[3] = (uint8_t) (Vscan & 0x000000FF);
}else{
NotifyVolt[0] = (uint8_t) (CC->BatteryV >> 24);
NotifyVolt[1] = (uint8_t) ((CC->BatteryV & 0x00FF0000) >> 16);
NotifyVolt[2] = (uint8_t) ((CC->BatteryV & 0x0000FF00) >> 8);
NotifyVolt[3] = (uint8_t) (CC->BatteryV & 0x000000FF);
}
return CC->_MeasureData;
}
@@ -29,7 +29,7 @@
*/
#define BOARD_C5A7
#define BOARD_ANGUS
typedef struct _formula{
@@ -4,9 +4,9 @@
#define VERSION_DATE_YEAR 20
#define VERSION_DATE_MONTH 4
#define VERSION_DATE_DAY 17
#define VERSION_DATE_HOUR 10
#define VERSION_DATE_MINUTE 02
#define VERSION_DATE_DAY 20
#define VERSION_DATE_HOUR 13
#define VERSION_DATE_MINUTE 38
// this is NOT the version hash !!
// it's the last version hash
@@ -1166,6 +1166,7 @@ static void update_ZM_instruction(uint8 *ins) {
INSTRUCTION.VoltLimit = 0x61A8;
INSTRUCTION.ConstantCurrent = 0x00;
INSTRUCTION.NotifyRate = 1000;
INSTRUCTION.VoVi_Switch = 0x02;
// uint8 *ins;
// ins[0] = 0xC0;