From f554eceb005c0fdd2bd683dffdb85bd35a3acd04 Mon Sep 17 00:00:00 2001 From: liebman Date: Sun, 28 Apr 2024 10:53:49 -0700 Subject: [PATCH 1/2] update to compile with latest esp-hal git main --- esp-wifi/src/common_adapter/mod.rs | 6 +++--- esp-wifi/src/lib.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/esp-wifi/src/common_adapter/mod.rs b/esp-wifi/src/common_adapter/mod.rs index 63bb3747..1ab07f1c 100644 --- a/esp-wifi/src/common_adapter/mod.rs +++ b/esp-wifi/src/common_adapter/mod.rs @@ -12,8 +12,8 @@ use crate::compat::timer_compat::*; use crate::hal; use esp_wifi_sys::include::timespec; +use hal::peripherals::RADIO_CLK; use hal::rng::Rng; -use hal::system::RadioClockControl; use hal::macros::ram; @@ -37,13 +37,13 @@ pub(crate) mod phy_init_data; pub(crate) static mut RANDOM_GENERATOR: Option = None; -pub(crate) static mut RADIO_CLOCKS: Option = None; +pub(crate) static mut RADIO_CLOCKS: Option = None; pub(crate) fn init_rng(rng: Rng) { unsafe { RANDOM_GENERATOR = Some(core::mem::transmute(rng)) }; } -pub(crate) fn init_radio_clock_control(rcc: RadioClockControl) { +pub(crate) fn init_radio_clock_control(rcc: RADIO_CLK) { unsafe { RADIO_CLOCKS = Some(core::mem::transmute(rcc)) }; } diff --git a/esp-wifi/src/lib.rs b/esp-wifi/src/lib.rs index e09a91aa..1540dc15 100644 --- a/esp-wifi/src/lib.rs +++ b/esp-wifi/src/lib.rs @@ -27,10 +27,10 @@ use esp_hal as hal; use hal::systimer::{Alarm, Target}; use common_adapter::init_radio_clock_control; -use hal::system::RadioClockController; use fugit::MegahertzU32; use hal::clock::Clocks; +use hal::system::RadioClockController; use linked_list_allocator::Heap; #[cfg(feature = "wifi")] use wifi::WifiError; @@ -237,7 +237,7 @@ pub fn initialize( init_for: EspWifiInitFor, timer: EspWifiTimer, rng: hal::rng::Rng, - radio_clocks: hal::system::RadioClockControl, + radio_clocks: hal::peripherals::RADIO_CLK, clocks: &Clocks, ) -> Result { #[cfg(any(esp32, esp32s3, esp32s2))] From d287b1156d79266090e4425a47bf3e3564e575e2 Mon Sep 17 00:00:00 2001 From: liebman Date: Thu, 2 May 2024 11:28:31 -0700 Subject: [PATCH 2/2] update with timer changes in esp-hal --- CHANGELOG.md | 2 ++ esp-wifi/src/lib.rs | 2 +- esp-wifi/src/timer/xtensa.rs | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2ccb543..2a816cfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- update with Timer and peripheral naming changes in `esp-hal` + ### Changed ### Removed diff --git a/esp-wifi/src/lib.rs b/esp-wifi/src/lib.rs index 1540dc15..d5760d24 100644 --- a/esp-wifi/src/lib.rs +++ b/esp-wifi/src/lib.rs @@ -160,7 +160,7 @@ pub(crate) type EspWifiTimer = Alarm; #[cfg(any(esp32, esp32s3, esp32s2))] pub(crate) type EspWifiTimer = - hal::timer::Timer, esp_hal::Blocking>; + hal::timer::timg::Timer, esp_hal::Blocking>; #[derive(Debug, PartialEq, PartialOrd)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] diff --git a/esp-wifi/src/timer/xtensa.rs b/esp-wifi/src/timer/xtensa.rs index 7588cd0e..7567af8a 100644 --- a/esp-wifi/src/timer/xtensa.rs +++ b/esp-wifi/src/timer/xtensa.rs @@ -9,7 +9,7 @@ use crate::{ interrupt, peripherals::{self, TIMG1}, prelude::*, - timer::{Timer, Timer0}, + timer::timg::{Timer, Timer0}, trapframe::TrapFrame, xtensa_lx, xtensa_lx_rt, },