Merge remote-tracking branch 'origin/Elite_14re_demo' into Elite_14re_demo
# Conflicts: # simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage.h
This commit is contained in:
-59
@@ -334,12 +334,10 @@ static void DPVCurve(){
|
||||
|
||||
// output a certain volt
|
||||
if( counter <= (PulsePeriod - PulseWidth) ) {
|
||||
LED_color(DARKLED, 0x3A, 0x17, 0xff); //blue
|
||||
outputV = Volt1;
|
||||
DAC_outputV(Volt1);
|
||||
}
|
||||
else {
|
||||
LED_color(DARKLED, 0xF0, 0xE7, 0x26); //yellow
|
||||
outputV = Volt2;
|
||||
DAC_outputV(Volt2);
|
||||
}
|
||||
@@ -377,60 +375,6 @@ static void DPVCurve(){
|
||||
|
||||
|
||||
}
|
||||
/*
|
||||
static void DPVCurve(){
|
||||
static uint8_t counter;
|
||||
static uint16_t Volt1;
|
||||
static uint16_t Volt2;
|
||||
static uint16_t outputV;
|
||||
static bool direction_up;
|
||||
float VoltValue;
|
||||
|
||||
// reset origin volt at the begin
|
||||
if (DACreset){
|
||||
|
||||
Volt1 = VoltOrigin;
|
||||
Volt2 = 0x0000;
|
||||
DACreset = false;
|
||||
}
|
||||
|
||||
if(counter == PulsePeriod) counter = 1;
|
||||
else counter ++;
|
||||
|
||||
// output a certain volt
|
||||
if( counter <= (PulsePeriod - PulseWidth)) outputV = Volt1;
|
||||
else outputV = Volt2;
|
||||
|
||||
DAC_outputV(outputV);
|
||||
|
||||
// record the output voltage
|
||||
int32_t Vout = 0;
|
||||
int16_t decode = outputV;
|
||||
VoltValue = decode * (-2.9780379) + 5920.324416;
|
||||
Vout = (int32_t) (VoltValue / 1);
|
||||
// VoltValue = (ramp1*16 + ramp0/16) * 3.05;
|
||||
|
||||
|
||||
// check if we reach the final volt
|
||||
|
||||
if ( (( outputV >= VoltFinal) && direction_up ) || (( outputV <= VoltFinal) && !direction_up)) {
|
||||
PeriodicEvent = false;
|
||||
DACreset = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if(Volt1 >= VoltFinal){
|
||||
PeriodicEvent = false;
|
||||
DACreset = true;
|
||||
return;
|
||||
}
|
||||
|
||||
//check overflow/underflow and prepare for next output
|
||||
|
||||
Volt1 = Volt1 + Amplitude;
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
static void CVCurve(){
|
||||
|
||||
@@ -885,8 +829,6 @@ static void CleanBuffer(){
|
||||
Step = 10; // 10 = 0x0A ~= 3.05 mv ~= 3 mv
|
||||
StepTime = 24; // 0x30 = 2'd48 ~= 2 second, 24 = 0x18
|
||||
StepTimeCounter = 1;
|
||||
SampleRate = 1;
|
||||
SampleRate_counter = 1;
|
||||
|
||||
for(int i=0 ; i<SPI_LED_SIZE ; i++){
|
||||
spi_LEDtxbuf[i] = 0;
|
||||
@@ -984,7 +926,6 @@ static void EliteNotifyControl(){
|
||||
|
||||
if (SampleRate_counter == SampleRate) {
|
||||
SendNotify();
|
||||
// LED_color(DARKLED, 231, 48, 213);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -376,7 +376,7 @@ static void SimpleBLEPeripheral_clockHandler(UArg arg);
|
||||
//#define DEFAULT_DESIRED_MIN_CONN_INTERVAL 80
|
||||
|
||||
// How often to perform periodic event (in msec)
|
||||
#define SBP_PERIODIC_EVT_PERIOD 8 // 802 ~= 1 sec
|
||||
#define SBP_PERIODIC_EVT_PERIOD 10 // 802 ~= 1 sec
|
||||
|
||||
static void SimpleBLEPeripheral_init(void) {
|
||||
// ******************************************************************
|
||||
@@ -555,7 +555,7 @@ static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1) {
|
||||
uint8_t counter6994 = 0;
|
||||
bool EliteOn = 0;
|
||||
|
||||
Util_constructClock(&periodicClock, SimpleBLEPeripheral_clockHandler, SBP_PERIODIC_EVT_PERIOD, 0, false, SBP_PERIODIC_EVT); //create a clock clockduration = 42(~=0.05 sec)
|
||||
Util_constructClock(&periodicClock, SimpleBLEPeripheral_clockHandler, SBP_PERIODIC_EVT_PERIOD, 0, false, SBP_PERIODIC_EVT); //create a clock clockduration = 42(~=0.01 sec)
|
||||
Util_startClock(&periodicClock); // start the clock, timeup => call SimpleBLEPeripheral_clockHandler => wake up the device
|
||||
|
||||
// Application main loops
|
||||
|
||||
Reference in New Issue
Block a user