From 4d3129782e28bdbc0f4de508c2f6c0bf021b5c1f Mon Sep 17 00:00:00 2001 From: YiChin Date: Thu, 26 Sep 2019 14:46:52 +0800 Subject: [PATCH] gptimer_open has a bug --- .../cc26xx/app/headstage/EliteGPTimer.h | 5 +---- .../cc26xx/app/headstage/impedance_meter.h | 11 +++++++---- .../simple_peripheral/cc26xx/app/simple_peripheral.c | 9 +++++++-- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteGPTimer.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteGPTimer.h index 7e8d184aa..eb853495d 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteGPTimer.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteGPTimer.h @@ -12,10 +12,7 @@ static GPTimerCC26XX_Handle gptimer_handle; -static void elite_gptimer_callback(GPTimerCC26XX_Handle handle, GPTimerCC26XX_IntMask interruptMask) { -// flag_notify(EVT_PERIODIC_GPTIMER); - Semaphore_post(semaphore); -} +static void elite_gptimer_callback(GPTimerCC26XX_Handle handle, GPTimerCC26XX_IntMask interruptMask); #define elite_gptimer_start() GPTimerCC26XX_start(gptimer_handle) #define elite_gptimer_stop() GPTimerCC26XX_stop(gptimer_handle) diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/impedance_meter.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/impedance_meter.h index bf5b49d92..b6a55149a 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/impedance_meter.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/impedance_meter.h @@ -28,9 +28,15 @@ static void SimpleBLEPeripheral_clockHandler(UArg arg) { // Wake up the application. // Semaphore_post(semaphore); // send samaphore to jump out of infinite waiting(simple_peripheral.c line570) + +} +static void elite_gptimer_callback(GPTimerCC26XX_Handle handle, GPTimerCC26XX_IntMask interruptMask) { +// flag_notify(EVT_PERIODIC_GPTIMER); +// Semaphore_post(semaphore); LED_color(DARKLED, 0xFF, 0x00, 0x00); } + static void ZM_update_instruction_callback(uint8_t ins_type, uint8_t chip_ID, uint8_t *ins); static void ZM_init() { @@ -47,10 +53,7 @@ static void ZM_init() { InitEliteInstruction(); InitCurrentUserCode(); - elite_gptimer_open(); - - // init DAC, set output ~= 0 V - DAC_outputV(Usercode_Correction_to_DAC(24999)); +// elite_gptimer_open(); // PIN_registerIntCb(pin_handle, switch_on_callback); // PIN_setInterrupt(pin_handle, switch_on | PIN_IRQ_POSEDGE); diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/simple_peripheral.c b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/simple_peripheral.c index 48b9d728f..a03537df0 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/simple_peripheral.c +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/simple_peripheral.c @@ -547,8 +547,8 @@ static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1) { SimpleBLEPeripheral_init(); headstage_init_device_info(); - Elite_SPI_init(); ZM_init(); + Elite_SPI_init(); uint8_t key = 0; uint8_t counter6994 = 0; @@ -556,10 +556,15 @@ static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1) { // 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 - elite_gptimer_start(); + + // init DAC, set output ~= 0 V + DAC_outputV(Usercode_Correction_to_DAC(24999)); + PIN_setOutputValue(pin_handle, enable_5v, 1); // enable 5V TurnOn10V(); LEDPowerON(); + +// elite_gptimer_start(); // Application main loops for (;;) { // Waits for a signal to the semaphore associated with the calling thread.