[update] ADC modulized done and ADC rx buffer revised
This commit is contained in:
+1
-1
@@ -24,7 +24,7 @@ extern "C" {
|
||||
|
||||
|
||||
|
||||
uint8_t * read_adc_data(uint8_t AdcChannel);
|
||||
uint16_t read_adc_data(uint8_t AdcChannel);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
+6
-5
@@ -1,7 +1,7 @@
|
||||
#include "hardware/adc_ads1118.h"
|
||||
|
||||
static uint8_t spi_ADC_txbuf_l[SPI_ADC_SIZE] = {0};
|
||||
static uint8_t spi_ADC_rxbuf_l[SPI_ADC_SIZE] = {0};
|
||||
static uint8_t spi_ADC_txbuf_l[2] = {0};
|
||||
static uint8_t spi_ADC_rxbuf_l[2] = {0};
|
||||
|
||||
|
||||
static void __ADC_write(uint8_t ADCin)
|
||||
@@ -45,7 +45,7 @@ static void __ADC_read()
|
||||
uint8_t *rx = spi_ADC_rxbuf_l;
|
||||
uint8_t *tx = spi_ADC_txbuf_l;
|
||||
|
||||
for (int i=0; i<SPI_ADC_SIZE; i++) {
|
||||
for (int i=0; i<2; i++) {
|
||||
tx[i] = 0;
|
||||
rx[i] = 0;
|
||||
|
||||
@@ -108,15 +108,16 @@ static void __ADC_ch_sel(uint8_t Adc_ch)
|
||||
|
||||
|
||||
|
||||
uint8_t *read_adc_data(uint8_t AdcChannel)
|
||||
uint16_t read_adc_data(uint8_t AdcChannel)
|
||||
{
|
||||
uint8_t Adc_ch = AdcChannel;
|
||||
uint8_t *rx = spi_ADC_rxbuf_l;
|
||||
__ADC_ch_sel(Adc_ch);
|
||||
__ADC_read();
|
||||
|
||||
// __ADC_ch_sel(Adc_ch);
|
||||
// __ADC_read();
|
||||
|
||||
uint16_t rx = (uint16_t)spi_ADC_rxbuf_l[0] << 8 | (uint16_t)spi_ADC_rxbuf_l[1];
|
||||
|
||||
return rx;
|
||||
}
|
||||
|
||||
+3
-5
@@ -2145,7 +2145,7 @@ struct correction_ctx_t Correction = {
|
||||
};
|
||||
#endif
|
||||
|
||||
int32_t DecodeADCValue(uint8_t adc_gain, uint8_t adc_channel, uint8_t *adc_rxbuf);
|
||||
int32_t DecodeADCValue(uint8_t adc_gain, uint8_t adc_channel, uint16_t adc_rxbuf);
|
||||
uint16_t Usercode_Correction_to_DAC(uint8_t dac_gain, uint16_t usercode);
|
||||
|
||||
/*=============================================================================
|
||||
@@ -2214,12 +2214,11 @@ static int32_t DecodeADCCurrent(uint8_t adc_gain, uint16_t adc_measure)
|
||||
return (int32_t) (curr);
|
||||
}
|
||||
|
||||
int32_t DecodeADCValue(uint8_t adc_gain, uint8_t adc_channel, uint8_t *adc_rxbuf)
|
||||
int32_t DecodeADCValue(uint8_t adc_gain, uint8_t adc_channel, uint16_t adc_rxbuf)
|
||||
{
|
||||
uint8_t gain = adc_gain;
|
||||
uint8_t ch = adc_channel;
|
||||
uint8_t *rx = adc_rxbuf;
|
||||
uint16_t adc_16b_measure;
|
||||
uint16_t adc_16b_measure = adc_rxbuf;
|
||||
int32_t ret = 0;
|
||||
|
||||
/*
|
||||
@@ -2230,7 +2229,6 @@ int32_t DecodeADCValue(uint8_t adc_gain, uint8_t adc_channel, uint8_t *adc_rxbuf
|
||||
* if channel == RIS_ADC_VIN: return real battery volt
|
||||
*/
|
||||
|
||||
adc_16b_measure = (uint16_t)rx[0] << 8 | (uint16_t)rx[1];
|
||||
|
||||
if(ch == RIS_ADC_VIN){
|
||||
return DecodeADCVolt(gain, adc_16b_measure);
|
||||
|
||||
+2
-21
@@ -20,15 +20,6 @@ static void reset() {
|
||||
DAC0_W_T(Usercode_Correction_to_DAC(instru.VoutGainLv, 25000));
|
||||
|
||||
|
||||
for (int i = 0; i < SPI_DAC_SIZE; i++) {
|
||||
spi_DACtxbuf[i] = 0;
|
||||
spi_rxbuf[i] = 0;
|
||||
}
|
||||
|
||||
for (int i = 0; i < SPI_ADC_SIZE; i++) {
|
||||
spi_ADC_txbuf[i] = 0;
|
||||
spi_ADC_rxbuf[i] = 0;
|
||||
}
|
||||
|
||||
ModeLED(NO_EVENT);
|
||||
CPUdelay(1600);
|
||||
@@ -48,18 +39,8 @@ static void Eliteinterrupt() {
|
||||
VoutGainControl(instru.VoutGainLv);
|
||||
DAC0_W_T(Usercode_Correction_to_DAC(instru.VoutGainLv, 25000));
|
||||
|
||||
|
||||
|
||||
for (int i = 0; i < SPI_DAC_SIZE; i++) {
|
||||
spi_DACtxbuf[i] = 0;
|
||||
spi_rxbuf[i] = 0;
|
||||
}
|
||||
|
||||
for (int i = 0; i < SPI_ADC_SIZE; i++) {
|
||||
spi_ADC_txbuf[i] = 0;
|
||||
spi_ADC_rxbuf[i] = 0;
|
||||
}
|
||||
|
||||
ADC_rxbuf = 0;
|
||||
|
||||
ModeLED(NO_EVENT);
|
||||
CPUdelay(8000);
|
||||
}
|
||||
|
||||
+1
-11
@@ -15,18 +15,8 @@
|
||||
// #include "Elite_PIN.h"
|
||||
#include "driver/spi_ctrl.h"
|
||||
/* application use SPI parameters and buffers */
|
||||
//#define SPI_LED_SIZE 28
|
||||
#define SPI_DAC_SIZE 3
|
||||
#define SPI_ADC_SIZE 4
|
||||
|
||||
// static uint16_t spi_LEDtxbuf[SPI_LED_SIZE] = {0};
|
||||
// static uint16_t spi_LEDrxbuf[SPI_LED_SIZE] = {0};
|
||||
|
||||
static uint8_t spi_DACtxbuf[SPI_DAC_SIZE] = {0};
|
||||
static uint8_t spi_rxbuf[SPI_DAC_SIZE] = {0};
|
||||
|
||||
static uint8_t spi_ADC_txbuf[SPI_ADC_SIZE] = {0};
|
||||
static uint8_t spi_ADC_rxbuf[SPI_ADC_SIZE] = {0};
|
||||
static uint16_t ADC_rxbuf = 0;
|
||||
|
||||
static void ELITE15_SPI_HOLD();
|
||||
static void ELITE15_SPI_CLOSE();
|
||||
|
||||
+4
-4
@@ -34,8 +34,8 @@ static uint8_t headstage_battery_percent() {
|
||||
static void headstage_battery_volt(){
|
||||
uint32_t bat_volt = 0;
|
||||
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_BAT), sizeof(spi_ADC_rxbuf));
|
||||
bat_volt = (uint32_t) (spi_ADC_rxbuf[0] << 8) | (uint32_t) (spi_ADC_rxbuf[1]);
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_BAT);
|
||||
bat_volt = (uint32_t) ADC_rxbuf;
|
||||
bat_volt = bat_volt * 12 / 125; //x * 187.5 * 1e-6 * 2 / 125 * 320 * 100 ;
|
||||
// bat_volt = (bat_volt - 1) * 187.5 * 2;
|
||||
|
||||
@@ -53,11 +53,11 @@ static bool EliteADCBattery(){
|
||||
static uint8_t ADCSwitch = 0;
|
||||
bool read_adc_flag = false;
|
||||
if(ADCSwitch == 0){ /**read V**/
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_BAT), sizeof(spi_ADC_rxbuf));
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_BAT);
|
||||
ADCSwitch++;
|
||||
}
|
||||
else if(ADCSwitch == 1){ /**read V**/
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_BAT), sizeof(spi_ADC_rxbuf));
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_BAT);
|
||||
ADCSwitch++;
|
||||
}
|
||||
else if(ADCSwitch == 2){ /**read V(buffer)**/
|
||||
|
||||
+31
-31
@@ -154,8 +154,8 @@ static void read_Iin_change_gain(uint16_t plot_type)
|
||||
if (instru.IinADCAutoGainEn > 1)
|
||||
return;
|
||||
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_CURR), sizeof(spi_ADC_rxbuf));
|
||||
MEAS_CURR(wm) = DecodeADCValue(instru.IinADCGainLv, RIS_ADC_IIN, spi_ADC_rxbuf);
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_CURR);
|
||||
MEAS_CURR(wm) = DecodeADCValue(instru.IinADCGainLv, RIS_ADC_IIN, ADC_rxbuf);
|
||||
|
||||
if (instru.IinADCAutoGainEn) {
|
||||
AutoGainChangeIin(MEAS_CURR(wm), plot, &no_rec_time);
|
||||
@@ -223,8 +223,8 @@ static void read_Vin_change_gain(void)
|
||||
return;
|
||||
|
||||
/* read Vin and do NOT record the Vin after changing gain twice */
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_VIN), sizeof(spi_ADC_rxbuf));
|
||||
MEAS_VIN(wm) = DecodeADCValue(instru.VinADCGainLv, RIS_ADC_VIN, spi_ADC_rxbuf);
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_VIN);
|
||||
MEAS_VIN(wm) = DecodeADCValue(instru.VinADCGainLv, RIS_ADC_VIN, ADC_rxbuf);
|
||||
if (instru.VinADCAutoGainEn) {
|
||||
AutoGainChangeVin(MEAS_VIN(wm));
|
||||
} else {
|
||||
@@ -251,8 +251,8 @@ static void read_Vout_change_gain(void)
|
||||
void *wm = wm_get();
|
||||
|
||||
/* read Vout and do NOT record the Vout after changing gain twice */
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_VOUT), sizeof(spi_ADC_rxbuf));
|
||||
MEAS_VOUT(wm) = DecodeADCValue(0, RIS_ADC_VOUT, spi_ADC_rxbuf);
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_VOUT);
|
||||
MEAS_VOUT(wm) = DecodeADCValue(0, RIS_ADC_VOUT, ADC_rxbuf);
|
||||
|
||||
if (volt_rec_en == false) {
|
||||
rec_cnt++;
|
||||
@@ -429,7 +429,7 @@ static void Iin_Vin_Vout_Plot(uint32_t time)
|
||||
if (batteryCheck_flag && tempCheck_flag) {
|
||||
read_adc_flag = EliteADCBattery();
|
||||
if (!read_adc_flag) {
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_CURR), sizeof(spi_ADC_rxbuf));
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_CURR);
|
||||
ADC_cnt = 5;
|
||||
}
|
||||
|
||||
@@ -461,7 +461,7 @@ static void Iin_Vin_Vout_Plot(uint32_t time)
|
||||
ADC_cnt++;
|
||||
|
||||
} else if (ADC_cnt == 1) {
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_VIN), sizeof(spi_ADC_rxbuf));
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_VIN);
|
||||
ADC_cnt++;
|
||||
|
||||
} else if (ADC_cnt == 2) {
|
||||
@@ -470,7 +470,7 @@ static void Iin_Vin_Vout_Plot(uint32_t time)
|
||||
ADC_cnt++;
|
||||
|
||||
} else if (ADC_cnt == 3) {
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_VOUT), sizeof(spi_ADC_rxbuf));
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_VOUT);
|
||||
ADC_cnt++;
|
||||
|
||||
} else if (ADC_cnt == 4) {
|
||||
@@ -479,7 +479,7 @@ static void Iin_Vin_Vout_Plot(uint32_t time)
|
||||
ADC_cnt++;
|
||||
|
||||
} else if (ADC_cnt == 5) {
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_CURR), sizeof(spi_ADC_rxbuf));
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_CURR);
|
||||
ADC_cnt = 0;
|
||||
}
|
||||
|
||||
@@ -496,7 +496,7 @@ static void Iin_Vin_Plot(void)
|
||||
if (batteryCheck_flag && tempCheck_flag) {
|
||||
read_adc_flag = EliteADCBattery();
|
||||
if (!read_adc_flag) {
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_CURR), sizeof(spi_ADC_rxbuf));
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_CURR);
|
||||
ADC_cnt = 3;
|
||||
}
|
||||
|
||||
@@ -517,7 +517,7 @@ static void Iin_Vin_Plot(void)
|
||||
ADC_cnt++;
|
||||
|
||||
} else if (ADC_cnt == 1) {
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_VIN), sizeof(spi_ADC_rxbuf));
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_VIN);
|
||||
ADC_cnt++;
|
||||
|
||||
} else if (ADC_cnt == 2) {
|
||||
@@ -526,7 +526,7 @@ static void Iin_Vin_Plot(void)
|
||||
ADC_cnt++;
|
||||
|
||||
} else if (ADC_cnt == 3) {
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_CURR), sizeof(spi_ADC_rxbuf));
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_CURR);
|
||||
ADC_cnt = 0;
|
||||
}
|
||||
|
||||
@@ -547,7 +547,7 @@ static void IT_Plot(uint32_t time)
|
||||
if (batteryCheck_flag || tempCheck_flag) {
|
||||
read_adc_flag = EliteADCBattery();
|
||||
if (!read_adc_flag) {
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_CURR), sizeof(spi_ADC_rxbuf));
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_CURR);
|
||||
ADC_cnt = 1;
|
||||
}
|
||||
|
||||
@@ -558,7 +558,7 @@ static void IT_Plot(uint32_t time)
|
||||
* 1 - read Iin and reset ADC_cnt
|
||||
*/
|
||||
if (ADC_cnt == 0) {
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_CURR), sizeof(spi_ADC_rxbuf));
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_CURR);
|
||||
ADC_cnt++;
|
||||
|
||||
return;
|
||||
@@ -590,7 +590,7 @@ static void VT_Plot(void)
|
||||
if (batteryCheck_flag && tempCheck_flag) {
|
||||
EliteADCBattery();
|
||||
if (!batteryCheck_flag) {
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_VIN), sizeof(spi_ADC_rxbuf));
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_VIN);
|
||||
ADC_cnt = 1;
|
||||
}
|
||||
|
||||
@@ -601,7 +601,7 @@ static void VT_Plot(void)
|
||||
* 1 - read Vin and reset ADC_cnt
|
||||
*/
|
||||
if (ADC_cnt == 0) {
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_VIN), sizeof(spi_ADC_rxbuf));
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_VIN);
|
||||
ADC_cnt++;
|
||||
|
||||
return;
|
||||
@@ -627,7 +627,7 @@ static void Vout_Plot(void)
|
||||
if (batteryCheck_flag && tempCheck_flag) {
|
||||
EliteADCBattery();
|
||||
if (!batteryCheck_flag) {
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_VOUT), sizeof(spi_ADC_rxbuf));
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_VOUT);
|
||||
ADC_cnt = 1;
|
||||
}
|
||||
|
||||
@@ -638,7 +638,7 @@ static void Vout_Plot(void)
|
||||
* 1 - read Vout and reset ADC_cnt
|
||||
*/
|
||||
if (ADC_cnt == 0) {
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_VOUT), sizeof(spi_ADC_rxbuf));
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_VOUT);
|
||||
ADC_cnt++;
|
||||
|
||||
return;
|
||||
@@ -673,8 +673,8 @@ static void cali_IT_plot(void) {
|
||||
if (instru.IinADCAutoGainEn) {
|
||||
MEAS_CURR(wm) = 0xFFFF;
|
||||
} else {
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_CURR), sizeof(spi_ADC_rxbuf));
|
||||
MEAS_CURR(wm) = (int32_t) (spi_ADC_rxbuf[0] << 8) | (int32_t) (spi_ADC_rxbuf[1]);
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_CURR);
|
||||
MEAS_CURR(wm) = (int32_t) ADC_rxbuf;
|
||||
if (lastIinADCGainLevel != instru.IinADCGainLv) {
|
||||
IinADCGainCtrl(instru.IinADCGainLv);
|
||||
}
|
||||
@@ -727,14 +727,14 @@ static void cali_IT_plot(void) {
|
||||
}
|
||||
|
||||
if (ADC_cnt == 1) {
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_CURR), sizeof(spi_ADC_rxbuf));
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_CURR);
|
||||
ADC_cnt++;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (ADC_cnt == 2) {
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_CURR), sizeof(spi_ADC_rxbuf));
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_CURR);
|
||||
ADC_cnt = 0;
|
||||
|
||||
return;
|
||||
@@ -761,8 +761,8 @@ static void cali_VT_plot(void) {
|
||||
if (instru.VinADCAutoGainEn) {
|
||||
MEAS_VIN(wm) = 0xFFFF;
|
||||
} else {
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_VIN), sizeof(spi_ADC_rxbuf));
|
||||
MEAS_VIN(wm) = (int32_t) (spi_ADC_rxbuf[0] << 8) | (int32_t) (spi_ADC_rxbuf[1]);
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_VIN);
|
||||
MEAS_VIN(wm) = (int32_t) ADC_rxbuf;
|
||||
if (lastVinADCGainLv != instru.VinADCGainLv) VinADCGainCtrl(instru.VinADCGainLv);
|
||||
}
|
||||
|
||||
@@ -813,14 +813,14 @@ static void cali_VT_plot(void) {
|
||||
}
|
||||
|
||||
if (ADC_cnt == 1) {
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_VIN), sizeof(spi_ADC_rxbuf));
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_VIN);
|
||||
ADC_cnt++;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (ADC_cnt == 2) {
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_VIN), sizeof(spi_ADC_rxbuf));
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_VIN);
|
||||
ADC_cnt = 0;
|
||||
|
||||
return;
|
||||
@@ -844,8 +844,8 @@ static void cali_Vout_plot(void) {
|
||||
*/
|
||||
if (ADC_cnt == 0) {
|
||||
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_VOUT), sizeof(spi_ADC_rxbuf));
|
||||
MEAS_VOUT(wm) = (int32_t) (spi_ADC_rxbuf[0] << 8) | (int32_t) (spi_ADC_rxbuf[1]);
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_VOUT);
|
||||
MEAS_VOUT(wm) = (int32_t) ADC_rxbuf;
|
||||
|
||||
if (volt_rec_en == false) {
|
||||
rec_cnt++;
|
||||
@@ -888,14 +888,14 @@ static void cali_Vout_plot(void) {
|
||||
}
|
||||
|
||||
if (ADC_cnt == 1) {
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_VOUT), sizeof(spi_ADC_rxbuf));
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_VOUT);
|
||||
ADC_cnt++;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (ADC_cnt == 2) {
|
||||
memcpy(spi_ADC_rxbuf, read_adc_data(ADC_CH_VOUT), sizeof(spi_ADC_rxbuf));
|
||||
ADC_rxbuf = read_adc_data(ADC_CH_VOUT);
|
||||
ADC_cnt = 0;
|
||||
|
||||
return;
|
||||
|
||||
+3
-3
@@ -4,9 +4,9 @@
|
||||
|
||||
#define VERSION_DATE_YEAR 22
|
||||
#define VERSION_DATE_MONTH 7
|
||||
#define VERSION_DATE_DAY 19
|
||||
#define VERSION_DATE_HOUR 17
|
||||
#define VERSION_DATE_MINUTE 47
|
||||
#define VERSION_DATE_DAY 22
|
||||
#define VERSION_DATE_HOUR 9
|
||||
#define VERSION_DATE_MINUTE 26
|
||||
|
||||
// this is NOT the version hash !!
|
||||
// it's the last version hash
|
||||
|
||||
+4
-4
@@ -1389,8 +1389,8 @@ static void update_ZM_instruction(uint8 *ins) {
|
||||
initCISBuf();
|
||||
|
||||
cis_buf[0] = 2;
|
||||
cis_buf[1] = spi_ADC_rxbuf[0];
|
||||
cis_buf[2] = spi_ADC_rxbuf[1];
|
||||
cis_buf[1] = (uint8_t) ADC_rxbuf >> 8;
|
||||
cis_buf[2] = (uint8_t) ADC_rxbuf;
|
||||
SimpleProfile_SetParameter(BLE_CIS_BUFF_CHAR, BLE_CIS_BUFF_SIZE, cis_buf);
|
||||
break;
|
||||
}
|
||||
@@ -1399,8 +1399,8 @@ static void update_ZM_instruction(uint8 *ins) {
|
||||
case 0x51: {
|
||||
initCISBuf();
|
||||
cis_buf[0] = 2;
|
||||
cis_buf[1] = spi_ADC_rxbuf[0];
|
||||
cis_buf[2] = spi_ADC_rxbuf[1];
|
||||
cis_buf[1] = (uint8_t) ADC_rxbuf >> 8;
|
||||
cis_buf[2] = (uint8_t) ADC_rxbuf;
|
||||
SimpleProfile_SetParameter(BLE_CIS_BUFF_CHAR, BLE_CIS_BUFF_SIZE, cis_buf);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user