mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
feat(wifi): add sleep retention attach/detach in hw start/stop
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2024-2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user