From dcb61bdda9d26d9b61d3f0fb90b1d85487e88413 Mon Sep 17 00:00:00 2001
From: Stephen D <webmaster@scd31.com>
Date: Sat, 27 May 2023 11:48:36 -0300
Subject: [PATCH] deb package confirmed working @ startup

---
 src/control.rs | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/control.rs b/src/control.rs
index 8b3486e..2d38893 100644
--- a/src/control.rs
+++ b/src/control.rs
@@ -84,7 +84,18 @@ impl Controller {
         ThreadPriority::Max.set_for_current().unwrap();
 
         //let mut radio = UartRadio::new("/dev/ttyAMA0").expect("Could not initialize radio");
-        let mut radio = SpiRadio::new().expect("Could not initialize radio");
+        let mut radio = loop {
+            let r = SpiRadio::new();
+
+            match r {
+                Ok(r) => break r,
+                Err(e) => {
+                    eprintln!("Error initializing radio: {e}");
+                }
+            }
+
+            thread::sleep(Duration::from_millis(1000));
+        };
 
         let mut text_msg_id = 0;
         loop {
-- 
GitLab