From a22253e3849f021eeb5decd8bafd0976f8be2a6b Mon Sep 17 00:00:00 2001 From: YiChin Date: Mon, 20 Apr 2020 13:39:07 +0800 Subject: [PATCH] CV3 read Vscan, when cc i = 0 --- .../cc26xx/app/headstage/EliteCCMode.h | 17 +++++++++++++---- .../app/headstage/EliteDeviceCorrection.h | 2 +- .../cc26xx/app/headstage/Elite_version.h | 6 +++--- .../cc26xx/app/headstage/headstage.h | 1 + 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteCCMode.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteCCMode.h index 6d2772560..0faf53184 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteCCMode.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteCCMode.h @@ -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; } diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteDeviceCorrection.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteDeviceCorrection.h index 6a62a0400..7f31d6975 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteDeviceCorrection.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteDeviceCorrection.h @@ -29,7 +29,7 @@ */ -#define BOARD_C5A7 +#define BOARD_ANGUS typedef struct _formula{ diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h index d953eeb93..e7bb5dddb 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h @@ -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 diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage.h index a53555b1c..a99f01a94 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage.h @@ -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;