Skip to content

Commit 4f6d51f

Browse files
authored
Add missing Sealed impl (#2560)
* Add missing Sealed impl * Typos * It compiles
1 parent 2472e36 commit 4f6d51f

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

esp-wifi/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ where
300300
{
301301
}
302302

303+
impl private::Sealed for AnyTimer {}
303304
impl IntoAnyTimer for AnyTimer {}
304305

305306
impl<T> EspWifiTimerSource for T
@@ -356,7 +357,7 @@ impl private::Sealed for Trng<'_> {}
356357
///
357358
/// ```rust, no_run
358359
#[doc = esp_hal::before_snippet!()]
359-
/// use esp_hal::{rng::Rng, timg::TimerGroup};
360+
/// use esp_hal::{rng::Rng, timer::timg::TimerGroup};
360361
///
361362
/// let timg0 = TimerGroup::new(peripherals.TIMG0);
362363
/// let init = esp_wifi::init(
@@ -408,7 +409,7 @@ pub fn init<'d, T: EspWifiTimerSource>(
408409
/// # Safety
409410
///
410411
/// The user must ensure that any use of the radio via the WIFI/BLE/ESP-NOW
411-
/// drivers are complete, else undefined behavour may occur within those
412+
/// drivers are complete, else undefined behaviour may occur within those
412413
/// drivers.
413414
pub unsafe fn deinit_unchecked() -> Result<(), InitializationError> {
414415
// Disable coexistence

hil-test/tests/esp_wifi_floats.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,15 @@ mod tests {
173173
assert_eq!(result, 4.0);
174174
}
175175
}
176+
177+
// Here is a random test that doesn't fit anywhere else - and since it's alone,
178+
// creating a new test suite is not necessary as we don't want to flash/run
179+
// anything.
180+
#[allow(unused)] // compile test
181+
fn esp_wifi_can_be_initialized_with_any_timer(
182+
timer: esp_hal::timer::AnyTimer,
183+
rng: esp_hal::rng::Rng,
184+
radio_clocks: esp_hal::peripherals::RADIO_CLK,
185+
) {
186+
esp_wifi::init(timer, rng, radio_clocks);
187+
}

0 commit comments

Comments
 (0)