The functions should work - sorry that you are having problems.
Can you post a small code snippet of how you are using them?
Actually I think I figured out my issue, are the timeouts expressed in seconds?
For my application I need to use a 1/10 second granularity timer, is there a similar facility based on the fine timer?
Also, do I need to call bleapptimer_init()?
Here is an example code trying to use the fine timer:
void tm_cb(UINT32 arg)
// .. do someting, this gets called every 100ms?
// will this timer get retriggered automatically?
bleapptimer_startFineTimer(tm_cb, 100); // 100ms
// later we shut down the timer
1. do I need to call bleapptimer_init()?
2. how does this interact with a call to
OK, this worked after I removed the call to reTimerCb, but the timer is only firing every second, not 10 times per second. should the call
be 100 ms or some other unit?
is there some other mode i need to enable?
I would not recommend to start/stop fine timer.
We say in the code:
// This function will start a fine resolution timer. It should be used with care.
You should use app timer, or just rely on fine timer callbacks.
Will this work for you?
That works for me, although I've found that after advertisements stop the fine timer changes from 10Hz to 2 Hz.
Is there some way to prevent it from going into this slower mode?
1 of 1 people found this helpful
To witness the problem of the timer changing from 10Hz (100mS) to 2Hz (500ms):
Add bleapp_trace_enable=2 in the APPLICATION_INIT(). Uncomment ble_trace1("hello...") in hello_sensor_fine_timeout(). Compile/program the TAG. Flip Switches 2,3 of the SW4 bank so we can see debug print statements. Power cycle the TAG, launch Terminal Program on the COM port the TAG is on to witness the debug prints.
They look similar to this....
After 30 seconds you see the "cadence" of the message change to 2Hz:
AppTimer(adv, conn) stopped: 1
My investigation indicates that after high_undirect_adv_duration expires (30 seconds), the program switches away from using high_undirect_adv_interval (32 slots) over to using low_undirect_adv_interval (1024 slots).
If I now change low_undirect_adv_interval from 1024 to 32, the cadence of the output messages does not drop down to 2Hz. Not sure of the ramifications of this change but will continue to investigate and report back.
Note: fine_timer_interval has a default value of 1,000mS. At the advice of the originator of the post, it was changed to 100mS to reproduce the exact issue described above.