From bdb280c0297c99f670a8a9d098a529d9df0de26c Mon Sep 17 00:00:00 2001 From: alan Date: Fri, 20 Sep 2019 14:01:30 +0800 Subject: [PATCH] Elite 1.4-re RT mode --- .../cc26xx/app/headstage/EliteDeviceCorrection.h | 16 +--------------- .../cc26xx/app/headstage/headstage.h | 4 ++-- 2 files changed, 3 insertions(+), 17 deletions(-) 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 fd4012fb7..1eca1d711 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 @@ -298,21 +298,7 @@ static int32_t DecodeADCVolt(uint16_t ADC_measure){ // unit should be pA static int32_t DecodeADCCurrent(uint8_t ADCGain, uint16_t ADC_measure){ long long ADCRealCurrent = 0; - if(INSTRUCTION.ADCGainLevel == GAIN_200K){ - LED_color(DARKLED, 0xFF, 0x00, 0x00); - } - else if(INSTRUCTION.ADCGainLevel == GAIN_10K){ - LED_color(DARKLED, 0xFF, 0x00, 0xFF); - } - else if(INSTRUCTION.ADCGainLevel == GAIN_200R){ - LED_color(DARKLED, 0xFF, 0xFF, 0x00); - } - else{ - LED_color(DARKLED, 0xFF, 0xFF, 0xFF); - } - if(INSTRUCTION.ADCGainLevel != ADCGain){ - LED_color(DARKLED, 0xFF, 0xFF, 0xFF); - } + ADCRealCurrent = (Correction.ADC_current[ADCGain].coeff * ADC_measure + Correction.ADC_current[ADCGain].offset)/1e7; // Current unit is pA; 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 fda415e3c..76137a447 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 @@ -834,8 +834,8 @@ static void update_ZM_instruction(uint8 *ins) { case VOLT_OUTPUT: { INSTRUCTION.eliteFxn = VOLT_OUTPUT; INSTRUCTION.VoltConstant = ( ((uint16_t)(ins[3])) << 8) | (uint16_t)(ins[4]); -// DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant)); - DAC_outputV(INSTRUCTION.VoltConstant); + DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant)); +// DAC_outputV(INSTRUCTION.VoltConstant); break; }