Add missing Sealed impl (#2560)

* Add missing Sealed impl

* Typos

* It compiles
This commit is contained in:
Dániel Buga 2024-11-18 15:15:40 +01:00 committed by GitHub
parent 2472e36232
commit 4f6d51fefa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 2 deletions

View File

@ -300,6 +300,7 @@ where
{
}
impl private::Sealed for AnyTimer {}
impl IntoAnyTimer for AnyTimer {}
impl<T> EspWifiTimerSource for T
@ -356,7 +357,7 @@ impl private::Sealed for Trng<'_> {}
///
/// ```rust, no_run
#[doc = esp_hal::before_snippet!()]
/// use esp_hal::{rng::Rng, timg::TimerGroup};
/// use esp_hal::{rng::Rng, timer::timg::TimerGroup};
///
/// let timg0 = TimerGroup::new(peripherals.TIMG0);
/// let init = esp_wifi::init(
@ -408,7 +409,7 @@ pub fn init<'d, T: EspWifiTimerSource>(
/// # Safety
///
/// The user must ensure that any use of the radio via the WIFI/BLE/ESP-NOW
/// drivers are complete, else undefined behavour may occur within those
/// drivers are complete, else undefined behaviour may occur within those
/// drivers.
pub unsafe fn deinit_unchecked() -> Result<(), InitializationError> {
// Disable coexistence

View File

@ -173,3 +173,15 @@ mod tests {
assert_eq!(result, 4.0);
}
}
// Here is a random test that doesn't fit anywhere else - and since it's alone,
// creating a new test suite is not necessary as we don't want to flash/run
// anything.
#[allow(unused)] // compile test
fn esp_wifi_can_be_initialized_with_any_timer(
timer: esp_hal::timer::AnyTimer,
rng: esp_hal::rng::Rng,
radio_clocks: esp_hal::peripherals::RADIO_CLK,
) {
esp_wifi::init(timer, rng, radio_clocks);
}