From ee39b9643ec04cee2c922d54acf8d44c4f89e8d3 Mon Sep 17 00:00:00 2001 From: bunnie Date: Thu, 21 Apr 2022 01:22:17 +0800 Subject: [PATCH] add a timeout for the network to disconnect before starting update this is to avoid panics due to malformed "packets" being received as the EC is updating and not working correctly. --- services/shellchat/src/cmds/ecup.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/shellchat/src/cmds/ecup.rs b/services/shellchat/src/cmds/ecup.rs index ded96b70f..a8c7d058b 100644 --- a/services/shellchat/src/cmds/ecup.rs +++ b/services/shellchat/src/cmds/ecup.rs @@ -487,6 +487,9 @@ impl<'a> ShellCmdApi<'a> for EcUpdate { } env.netmgr.connection_manager_stop().unwrap(); + env.com.wlan_leave().ok(); + env.ticktimer.sleep_ms(4000).unwrap(); // give a few seconds for any packets/updates to clear so we don't tigger panics as the EC is about to disappear... + self.in_progress = true; let start = env.ticktimer.elapsed_ms(); self.start_time = Some(start);