Skip to content

Commit

Permalink
cfg away ps API
Browse files Browse the repository at this point in the history
  • Loading branch information
MabezDev committed Nov 7, 2024
1 parent b783b9d commit 1338c31
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
1 change: 1 addition & 0 deletions esp-wifi/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- No need to add `rom_functions.x` manually anymore (#2374)
- esp-now: Data is now private in `ReceivedData` - use `data()`(#2396)
- Changed the async APIs to have a `_async` postfix to avoid name collisions (#2446)
- `phy_enable_usb` is enabled by default (#2446)

### Fixed

Expand Down
4 changes: 1 addition & 3 deletions esp-wifi/src/esp_now/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,8 @@ impl EspNowManager<'_> {
Ok(())
}

#[cfg(coex)]
/// Configures modem power saving
///
/// This is ignored, and set to `PowerSaveMode::Minimum` when `coex` is
/// enabled.
pub fn set_power_saving(&self, ps: PowerSaveMode) -> Result<(), WifiError> {
crate::wifi::apply_power_saving(ps)
}
Expand Down
7 changes: 1 addition & 6 deletions esp-wifi/src/wifi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2591,10 +2591,8 @@ impl<'d> WifiController<'d> {
Ok(())
}

#[cfg(coex)]
/// Configures modem power saving
///
/// This is ignored, and set to `PowerSaveMode::Minimum` when `coex` is
/// enabled.
pub fn set_power_saving(&mut self, ps: PowerSaveMode) -> Result<(), WifiError> {
apply_power_saving(ps)
}
Expand Down Expand Up @@ -3267,9 +3265,6 @@ pub(crate) mod embassy {
}

pub(crate) fn apply_power_saving(mut ps: PowerSaveMode) -> Result<(), WifiError> {
if cfg!(coex) {
ps = PowerSaveMode::Minimum;
}
esp_wifi_result!(unsafe { esp_wifi_sys::include::esp_wifi_set_ps(ps.into()) })?;
Ok(())
}
Expand Down

0 comments on commit 1338c31

Please sign in to comment.