From 056f8f9530dec70bdffaa84a5154c9f755a9b41e Mon Sep 17 00:00:00 2001 From: Cyril Fougeray Date: Sat, 4 May 2024 03:57:37 +0200 Subject: [PATCH] mcu-util: serial can only be obtained if orb-ui not running (#86) make it optional still unused anyway --- mcu-util/src/orb/main_board.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mcu-util/src/orb/main_board.rs b/mcu-util/src/orb/main_board.rs index a01d66fa..a4f4671b 100644 --- a/mcu-util/src/orb/main_board.rs +++ b/mcu-util/src/orb/main_board.rs @@ -21,8 +21,9 @@ const REBOOT_DELAY: u32 = 3; pub struct MainBoard { canfd_iface: CanRawMessaging, isotp_iface: CanIsoTpMessaging, + /// Optional serial interface for the main board, if available (ie orb-ui might own it) #[allow(dead_code)] - serial_iface: SerialMessaging, + serial_iface: Option, message_queue_rx: mpsc::Receiver, } @@ -55,7 +56,7 @@ impl MainBoardBuilder { self.message_queue_tx.clone(), )?; - let serial_iface = SerialMessaging::new(Device::Main)?; + let serial_iface = SerialMessaging::new(Device::Main).ok(); // Send a heartbeat to the main mcu to ensure it is alive // & "subscribe" to the main mcu messages: messages to the Jetson