ADC check

This commit is contained in:
YiChin
2019-06-13 17:46:00 +08:00
parent e0c7786752
commit 56093efb5a
3 changed files with 21 additions and 19 deletions
@@ -513,6 +513,21 @@ static uint8_t NotifyCurrent[4] = {0};
static uint8_t NotifyVolt[4] = {0};
static uint8_t NotifyImpedance[4] = {0};
/* application use SPI parameters and buffers */
#define SPI_LED_SIZE 20
#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};
/**
* counter of notify send.
*/
@@ -956,7 +971,7 @@ static void update_ZM_instruction(uint8 *ins) {
break;
}
}
SimpleProfile_SetParameter(BLE_CIS_BUFF_CHAR, 4, NotifyVolt);
SimpleProfile_SetParameter(BLE_CIS_BUFF_CHAR, 4, spi_ADC_rxbuf);
SimpleProfile_SetParameter(BLE_DAT_BUFF_CHAR, 4, NotifyVolt);
break;
@@ -36,19 +36,7 @@ static void SimpleBLEPeripheral_performPeriodicTask();
==== SPI ====
===========*/
/* application use SPI parameters and buffers */
#define SPI_LED_SIZE 20
#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};
/*============
==== PIN ====
@@ -621,20 +621,19 @@ static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1) {
}
else if(counter6994 == 35){
PIN_setOutputValue(pin_handle, shutdown_6994, 0); // OFF = 1 => turn off 6994
PIN_setOutputValue(pin_handle, enable_10v, 0); // enable 10V
counter6994 ++;
}
else if ((counter6994 > 35) && (counter6994 < 70)) {
}/*
else if ((counter6994 > 35) && (counter6994 < 300)) {
// PIN_setOutputValue(pin_handle, shutdown_6994, 0); // OFF = 1 => turn off 6994
// PIN_setOutputValue(pin_handle, enable_10v, 0); // enable 10V
counter6994 ++;
}
else if(counter6994 == 70){
else if(counter6994 == 300){
// PIN_setOutputValue(pin_handle, shutdown_6994, 0); // OFF = 1 => turn off 6994
// PIN_setOutputValue(pin_handle, enable_10v, 1); // enable 10V
PIN_setOutputValue(pin_handle, enable_10v, 1); // enable 10V
LED_color(0xE1, 0x00, 0x00, 0xF4);
counter6994 ++;
}
}*/
EliteKeyPress(key);
}
else{