mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
change(esp_wifi): support wifi module retention runtime attach and detach
This commit is contained in:
@@ -316,6 +316,7 @@ 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);
|
||||
@@ -326,12 +327,22 @@ void esp_phy_sleep_data_init(void)
|
||||
err = sleep_retention_module_allocate(SLEEP_RETENTION_MODULE_WIFI_BB);
|
||||
if (err != ESP_OK) {
|
||||
ESP_LOGW(TAG, "failed to allocate sleep retention linked list for wifi bb retention");
|
||||
return;
|
||||
}
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
void esp_phy_sleep_data_deinit(void)
|
||||
{
|
||||
esp_err_t err = sleep_retention_module_free(SLEEP_RETENTION_MODULE_WIFI_BB);
|
||||
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 = sleep_retention_module_free(SLEEP_RETENTION_MODULE_WIFI_BB);
|
||||
if (err != ESP_OK) {
|
||||
ESP_LOGW(TAG, "failed to free sleep retention linked list for wifi bb retention");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user