forked from M-Labs/zynq-rs
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, || {
|
Sockets::run(&mut iface, || {
|
||||||
time += 1;
|
time += 1;
|
||||||
Instant::from_millis(time)
|
Instant::from_millis(time)
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
static CORE1_REQ: Mutex<Option<sync_channel::Receiver<usize>>> = Mutex::new(None);
|
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>>(
|
pub fn run<'b, 'c, 'e, D: for<'d> Device<'d>>(
|
||||||
iface: &mut EthernetInterface<'b, 'c, 'e, D>,
|
iface: &mut EthernetInterface<'b, 'c, 'e, D>,
|
||||||
mut get_time: impl FnMut() -> Instant,
|
mut get_time: impl FnMut() -> Instant,
|
||||||
) {
|
) -> ! {
|
||||||
task::block_on(async {
|
task::block_on(async {
|
||||||
loop {
|
loop {
|
||||||
let instant = get_time();
|
let instant = get_time();
|
||||||
Self::instance().poll(iface, instant);
|
Self::instance().poll(iface, instant);
|
||||||
task::r#yield().await;
|
task::r#yield().await;
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn instance() -> &'static Self {
|
pub(crate) fn instance() -> &'static Self {
|
||||||
|
Loading…
Reference in New Issue
Block a user