Hi,
I need to do 250Hz (4ms) stable periodic application work. My code is as below
Clock Construction
Clock_Params clockParams;
// Convert clockDuration in milliseconds to ticks.
uint32_t clockTicks = 400;
// Setup parameters.
Clock_Params_init(&clockParams);
// Setup argument.
clockParams.arg = SAMPLING_ON;
// If period is 0, this is a one-shot timer.
clockParams.period = 400;
// Starts immediately after construction if true, otherwise wait for a call
// to start.
clockParams.startFlag = false;
// Initialize clock instance.//clockHandler //SimpleBLEPeripheral_clockHandler
Clock_construct(&SamplingClock, clockHandler, clockTicks, &clockParams);
ClockHandler function is as below
static void clockHandler(UArg arg) {
// Store the event.
events |= arg;
Semaphore_post(sem_SPI);
// Wake up the application.
Semaphore_post(sem);
}
The Sampling is stable without connecting to the mobile phone. I had kept more than one day without any losses of the device. But when the mobile phone connecting to the device it losses samples.
sem_SPI is pend at another task.
I tried to solve problem increasing priority of the task. For that I have tried setting priority to 6. But the problem remained same.
And I made a counter in clockHandler and it revealed me that clockHandler is not called properly. It losses samples.
Can anyone help me to solve this out.
BLE Stack 2.1
TI-RTOS 2.13.0.06
XDC Tools 3.31.1.33