Make sure BLE and WiFi are not powered down when esp-wifi needs them (#891)

* Make sure BLE and WiFi are not powered down when esp-wifi needs them

* CHANGELOG.md entry
This commit is contained in:
Björn Quentin 2023-11-01 14:01:02 +01:00 committed by GitHub
parent 185e5e759b
commit 8eddb9e737
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
### Fixed
- ESP32-C3: Make sure BLE and WiFi are not powered down when esp-wifi needs them (#891)
### Removed

View File

@ -89,6 +89,16 @@ fn reset_mac() {
}
fn init_clocks() {
// undo the power down in base_settings (esp32c3_sleep)
let rtc_cntl = unsafe { crate::peripherals::RTC_CNTL::steal() };
rtc_cntl
.dig_iso
.modify(|_, w| w.wifi_force_iso().clear_bit().bt_force_iso().clear_bit());
rtc_cntl
.dig_pwc
.modify(|_, w| w.wifi_force_pd().clear_bit().bt_force_pd().clear_bit());
// from `esp_perip_clk_init`
const SYSTEM_WIFI_CLK_I2C_CLK_EN: u32 = 1 << 5;
const SYSTEM_WIFI_CLK_UNUSED_BIT12: u32 = 1 << 12;