From 5f3f5e63b2432cf62c5298c21051920490f6116e Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sun, 28 Aug 2022 00:13:22 +0200 Subject: [PATCH] Stop rotor when USB connections break --- src/usb.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/usb.rs b/src/usb.rs index 6234987..33771b6 100644 --- a/src/usb.rs +++ b/src/usb.rs @@ -159,6 +159,8 @@ pub async fn usb_task( buffer = String::from(&buffer.as_str()[line_end + 1..]); } defmt::info!("USB disconnected"); + // USB connection is broken, so better stop the rotor. + cmd_sender.send(Gs232Cmd::Stop); } };