Add missing Sealed impl (#2560)
* Add missing Sealed impl * Typos * It compiles
This commit is contained in:
parent
2472e36232
commit
4f6d51fefa
@ -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
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user