From 040769019776de57b71033eeeedb2d9ca1f25035 Mon Sep 17 00:00:00 2001 From: YiChin Date: Fri, 14 Aug 2020 09:22:21 +0800 Subject: [PATCH] fix slowly vscan of IV mode --- .../cc26xx/app/headstage/EliteFlagCTInit.h | 1 + .../cc26xx/app/headstage/EliteIVCurve.h | 4 ++-- .../cc26xx/app/headstage/Elite_version.h | 6 +++--- .../cc26xx/app/headstage/impedance_meter.h | 10 +++++++++- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteFlagCTInit.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteFlagCTInit.h index 6046f5358..49b1a08ed 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteFlagCTInit.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteFlagCTInit.h @@ -21,6 +21,7 @@ struct _GPT{ uint32_t LeadTimeCounter; uint32_t BatteryADCCounter; uint32_t BatteryCheckCounter; + uint32_t GptimerMultiple; }GPT = {0}; static void InitCT(){ diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteIVCurve.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteIVCurve.h index 1774acc7e..3eed7380d 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteIVCurve.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteIVCurve.h @@ -36,9 +36,9 @@ static void IV_Vscan(IVMode *IV){ } if (IV->_current_direction_up){ - Vset = Vset + IV->_Vstep; + Vset = Vset + IV->_Vstep * GPT.GptimerMultiple; }else{ - Vset = Vset - IV->_Vstep; + Vset = Vset - IV->_Vstep * GPT.GptimerMultiple; } } } 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 e933ceb06..f1769ceaf 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 8 -#define VERSION_DATE_DAY 12 -#define VERSION_DATE_HOUR 14 -#define VERSION_DATE_MINUTE 52 +#define VERSION_DATE_DAY 14 +#define VERSION_DATE_HOUR 9 +#define VERSION_DATE_MINUTE 22 // 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/impedance_meter.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/impedance_meter.h index a5e32807b..f2eafcf3a 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/impedance_meter.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/impedance_meter.h @@ -145,7 +145,15 @@ static void SimpleBLEPeripheral_performPeriodicTask(WorkMode *WorkModeData) { //vscan counter GPT.VscanRateCounter = GPT.VscanRateCounter + GPT.DeltaGptimerCounter; if(GPT.VscanRateCounter >= INSTRUCTION.VsetRate){ - GPT.VscanRateCounter -= INSTRUCTION.VsetRate; //To get right time + if(GPT.VscanRateCounter >= INSTRUCTION.VsetRate * 2){ + GPT.GptimerMultiple = GPT.VscanRateCounter / INSTRUCTION.VsetRate; + }else{ + GPT.GptimerMultiple = 1; + } +// InputNotify(NOTIFY_CURRENT, GPT.GptimerMultiple); +// InputNotify(NOTIFY_IMPEDANCE, GPT.VscanRateCounter); + + GPT.VscanRateCounter -= INSTRUCTION.VsetRate * GPT.GptimerMultiple; //To get right time vscan_flag = true; if(vscan_flag){ EliteVscanControl(WorkModeData);