tcp_rst: init commit

This commit is contained in:
topquark12 2021-01-25 10:53:53 +08:00
parent 6b9d61737e
commit f42ba56f51
1 changed files with 12 additions and 4 deletions

View File

@ -202,6 +202,7 @@ fn main() -> ! {
warn!("poll: {:?}", e);
});
let mut reset_flag = false;
// TCP protocol handling
server.for_each(|mut socket, session| {
if ! socket.is_active() {
@ -421,8 +422,8 @@ fn main() -> ! {
for i in 0..CHANNELS {
channels.power_down(i);
}
SCB::sys_reset();
reset_flag = true;
// SCB::sys_reset();
}
Command::Dfu => {
for i in 0..CHANNELS {
@ -431,8 +432,8 @@ fn main() -> ! {
unsafe {
dfu::set_dfu_trigger();
}
SCB::sys_reset();
reset_flag = true;
// SCB::sys_reset();
}
}
Ok(SessionInput::Error(e)) => {
@ -458,6 +459,13 @@ fn main() -> ! {
}
});
if reset_flag == true {
server.for_each(|mut socket, _| {
socket.close();
});
SCB::sys_reset();
}
// Apply new IPv4 address/gateway
new_ipv4_config.take()
.map(|config| {