diff options
Diffstat (limited to 'embassy-net-esp-hosted/src/ioctl.rs')
| -rw-r--r-- | embassy-net-esp-hosted/src/ioctl.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/embassy-net-esp-hosted/src/ioctl.rs b/embassy-net-esp-hosted/src/ioctl.rs index e2a6815aa..512023206 100644 --- a/embassy-net-esp-hosted/src/ioctl.rs +++ b/embassy-net-esp-hosted/src/ioctl.rs | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | use core::cell::RefCell; | 1 | use core::cell::RefCell; |
| 2 | use core::future::poll_fn; | 2 | use core::future::{poll_fn, Future}; |
| 3 | use core::task::Poll; | 3 | use core::task::Poll; |
| 4 | 4 | ||
| 5 | use embassy_sync::waitqueue::WakerRegistration; | 5 | use embassy_sync::waitqueue::WakerRegistration; |
| @@ -38,7 +38,7 @@ impl Shared { | |||
| 38 | })) | 38 | })) |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | pub async fn ioctl_wait_complete(&self) -> usize { | 41 | pub fn ioctl_wait_complete(&self) -> impl Future<Output = usize> + '_ { |
| 42 | poll_fn(|cx| { | 42 | poll_fn(|cx| { |
| 43 | let mut this = self.0.borrow_mut(); | 43 | let mut this = self.0.borrow_mut(); |
| 44 | if let IoctlState::Done { resp_len } = this.ioctl { | 44 | if let IoctlState::Done { resp_len } = this.ioctl { |
| @@ -48,7 +48,6 @@ impl Shared { | |||
| 48 | Poll::Pending | 48 | Poll::Pending |
| 49 | } | 49 | } |
| 50 | }) | 50 | }) |
| 51 | .await | ||
| 52 | } | 51 | } |
| 53 | 52 | ||
| 54 | pub async fn ioctl_wait_pending(&self) -> PendingIoctl { | 53 | pub async fn ioctl_wait_pending(&self) -> PendingIoctl { |
| @@ -108,7 +107,7 @@ impl Shared { | |||
| 108 | this.control_waker.wake(); | 107 | this.control_waker.wake(); |
| 109 | } | 108 | } |
| 110 | 109 | ||
| 111 | pub async fn init_wait(&self) { | 110 | pub fn init_wait(&self) -> impl Future<Output = ()> + '_ { |
| 112 | poll_fn(|cx| { | 111 | poll_fn(|cx| { |
| 113 | let mut this = self.0.borrow_mut(); | 112 | let mut this = self.0.borrow_mut(); |
| 114 | if this.is_init { | 113 | if this.is_init { |
| @@ -118,6 +117,5 @@ impl Shared { | |||
| 118 | Poll::Pending | 117 | Poll::Pending |
| 119 | } | 118 | } |
| 120 | }) | 119 | }) |
| 121 | .await | ||
| 122 | } | 120 | } |
| 123 | } | 121 | } |
