How to use blecm_startTimerSource ?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

The documentation of blecm_startTimerSource is quite sparse.

What parameter is passed to the callback function?

I call:

blecm_startTimerSource(12, TimerCallback, 100)

but TimerCallback never gets called.

Is there any updated API documenation available?

The v2.2.2 leaves out a number of details

0 Likes
1 Solution

I was advised that blecm_startTimerSource () is actually being used by the chip's internal ROM code and therefore not available for application use. However you can use bleprofile_regTimerCb to create your timer.

View solution in original post

6 Replies
BoonT_56
Employee
Employee
500 likes received 250 likes received 100 likes received

I found the below from the API documentation in the SDK. Is this what you are looking for?

void blecm_startTimerSource (INT32 id,
BLECM_FUNC_WITH_PARAM appCb,
UINT32 ticks
)

Starts a software timer.

Starts a low level software timer.

Parameters
idID of the software timer.
appCbApplication callback function.
ticksThe interval of the timer in OS ticks (12.5mS units).
Anonymous
Not applicable

That docu I know.

But how to define appCb?

0 Likes

typedef INT32(*BLECM_FUNC_WITH_PARAM)(void *);

Is this what you are looking for?

0 Likes
Anonymous
Not applicable

Yes,

BLECM_FUNC_WITH_PARAM says:

-- function with parameter --

So what parameter has to filled in here:

void TimerCallback(??)

{

  ble_trace0("--Timer Triggered");

}

This should call TimerCallback after one seconds, right?

     blecm_startTimerSource(12, TimerCallback, 1000)

But it never gets called, why?

0 Likes

Just to let you know that we are checking with the factory on the above issue.

I was advised that blecm_startTimerSource () is actually being used by the chip's internal ROM code and therefore not available for application use. However you can use bleprofile_regTimerCb to create your timer.