Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1
170
Ver.1.0.0
The code above shows processing of timer task function: If the return value of this
function is less than 0, this timer task will be deleted and won’t be responded; if the
return value is 0, the previous timing value will be retained; if the return value is more
than 0, this return value will be used as the new timing cycle (unit: us).
4) In step 3), if tasks in timer task table change, the previous time sequence may be
disturbed, and re-ordering is needed.
if
(change_flg){
blt_soft_timer_sort();
}
5) If the nearest timer task will be responded within 3s (it can be modified as a value
larger than 3s as needed) from now, the response time will be set as wakeup time of
APP layer in advance; otherwise APP layer wakeup in advance will be disabled.
if
( (
u32
)(blt_timer.
timer
[0].
t
- now) < 3000 *
CLOCK_SYS_CLOCK_1MS
){
bls_pm_setAppWakeupLowPower(blt_timer.
timer
[0].
t
, 1);
}
else
{
bls_pm_setAppWakeupLowPower(0, 0);
//disable
}