feat(wifi): add sleep retention attach/detach in hw start/stop

This commit is contained in:
sibeibei
2026-05-21 11:46:16 +08:00
committed by BOT
parent 7b541be9d5
commit 68c9de209b
13 changed files with 341 additions and 28 deletions
@@ -184,10 +184,29 @@ static esp_err_t sleep_retention_wifi_bb_init(void *arg)
return ESP_OK;
}
esp_err_t esp_phy_wifi_bb_sleep_retention_attach(void)
{
esp_err_t err = sleep_retention_module_attach(SLEEP_RETENTION_MODULE_WIFI_BB);
if (err != ESP_OK) {
ESP_LOGW(TAG, "failed to attach sleep retention linked list for wifi bb retention");
}
return err;
}
esp_err_t esp_phy_wifi_bb_sleep_retention_detach(void)
{
esp_err_t err = sleep_retention_module_detach(SLEEP_RETENTION_MODULE_WIFI_BB);
if (err != ESP_OK) {
ESP_LOGW(TAG, "failed to detach sleep retention linked list for wifi bb retention");
}
return err;
}
void esp_phy_sleep_data_init(void)
{
sleep_retention_module_init_param_t init_param = {
.cbs = { .create = { .handle = sleep_retention_wifi_bb_init, .arg = NULL } },
.attribute = SLEEP_RETENTION_MODULE_ATTR_ATTACH,
.depends = RETENTION_MODULE_BITMAP_INIT(CLOCK_MODEM)
};
esp_err_t err = sleep_retention_module_init(SLEEP_RETENTION_MODULE_WIFI_BB, &init_param);