Skip to content

Commit

Permalink
Add missing Sealed impl (#2560)
Browse files Browse the repository at this point in the history
* Add missing Sealed impl

* Typos

* It compiles
  • Loading branch information
bugadani authored Nov 18, 2024
1 parent 2472e36 commit 4f6d51f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
5 changes: 3 additions & 2 deletions esp-wifi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ where
{
}

impl private::Sealed for AnyTimer {}
impl IntoAnyTimer for AnyTimer {}

impl<T> EspWifiTimerSource for T
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions hil-test/tests/esp_wifi_floats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit 4f6d51f

Please sign in to comment.