找回密码
 立即注册

微信扫码登录

查看: 14|回复: 0

[BLE SDK] Sleep scan in adv mode

[复制链接]

1

主题

0

回帖

17

积分

英勇黄铜

积分
17
发表于 11 小时前 | 显示全部楼层 |阅读模式 来自 瑞士
Information
说明:   建议参照本版块置顶帖内容输入必要信息
芯片型号: TLSR8251
SDK及版本: Telink_825X_SDK
I tested sleep mode and scan in adv mode. After sleep scan in adv mode does not work, what has to be initialized on wakeup?

call for sleep:
bls_pm_setSuspendMask (SUSPEND_ADV | DEEPSLEEP_RETENTION_ADV | SUSPEND_CONN | DEEPSLEEP_RETENTION_CONN);

Main:
_attribute_ram_code_ int main (void)    //must run in ramcode
{
    blc_pm_select_internal_32k_crystal();
    cpu_wakeup_init();
    int deepRetWakeUp = pm_is_MCU_deepRetentionWakeup();  //MCU deep retention wakeUp
    rf_drv_init(RF_MODE_BLE_1M);
    gpio_init( !deepRetWakeUp );  //analog resistance will keep available in deepSleep mode, so no need initialize again
#if (CLOCK_SYS_CLOCK_HZ == 16000000)
    clock_init(SYS_CLK_16M_Crystal);
#elif (CLOCK_SYS_CLOCK_HZ == 24000000)
    clock_init(SYS_CLK_24M_Crystal);
#endif
    blc_app_loadCustomizedParameters();
   
    init_i2c();
    if( deepRetWakeUp ){
        user_init_deepRetn ();
    }
    else{
        user_init_normal ();
    }   
    irq_enable();
    while (1) {
        main_loop ();
    }
}

Function called on wakeup:
_attribute_ram_code_ void user_init_deepRetn(void){//after sleep this will get executed
    init_lcd_deepsleep();
    blc_ll_initBasicMCU();
    rf_set_power_level_index (RF_POWER_P3p01dBm);
    blc_ll_recoverDeepRetention();
}





您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Telink forum ( 沪ICP备17008231号-1 )

GMT+8, 2025-9-16 11:17 , Processed in 0.095394 second(s), 20 queries .

Powered by Telink 隐私政策

泰凌微电子版权所有 © 。保留所有权利。 2024

快速回复 返回顶部 返回列表