firmware: rst active_rpt if eth link is not active
This commit is contained in:
parent
0e087c6992
commit
4116962175
|
@ -72,7 +72,9 @@ fn main() -> ! {
|
|||
loop {
|
||||
wd.feed();
|
||||
|
||||
net::net::eth_poll_and_update_link_speed();
|
||||
if !net::net::eth_poll_link_status_and_update_link_speed() {
|
||||
active_report = [false; net::net::NUM_OF_SOCKETS];
|
||||
}
|
||||
|
||||
match state {
|
||||
State::LoadFlashSettings => {
|
||||
|
|
|
@ -352,13 +352,14 @@ impl<M: Miim> EthernetPhy<M> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn eth_poll_and_update_link_speed() {
|
||||
pub fn eth_poll_link_status_and_update_link_speed() -> bool {
|
||||
unsafe {
|
||||
if let Some(ref mut server_handle ) = SERVER_HANDLE {
|
||||
server_handle.update_link_speed();
|
||||
return server_handle.link_was_up;
|
||||
}
|
||||
else {
|
||||
panic!("eth_poll_and_update_link_speed is called before init");
|
||||
panic!("eth_poll_link_status_and_update_link_speed is called before init");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue