From e4ae8ac2a8feb4e6551a33bab96d16f7fdd9b75d Mon Sep 17 00:00:00 2001 From: Roy Date: Thu, 16 Dec 2021 21:06:27 +0800 Subject: [PATCH] fix notify data of dpv mode --- .../cc26xx/app/headstage/Elite_version.h | 6 +-- .../cc26xx/app/headstage/impedance_meter.h | 41 +++++++++++-------- 2 files changed, 26 insertions(+), 21 deletions(-) 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 7676d9a75..07524e87a 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 21 #define VERSION_DATE_MONTH 12 -#define VERSION_DATE_DAY 2 -#define VERSION_DATE_HOUR 14 -#define VERSION_DATE_MINUTE 57 +#define VERSION_DATE_DAY 16 +#define VERSION_DATE_HOUR 21 +#define VERSION_DATE_MINUTE 6 // 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 e134309fe..a60ee6056 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 @@ -346,29 +346,34 @@ static void uni_pulse_mode(void) PIN15_setOutputValue(enable_5v, 0); } - //Notify counter(Notify control, check if we need to send notify) - //please don't put Notify counter before ADC counter, maybe get wrong data - GPT.NotifyCounter = GPT.NotifyCounter + GPT.DeltaGptimerCounter; - if(GPT.NotifyCounter >= instru.notifyRate){ - GPT.NotifyCounter -= instru.notifyRate; //To get right time - notify_flag = true; - if (instru.eliteFxn == CURVE_UNI_PULSE || instru.eliteFxn == CURVE_DPV || instru.eliteFxn == CURVE_DPV_ADVANCE) { - notify_flag = false; - } - if(vscanReset){ - notify_flag = false; - } + if (instru.eliteFxn == CURVE_DPV || instru.eliteFxn == CURVE_DPV_ADVANCE) { - if (!volt_rec_en || !curr_rec_en) { - notify_flag = false; - } + } else { + //Notify counter(Notify control, check if we need to send notify) + //please don't put Notify counter before ADC counter, maybe get wrong data + GPT.NotifyCounter = GPT.NotifyCounter + GPT.DeltaGptimerCounter; + if(GPT.NotifyCounter >= instru.notifyRate){ + GPT.NotifyCounter -= instru.notifyRate; //To get right time + notify_flag = true; + if (instru.eliteFxn == CURVE_UNI_PULSE) { + notify_flag = false; + } + if(vscanReset){ + notify_flag = false; + } - if(notify_flag){ - SendNotify(); - notify_flag = false; + if (!volt_rec_en || !curr_rec_en) { + notify_flag = false; + } + + if(notify_flag){ + SendNotify(); + notify_flag = false; + } } } + mode_done(); }