diff options
| author | alexmoon <[email protected]> | 2022-04-12 17:51:50 -0400 |
|---|---|---|
| committer | alexmoon <[email protected]> | 2022-04-13 14:55:02 -0400 |
| commit | 2915e858baac442e71bac4b565746401deed22bd (patch) | |
| tree | c4e91cc7de6be24000b9bb39096571d5f26f39df /embassy-nrf/src | |
| parent | 7fde3abd5d7e04f6d79d325d4454d6eafabebc1f (diff) | |
Make Driver::disable async and fix comment
Diffstat (limited to 'embassy-nrf/src')
| -rw-r--r-- | embassy-nrf/src/usb.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/embassy-nrf/src/usb.rs b/embassy-nrf/src/usb.rs index 7f99b9a1c..b67201e67 100644 --- a/embassy-nrf/src/usb.rs +++ b/embassy-nrf/src/usb.rs | |||
| @@ -208,6 +208,7 @@ pub struct Bus<'d, T: Instance> { | |||
| 208 | 208 | ||
| 209 | impl<'d, T: Instance> driver::Bus for Bus<'d, T> { | 209 | impl<'d, T: Instance> driver::Bus for Bus<'d, T> { |
| 210 | type EnableFuture<'a> = impl Future<Output = ()> + 'a where Self: 'a; | 210 | type EnableFuture<'a> = impl Future<Output = ()> + 'a where Self: 'a; |
| 211 | type DisableFuture<'a> = impl Future<Output = ()> + 'a where Self: 'a; | ||
| 211 | type PollFuture<'a> = impl Future<Output = Event> + 'a where Self: 'a; | 212 | type PollFuture<'a> = impl Future<Output = Event> + 'a where Self: 'a; |
| 212 | type RemoteWakeupFuture<'a> = impl Future<Output = Result<(), Unsupported>> + 'a where Self: 'a; | 213 | type RemoteWakeupFuture<'a> = impl Future<Output = Result<(), Unsupported>> + 'a where Self: 'a; |
| 213 | 214 | ||
| @@ -248,9 +249,11 @@ impl<'d, T: Instance> driver::Bus for Bus<'d, T> { | |||
| 248 | } | 249 | } |
| 249 | } | 250 | } |
| 250 | 251 | ||
| 251 | fn disable(&mut self) { | 252 | fn disable(&mut self) -> Self::DisableFuture<'_> { |
| 252 | let regs = T::regs(); | 253 | async move { |
| 253 | regs.enable.write(|x| x.enable().disabled()); | 254 | let regs = T::regs(); |
| 255 | regs.enable.write(|x| x.enable().disabled()); | ||
| 256 | } | ||
| 254 | } | 257 | } |
| 255 | 258 | ||
| 256 | fn poll<'a>(&'a mut self) -> Self::PollFuture<'a> { | 259 | fn poll<'a>(&'a mut self) -> Self::PollFuture<'a> { |
