Skip to content

Commit

Permalink
Make sure BLE and WiFi are not powered down when esp-wifi needs them (#…
Browse files Browse the repository at this point in the history
…891)

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

* CHANGELOG.md entry
  • Loading branch information
bjoernQ authored Nov 1, 2023
1 parent 185e5e7 commit 8eddb9e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 10 additions & 0 deletions esp-hal-common/src/soc/esp32c3/radio_clocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8eddb9e

Please sign in to comment.