libasync: Sockets::run() returns !
This commit is contained in:
parent
c3fc948714
commit
60e45f096d
|
@ -261,7 +261,7 @@ pub fn main_core0() {
|
|||
Sockets::run(&mut iface, || {
|
||||
time += 1;
|
||||
Instant::from_millis(time)
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
static CORE1_REQ: Mutex<Option<sync_channel::Receiver<usize>>> = Mutex::new(None);
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue