mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-14 14:06:54 +00:00
power save: wifi beacon monitor support for esp32c6
power save: fix multicast more data always true cause wifi goto sleep fail
This commit is contained in:
@@ -56,6 +56,28 @@ uint64_t g_wifi_feature_caps =
|
||||
#endif
|
||||
0;
|
||||
|
||||
#if SOC_PM_SUPPORT_PMU_MODEM_STATE
|
||||
# define WIFI_BEACON_MONITOR_CONFIG_DEFAULT(ena) { \
|
||||
.enable = (ena), \
|
||||
.loss_timeout = CONFIG_ESP_WIFI_SLP_BEACON_LOST_TIMEOUT, \
|
||||
.loss_threshold = CONFIG_ESP_WIFI_SLP_BEACON_LOST_THRESHOLD, \
|
||||
.delta_intr_early = 0, \
|
||||
.delta_loss_timeout = 0, \
|
||||
.beacon_abort = 1, \
|
||||
.broadcast_wakeup = 1, \
|
||||
.tsf_time_sync_deviation = 5, \
|
||||
.modem_state_consecutive = 10, \
|
||||
.rf_ctrl_wait_cycle = 20 \
|
||||
}
|
||||
#else
|
||||
# define WIFI_BEACON_MONITOR_CONFIG_DEFAULT(ena) { \
|
||||
.enable = (ena), \
|
||||
.loss_timeout = CONFIG_ESP_WIFI_SLP_BEACON_LOST_TIMEOUT, \
|
||||
.loss_threshold = CONFIG_ESP_WIFI_SLP_BEACON_LOST_THRESHOLD, \
|
||||
.delta_intr_early = CONFIG_ESP_WIFI_SLP_PHY_ON_DELTA_EARLY_TIME, \
|
||||
.delta_loss_timeout = CONFIG_ESP_WIFI_SLP_PHY_OFF_DELTA_TIMEOUT_TIME \
|
||||
}
|
||||
#endif
|
||||
|
||||
static const char* TAG = "wifi_init";
|
||||
|
||||
@@ -113,7 +135,8 @@ esp_err_t esp_wifi_deinit(void)
|
||||
}
|
||||
|
||||
#if CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT
|
||||
esp_wifi_beacon_monitor_configure(false, 0, 0, 0, 0);
|
||||
wifi_beacon_monitor_config_t monitor_config = WIFI_BEACON_MONITOR_CONFIG_DEFAULT(false);
|
||||
esp_wifi_beacon_monitor_configure(&monitor_config);
|
||||
#endif
|
||||
|
||||
#if CONFIG_ESP_WIFI_SLP_IRAM_OPT
|
||||
@@ -124,7 +147,7 @@ esp_err_t esp_wifi_deinit(void)
|
||||
esp_pm_unregister_skip_light_sleep_callback(esp_wifi_internal_is_tsf_active);
|
||||
esp_pm_unregister_inform_out_light_sleep_overhead_callback(esp_wifi_internal_update_light_sleep_wake_ahead_time);
|
||||
esp_sleep_disable_wifi_wakeup();
|
||||
# if CONFIG_ESP_WIFI_AUTO_BEACON_ENABLE
|
||||
# if CONFIG_ESP_WIFI_ENHANCED_LIGHT_SLEEP
|
||||
esp_sleep_disable_wifi_beacon_wakeup();
|
||||
# endif
|
||||
#endif /* SOC_WIFI_HW_TSF */
|
||||
@@ -240,7 +263,7 @@ esp_err_t esp_wifi_init(const wifi_init_config_t *config)
|
||||
return ret;
|
||||
}
|
||||
esp_sleep_enable_wifi_wakeup();
|
||||
# if CONFIG_ESP_WIFI_AUTO_BEACON_ENABLE
|
||||
# if CONFIG_ESP_WIFI_ENHANCED_LIGHT_SLEEP
|
||||
esp_sleep_enable_wifi_beacon_wakeup();
|
||||
# endif
|
||||
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
|
||||
@@ -276,9 +299,8 @@ esp_err_t esp_wifi_init(const wifi_init_config_t *config)
|
||||
}
|
||||
}
|
||||
#if CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT
|
||||
esp_wifi_beacon_monitor_configure(true, CONFIG_ESP_WIFI_SLP_BEACON_LOST_TIMEOUT,
|
||||
CONFIG_ESP_WIFI_SLP_BEACON_LOST_THRESHOLD, CONFIG_ESP_WIFI_SLP_PHY_ON_DELTA_EARLY_TIME,
|
||||
CONFIG_ESP_WIFI_SLP_PHY_OFF_DELTA_TIMEOUT_TIME);
|
||||
wifi_beacon_monitor_config_t monitor_config = WIFI_BEACON_MONITOR_CONFIG_DEFAULT(true);
|
||||
esp_wifi_beacon_monitor_configure(&monitor_config);
|
||||
#endif
|
||||
adc2_cal_include(); //This enables the ADC2 calibration constructor at start up.
|
||||
|
||||
|
Reference in New Issue
Block a user