Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1
123
Ver.1.0.0
if(Link Layer State is in Advertising state orConn state Slave role)
{
if(Link Layer in Adv Event or Brx Event)
// BLE packet transfer is ongoing, not
enter low power mode
{
return 0;
}
else
{
blt_brx_sleep ();
//suspend & wakeup processing function
}
}
return 1;
}
1) W
hen “bltPm.suspend_mask” is set to “SUSPEND_DISALE”, “blt_brx_sleep” will not
be executed. When users u
se “bls_pm_setSuspendMask (SUSPEND_DISABLE)”,
the logic of BLE low power management mechanism will become totally invalid,
MCU will not enter low power mode and loop of while(1) is being executed nonstop.
2) If Adv Event of Advertising State or Brx Event of Conn state Slave role is being
executed, “blt_brx_sleep” will not be executed as RF task is in operation, SDK only
enter sleep mode after Adv Event or Brx Event is completed.
“blt_brx_sleep” will be executed only if it is not under the two conditions above.
void
blt_brx_sleep (void)
{
if( (Link Layer state == Adv state)&& (SuspendMask&SUSPEND_ADV) )
{
//enter suspend from current Adv state
Execute callback function of event “BLT_EV_FLAG_SUSPEND_ENTER”
cpu_sleep_wakeup (0, PM_WAKEUP_TIMER | WakeupSource,
T_adver advInterval);
//suspend
Execute callback function of event “BLT_EV_FLAG_SUSPEND_EXIT”
if(current suspend is woken up by GPIO CORE in advance)
{