diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteADC.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteADC.h index da65f44b2..0770ec3ca 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteADC.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteADC.h @@ -203,13 +203,17 @@ static void AutoGainChange(int32_t Real_Current){ GAIN_200K_counter++; if(GAIN_200K_counter > 2){ INSTRUCTION.ADCGainLevel = GAIN_200K; + ADCGainControl(INSTRUCTION.ADCGainLevel); GAIN_200K_counter = 0; + record_flag = false; } }else{ GAIN_10K_counter++; if(GAIN_10K_counter > 2){ INSTRUCTION.ADCGainLevel = GAIN_10K; + ADCGainControl(INSTRUCTION.ADCGainLevel); GAIN_10K_counter = 0; + record_flag = false; } } }else{ @@ -227,7 +231,9 @@ static void AutoGainChange(int32_t Real_Current){ GAIN_200R_counter++; if(GAIN_200R_counter > 2){ INSTRUCTION.ADCGainLevel = GAIN_200R; + ADCGainControl(INSTRUCTION.ADCGainLevel); GAIN_200R_counter = 0; + record_flag = false; } } @@ -236,7 +242,9 @@ static void AutoGainChange(int32_t Real_Current){ GAIN_200K_counter++; if(GAIN_200K_counter > 2){ INSTRUCTION.ADCGainLevel = GAIN_200K; + ADCGainControl(INSTRUCTION.ADCGainLevel); GAIN_200K_counter = 0; + record_flag = false; } }else{ if(GAIN_200R_counter > 0){ @@ -255,14 +263,18 @@ static void AutoGainChange(int32_t Real_Current){ GAIN_200R_counter++; if(GAIN_200R_counter > 2){ INSTRUCTION.ADCGainLevel = GAIN_200R; + ADCGainControl(INSTRUCTION.ADCGainLevel); GAIN_200R_counter = 0; + record_flag = false; } }else{ GAIN_10K_counter++; if(GAIN_10K_counter > 2){ INSTRUCTION.ADCGainLevel = GAIN_10K; + ADCGainControl(INSTRUCTION.ADCGainLevel); GAIN_10K_counter = 0; + record_flag = false; } } @@ -275,7 +287,6 @@ static void AutoGainChange(int32_t Real_Current){ } } } - ADCGainControl(INSTRUCTION.ADCGainLevel); } #endif diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_mode_ADC_DAC.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_mode_ADC_DAC.h index 4a9ecddd6..8bba83dc7 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_mode_ADC_DAC.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_mode_ADC_DAC.h @@ -155,11 +155,16 @@ static void CC_Plot(WorkMode *WorkModeData){ if(BatSwitch == 0){ if(ADCSwitch == 0){ /**read Iin(buffer),read bat**/ readIin(WorkModeData); - InputNotify(NOTIFY_CURRENT, CURRENT_MODE->_measureCurrent); - DACenable(WorkModeData, VoltData, AFTER_READ_I); + if(record_flag == false){ + ReadCurrent(spi_ADC_rxbuf); + ADCSwitch = 3; + }else{ + InputNotify(NOTIFY_CURRENT, CURRENT_MODE->_measureCurrent); + DACenable(WorkModeData, VoltData, AFTER_READ_I); - ReadBatVolt(spi_ADC_rxbuf); - BatSwitch++; + ReadBatVolt(spi_ADC_rxbuf); + BatSwitch++; + } }else if(ADCSwitch == 1 || ADCSwitch == 3){ /**read Bat**/ ReadBatVolt(spi_ADC_rxbuf); BatSwitch++; @@ -191,11 +196,16 @@ static void CC_Plot(WorkMode *WorkModeData){ BatSwitch = 0; if(ADCSwitch == 0){ /**read Iin(buffer),read V**/ readIin(WorkModeData); - InputNotify(NOTIFY_CURRENT, CURRENT_MODE->_measureCurrent); - DACenable(WorkModeData, VoltData, AFTER_READ_I); + if(record_flag == false){ + ReadCurrent(spi_ADC_rxbuf); + ADCSwitch = 3; + }else{ + InputNotify(NOTIFY_CURRENT, CURRENT_MODE->_measureCurrent); + DACenable(WorkModeData, VoltData, AFTER_READ_I); - ReadADCVolt(CURRENT_MODE->_VoViSwitch); - ADCSwitch++; + ReadADCVolt(CURRENT_MODE->_VoViSwitch); + ADCSwitch++; + } } else if(ADCSwitch == 1){ /**read V**/ ReadADCVolt(CURRENT_MODE->_VoViSwitch); @@ -216,8 +226,18 @@ static void CC_Plot(WorkMode *WorkModeData){ ADCSwitch++; } else if(ADCSwitch == 3){ /**read Iin**/ + if(record_flag == false){ + static int count = 0; + count++; + ADCSwitch = 3; + if(count == 4){ + count = 0; + record_flag = true; + } + }else{ + ADCSwitch = 0; + } ReadCurrent(spi_ADC_rxbuf); - ADCSwitch = 0; } } #undef CURRENT_MODE 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 3dd358564..ee730f2fb 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 @@ -3,10 +3,10 @@ #define VERSION_DATE #define VERSION_DATE_YEAR 20 -#define VERSION_DATE_MONTH 7 -#define VERSION_DATE_DAY 29 -#define VERSION_DATE_HOUR 15 -#define VERSION_DATE_MINUTE 21 +#define VERSION_DATE_MONTH 8 +#define VERSION_DATE_DAY 5 +#define VERSION_DATE_HOUR 16 +#define VERSION_DATE_MINUTE 5 // 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 6a83bc661..6e0192d35 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 @@ -532,6 +532,7 @@ static bool ADC_flag; static bool vscan_flag; static bool notify_flag; static bool notifyFirst_flag; +static bool record_flag; static bool vscanReset; static bool EliteWorkReset; static bool leadTimeReset; 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 7da7c0a67..29b90b066 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 @@ -113,8 +113,9 @@ static void SimpleBLEPeripheral_performPeriodicTask(WorkMode *WorkModeData) { if(EliteWorkReset){ InitEliteGPtimer(); - EliteWorkReset = false; + EliteWorkReset = false; batteryADC_flag = false; + record_flag = true; if( Ve1MatchVe2Mode() ){ if (INSTRUCTION.Ve1 == INSTRUCTION.Ve2) { DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.Ve1));