diff options
| author | Liam Murphy <[email protected]> | 2021-06-30 09:45:49 +1000 |
|---|---|---|
| committer | Liam Murphy <[email protected]> | 2021-06-30 09:45:49 +1000 |
| commit | ae0219de6f32222be5ef18be86376971a92f1751 (patch) | |
| tree | 8b2c6d6d307da041d4fa35c220693ba10702d891 | |
| parent | 8a4ab298192c388bed09fc198ee1786561cd50f9 (diff) | |
Move initialisation inside of future
| -rw-r--r-- | embassy-nrf/src/rng.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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> { | |||
| 97 | type RngFuture<'a> where 'd: 'a = impl Future<Output = Result<(), Self::Error>> + 'a; | 97 | type RngFuture<'a> where 'd: 'a = impl Future<Output = Result<(), Self::Error>> + 'a; |
| 98 | 98 | ||
| 99 | fn fill_bytes<'a>(&'a mut self, dest: &'a mut [u8]) -> Self::RngFuture<'a> { | 99 | fn fill_bytes<'a>(&'a mut self, dest: &'a mut [u8]) -> Self::RngFuture<'a> { |
| 100 | self.enable_irq(); | ||
| 101 | self.start(); | ||
| 102 | |||
| 103 | async move { | 100 | async move { |
| 101 | self.enable_irq(); | ||
| 102 | self.start(); | ||
| 103 | |||
| 104 | let on_drop = OnDrop::new(|| { | 104 | let on_drop = OnDrop::new(|| { |
| 105 | self.stop(); | 105 | self.stop(); |
| 106 | self.disable_irq(); | 106 | self.disable_irq(); |
