Other Parts Discussed in Thread: CC2540
Hello,
I am using the CC2540 miniDK and I am trying to set a ISR from a motion detection by the cma3000d accelerometer. After entering the ISR some sort of warning should be communicated to the USB dongle.
My code follows the same line of though as the one discribed in this post:
http://e2e.ti.com/support/low_power_rf/f/538/t/132241.aspx?pi267162=2
To verify if the interruption is executed when motion is detected, I've put some code inside the ISR to light the leds.
I've tested this using Btool to activate the accelerometer (writting 1 to 0x0034) and moving the keyfob around, verifying that the leds would light up.
Now, I am not sure if this line of code is the correct to issue any bluetooth communication:
osal_set_event(keyfobapp_TaskID, KFD_ACCEL_READ_EVT); // from OSAL.c that calls OSAL_KeyFobDemo.c for task initialization
Should I use this function instead (as in the hal_key.c file):
osal_start_timerEx (Hal_TaskID, HAL_KEY_EVENT, HAL_KEY_DEBOUNCE_VALUE);
I've been studying the code in the BLE stack, but I found a dead end, since I do not understand how the ISR would possibly send any accelerometric data to the usb dongle using the lines of code above. Although I didn't found any clarification in after studying the routines that send info to be displayed in the Btool interface: buzzer functionlity, key activation, the comunication when the acceleromter is tilted.
I am sorry if I haven't been very clear in my question. I hope you can give me some hints.
Thanks in advance,
N.