mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-09-28 04:40:52 +00:00
Make sure the default power saving mode is applied by default (#3370)
This commit is contained in:
parent
0e7b1c3b8d
commit
c92d0d3667
@ -36,7 +36,6 @@ use esp_wifi_sys::include::{
|
||||
esp_eap_fast_config,
|
||||
esp_wifi_sta_enterprise_enable,
|
||||
wifi_pkt_rx_ctrl_t,
|
||||
wifi_ps_type_t_WIFI_PS_NONE,
|
||||
wifi_scan_channel_bitmap_t,
|
||||
WIFI_PROTOCOL_11AX,
|
||||
WIFI_PROTOCOL_11B,
|
||||
@ -2595,6 +2594,10 @@ pub fn new<'d>(
|
||||
inited: &'d EspWifiController<'d>,
|
||||
_device: crate::hal::peripherals::WIFI<'d>,
|
||||
) -> Result<(WifiController<'d>, Interfaces<'d>), WifiError> {
|
||||
let mut controller = WifiController {
|
||||
_phantom: Default::default(),
|
||||
};
|
||||
|
||||
if !inited.wifi() {
|
||||
crate::wifi::wifi_init()?;
|
||||
|
||||
@ -2617,14 +2620,11 @@ pub fn new<'d>(
|
||||
esp_wifi_result!(esp_wifi_set_country(&country))?;
|
||||
}
|
||||
|
||||
esp_wifi_result!(unsafe {
|
||||
esp_wifi_sys::include::esp_wifi_set_ps(wifi_ps_type_t_WIFI_PS_NONE)
|
||||
})?;
|
||||
controller.set_power_saving(PowerSaveMode::default())?;
|
||||
}
|
||||
|
||||
Ok((
|
||||
WifiController {
|
||||
_phantom: Default::default(),
|
||||
},
|
||||
controller,
|
||||
Interfaces {
|
||||
sta: WifiDevice {
|
||||
_phantom: Default::default(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user