aboutsummaryrefslogtreecommitdiff
path: root/embassy-net-esp-hosted
diff options
context:
space:
mode:
authorDániel Buga <[email protected]>2024-12-30 12:13:13 +0100
committerDániel Buga <[email protected]>2024-12-30 12:13:13 +0100
commit44217aa0924e7590aa0afabdf17babd5c2ea5b82 (patch)
treee42f5d02f9b560610b870d802cf390518180c3c6 /embassy-net-esp-hosted
parenta4f8fddd696ca2e3705827ba4b3806cbadcb3134 (diff)
Desugar some async fns
Diffstat (limited to 'embassy-net-esp-hosted')
-rw-r--r--embassy-net-esp-hosted/src/ioctl.rs8
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 @@
1use core::cell::RefCell; 1use core::cell::RefCell;
2use core::future::poll_fn; 2use core::future::{poll_fn, Future};
3use core::task::Poll; 3use core::task::Poll;
4 4
5use embassy_sync::waitqueue::WakerRegistration; 5use 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}