summaryrefslogtreecommitdiff
path: root/embassy-nrf
diff options
context:
space:
mode:
authoralexmoon <alex.r.moon@gmail.com>2022-04-12 17:51:50 -0400
committeralexmoon <alex.r.moon@gmail.com>2022-04-13 14:55:02 -0400
commit2915e858baac442e71bac4b565746401deed22bd (patch)
treec4e91cc7de6be24000b9bb39096571d5f26f39df /embassy-nrf
parent7fde3abd5d7e04f6d79d325d4454d6eafabebc1f (diff)
downloadembassy-2915e858baac442e71bac4b565746401deed22bd.zip
Make Driver::disable async and fix comment
Diffstat (limited to 'embassy-nrf')
-rw-r--r--embassy-nrf/src/usb.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/embassy-nrf/src/usb.rs b/embassy-nrf/src/usb.rs
index 7f99b9a1..b67201e6 100644
--- a/embassy-nrf/src/usb.rs
+++ b/embassy-nrf/src/usb.rs
@@ -208,6 +208,7 @@ pub struct Bus<'d, T: Instance> {
impl<'d, T: Instance> driver::Bus for Bus<'d, T> {
type EnableFuture<'a> = impl Future<Output = ()> + 'a where Self: 'a;
+ type DisableFuture<'a> = impl Future<Output = ()> + 'a where Self: 'a;
type PollFuture<'a> = impl Future<Output = Event> + 'a where Self: 'a;
type RemoteWakeupFuture<'a> = impl Future<Output = Result<(), Unsupported>> + 'a where Self: 'a;
@@ -248,9 +249,11 @@ impl<'d, T: Instance> driver::Bus for Bus<'d, T> {
}
}
- fn disable(&mut self) {
- let regs = T::regs();
- regs.enable.write(|x| x.enable().disabled());
+ fn disable(&mut self) -> Self::DisableFuture<'_> {
+ async move {
+ let regs = T::regs();
+ regs.enable.write(|x| x.enable().disabled());
+ }
}
fn poll<'a>(&'a mut self) -> Self::PollFuture<'a> {