From bf36103499d63e9b70813a71f4683cefdcba07c8 Mon Sep 17 00:00:00 2001 From: alan Date: Mon, 7 Oct 2019 16:39:20 +0800 Subject: [PATCH] test CCmode output Volt --- .../cc26xx/app/headstage/EliteCCMode.h | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteCCMode.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteCCMode.h index 12ec49ce9..677c6d6e0 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteCCMode.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteCCMode.h @@ -69,17 +69,17 @@ static int32_t CCModeReadCurrent(CURRENT_USER_CODE *CurrentUserCode){ // decode ADC value and put it into notify buffer Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf); - Real_Current = 877; +// Real_Current = 877; CurrentUserCode->SetMeasureCurrent(CurrentUserCode, Real_Current); - NotifyVolt[0] = (uint8_t) (Real_Current >> 24); - NotifyVolt[1] = (uint8_t) ((Real_Current & 0x00FF0000) >> 16); - NotifyVolt[2] = (uint8_t) ((Real_Current & 0x0000FF00) >> 8); - NotifyVolt[3] = (uint8_t) (Real_Current & 0x000000FF); - - NotifyCurrent[0] = (uint8_t) (Real_Current >> 24); - NotifyCurrent[1] = (uint8_t) ((Real_Current & 0x00FF0000) >> 16); - NotifyCurrent[2] = (uint8_t) ((Real_Current & 0x0000FF00) >> 8); - NotifyCurrent[3] = (uint8_t) (Real_Current & 0x000000FF); +// NotifyVolt[0] = (uint8_t) (Real_Current >> 24); +// NotifyVolt[1] = (uint8_t) ((Real_Current & 0x00FF0000) >> 16); +// NotifyVolt[2] = (uint8_t) ((Real_Current & 0x0000FF00) >> 8); +// NotifyVolt[3] = (uint8_t) (Real_Current & 0x000000FF); +// +// NotifyCurrent[0] = (uint8_t) (Real_Current >> 24); +// NotifyCurrent[1] = (uint8_t) ((Real_Current & 0x00FF0000) >> 16); +// NotifyCurrent[2] = (uint8_t) ((Real_Current & 0x0000FF00) >> 8); +// NotifyCurrent[3] = (uint8_t) (Real_Current & 0x000000FF); return Real_Current; } @@ -102,11 +102,15 @@ static int32_t CCModeVoltOut(CURRENT_USER_CODE *CurrentUserCode){ } } -// NotifyVolt[0] = (uint8_t) (Real_Current >> 24); -// NotifyVolt[1] = (uint8_t) ((Real_Current & 0x00FF0000) >> 16); -// NotifyVolt[2] = (uint8_t) ((Real_Current & 0x0000FF00) >> 8); -// NotifyVolt[3] = (uint8_t) (Real_Current & 0x000000FF); + NotifyVolt[0] = (uint8_t) (MeasureCurrent >> 24); + NotifyVolt[1] = (uint8_t) ((MeasureCurrent & 0x00FF0000) >> 16); + NotifyVolt[2] = (uint8_t) ((MeasureCurrent & 0x0000FF00) >> 8); + NotifyVolt[3] = (uint8_t) (MeasureCurrent & 0x000000FF); + NotifyCurrent[0] = (uint8_t) (MeasureCurrent >> 24); + NotifyCurrent[1] = (uint8_t) ((MeasureCurrent & 0x00FF0000) >> 16); + NotifyCurrent[2] = (uint8_t) ((MeasureCurrent & 0x0000FF00) >> 8); + NotifyCurrent[3] = (uint8_t) (MeasureCurrent & 0x000000FF); // INSTRUCTION.VoltConstant = 24999 + 500; // DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));