diff --git a/experiments/src/main.rs b/experiments/src/main.rs index e760054..92ab8cf 100644 --- a/experiments/src/main.rs +++ b/experiments/src/main.rs @@ -261,7 +261,7 @@ pub fn main_core0() { Sockets::run(&mut iface, || { time += 1; Instant::from_millis(time) - }); + }) } static CORE1_REQ: Mutex>> = Mutex::new(None); diff --git a/libasync/src/smoltcp/mod.rs b/libasync/src/smoltcp/mod.rs index b54fb30..fd5191e 100644 --- a/libasync/src/smoltcp/mod.rs +++ b/libasync/src/smoltcp/mod.rs @@ -44,14 +44,14 @@ impl Sockets { pub fn run<'b, 'c, 'e, D: for<'d> Device<'d>>( iface: &mut EthernetInterface<'b, 'c, 'e, D>, mut get_time: impl FnMut() -> Instant, - ) { + ) -> ! { task::block_on(async { loop { let instant = get_time(); Self::instance().poll(iface, instant); task::r#yield().await; } - }); + }) } pub(crate) fn instance() -> &'static Self {