tcp_rst: init commit
This commit is contained in:
parent
6b9d61737e
commit
f42ba56f51
16
src/main.rs
16
src/main.rs
|
@ -202,6 +202,7 @@ fn main() -> ! {
|
||||||
warn!("poll: {:?}", e);
|
warn!("poll: {:?}", e);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let mut reset_flag = false;
|
||||||
// TCP protocol handling
|
// TCP protocol handling
|
||||||
server.for_each(|mut socket, session| {
|
server.for_each(|mut socket, session| {
|
||||||
if ! socket.is_active() {
|
if ! socket.is_active() {
|
||||||
|
@ -421,8 +422,8 @@ fn main() -> ! {
|
||||||
for i in 0..CHANNELS {
|
for i in 0..CHANNELS {
|
||||||
channels.power_down(i);
|
channels.power_down(i);
|
||||||
}
|
}
|
||||||
|
reset_flag = true;
|
||||||
SCB::sys_reset();
|
// SCB::sys_reset();
|
||||||
}
|
}
|
||||||
Command::Dfu => {
|
Command::Dfu => {
|
||||||
for i in 0..CHANNELS {
|
for i in 0..CHANNELS {
|
||||||
|
@ -431,8 +432,8 @@ fn main() -> ! {
|
||||||
unsafe {
|
unsafe {
|
||||||
dfu::set_dfu_trigger();
|
dfu::set_dfu_trigger();
|
||||||
}
|
}
|
||||||
|
reset_flag = true;
|
||||||
SCB::sys_reset();
|
// SCB::sys_reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(SessionInput::Error(e)) => {
|
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
|
// Apply new IPv4 address/gateway
|
||||||
new_ipv4_config.take()
|
new_ipv4_config.take()
|
||||||
.map(|config| {
|
.map(|config| {
|
||||||
|
|
Loading…
Reference in New Issue