diff --git a/embassy-nrf/src/rng.rs b/embassy-nrf/src/rng.rs index 40778c64c..e5ec02c67 100644 --- a/embassy-nrf/src/rng.rs +++ b/embassy-nrf/src/rng.rs @@ -97,10 +97,10 @@ impl<'d> traits::rng::Rng for Rng<'d> { type RngFuture<'a> where 'd: 'a = impl Future> + 'a; fn fill_bytes<'a>(&'a mut self, dest: &'a mut [u8]) -> Self::RngFuture<'a> { - self.enable_irq(); - self.start(); - async move { + self.enable_irq(); + self.start(); + let on_drop = OnDrop::new(|| { self.stop(); self.disable_irq();