From 0909855fbb0e33bc4b4747cbdecf164f29d70f69 Mon Sep 17 00:00:00 2001 From: 105042004 Date: Thu, 29 Aug 2019 16:52:16 +0800 Subject: [PATCH] fix 10e3 --- .../cc26xx/app/headstage/EliteDeviceCorrection.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 f34402ecb..debe5851d 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 @@ -269,12 +269,12 @@ static void ADC_overflow(uint8_t gain, uint8_t *rawdata){ // this function should turn 0~50000 into DACcode which output the exactly voltage user want static uint16_t Usercode_Correction_to_DAC(uint16_t usercode) { - int32_t usercode_32; + uint32_t usercode_32; uint16_t DACcode = 0; - usercode_32 = (int32_t)(usercode); + usercode_32 = (uint32_t)(usercode); - DACcode = (uint16_t) ((Correction.Usercode2DAC.coeff * usercode_32 + Correction.Usercode2DAC.offset)/10e3); + DACcode = (uint16_t) ((Correction.Usercode2DAC.coeff * usercode_32 + Correction.Usercode2DAC.offset)/1000); return DACcode; } @@ -287,7 +287,7 @@ static int32_t DAC_to_realV(uint16_t DACcode) volt_32 = (int32_t)(DACcode); - RealV = (Correction.DAC2RealV.coeff * volt_32 + Correction.DAC2RealV.offset)/10e3; //(mV) + RealV = (Correction.DAC2RealV.coeff * volt_32 + Correction.DAC2RealV.offset)/1000; //(mV) return RealV; }