Elite 1.4-re LED
This commit is contained in:
+2
-2
@@ -1148,7 +1148,7 @@ static void headstage_gptimer_callback(GPTimerCC26XX_Handle handle, GPTimerCC26X
|
||||
#include "EliteNotify.h"
|
||||
#include "impedance_meter.h"
|
||||
|
||||
#endif // HEADSTAGE_H
|
||||
|
||||
|
||||
/*========================
|
||||
==== gap information ====
|
||||
@@ -1261,4 +1261,4 @@ static void headstage_init_device_info() {
|
||||
GAPRole_SetParameter(GAPROLE_SCAN_RSP_DATA, p - scanRspData, scanRspData);
|
||||
}
|
||||
|
||||
|
||||
#endif // HEADSTAGE_H
|
||||
|
||||
+22
-4
@@ -176,7 +176,7 @@ static uint8_t ADC_overflow(uint8_t gain, uint16_t rawdata){
|
||||
}
|
||||
}
|
||||
else if(gain == 1){
|
||||
if( ((0x5fb2 < rawdata) && (rawdata < 0x6589)) || ((0x5999 < rawdata) && (rawdata < 0x5f75)) ){
|
||||
if( ((0x5f97 < rawdata) && (rawdata < 0x6589)) || ((0x5999 < rawdata) && (rawdata < 0x5f93)) ){
|
||||
return 1;
|
||||
};
|
||||
}
|
||||
@@ -188,13 +188,12 @@ static void IT_Plot() {
|
||||
// ADC gain is don't care when measuring voltage
|
||||
uint8_t ADCGain = 0;
|
||||
|
||||
for(int i=0 ; i<3 ; i++){
|
||||
ADCGain = i;
|
||||
for(int ADCGain=0 ; ADCGain<3 ; ADCGain++){
|
||||
|
||||
// read ADC volt
|
||||
ADCGainControl(ADCGain);
|
||||
ADCChannelSelect(ADC_CH_CURRENT);
|
||||
CPUdelay(1600);
|
||||
CPUdelay(8000);
|
||||
ADC_read(spi_ADC_rxbuf);
|
||||
|
||||
uint16_t rawdata = ( ((uint16_t) (spi_ADC_rxbuf[0] << 8 )) | (spi_ADC_rxbuf[1]) );
|
||||
@@ -205,6 +204,25 @@ static void IT_Plot() {
|
||||
}
|
||||
}
|
||||
|
||||
// use LED to check auto shifting function
|
||||
switch(ADCGain){
|
||||
case 0:{
|
||||
LED_color(DARKLED, 0xFF, 0xB4, 0x00);
|
||||
break;
|
||||
}
|
||||
case 1:{
|
||||
LED_color(DARKLED, 0x14, 0xC8, 0xFF);
|
||||
break;
|
||||
}
|
||||
case 2:{
|
||||
LED_color(DARKLED, 0xFF, 0xFF, 0xFF);
|
||||
break;
|
||||
}
|
||||
default:{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// decode ADC value and put it into notify buffer
|
||||
DecodeADCValue(ADCGain, ADC_CH_CURRENT, spi_ADC_rxbuf);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user