diff --git a/src/main.rs b/src/main.rs
index f4ef1fa4d6d408994397d5004013f73dc67995f4..02a60c258d90dfbed98c71b8375ee4d70a883077 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -109,21 +109,33 @@ mod app {
         red.set_low();
         green.set_low();
 
+        // Detect if we're connected to USB or not
         let usb_detect = gpioa.pa5.into_pull_down_input();
 
+        // need to give time for the pull-down to take effect
+        let mut delay = dp.TIM5.delay_us(&clocks);
+        delay.delay_us(100u8);
+
+        let usb_connected = usb_detect.is_high();
+
         // setup radio
-        let mosi = gpiob.pb5.into_alternate();
-        let miso = gpiob.pb4.into_alternate();
-        let sclk = gpiob.pb3.into_alternate();
+        let radio = if usb_connected {
+            None
+        } else {
+            let mosi = gpiob.pb5.into_alternate();
+            let miso = gpiob.pb4.into_alternate();
+            let sclk = gpiob.pb3.into_alternate();
 
-        let sdn = gpiob.pb12.into_push_pull_output();
-        let cs = gpioa.pa8.into_push_pull_output();
+            let sdn = gpiob.pb12.into_push_pull_output();
+            let cs = gpioa.pa8.into_push_pull_output();
 
-        let spi = Spi::new(dp.SPI1, (sclk, miso, mosi), MODE, 10.MHz(), &clocks);
+            let spi = Spi::new(dp.SPI1, (sclk, miso, mosi), MODE, 10.MHz(), &clocks);
 
-        let delay = dp.TIM5.delay_us(&clocks);
-        let buf = singleton!(: [u8; MAX_PACKET_LEN] = [0; MAX_PACKET_LEN]).unwrap();
-        let radio = RadioManager::new(spi, sdn, cs, delay, buf, config.enable_digipeating);
+            let buf = singleton!(: [u8; MAX_PACKET_LEN] = [0; MAX_PACKET_LEN]).unwrap();
+            let radio = RadioManager::new(spi, sdn, cs, delay, buf, config.enable_digipeating);
+
+            radio
+        };
 
         // Setup GPS serial
         let pins = (gpioa.pa9, gpioa.pa10);
@@ -170,12 +182,13 @@ mod app {
 
         let buf = cortex_m::singleton!(: [u8; MAX_PACKET_LEN] = [0; MAX_PACKET_LEN]).unwrap();
 
-        let status = if usb_detect.is_high() {
+        let status = if usb_connected {
             Status::Programming(false)
         } else if radio.is_none() {
             Status::Error(false)
         } else if !config.enable_transmit {
             green.set_high();
+
             Status::TxDisabled(false)
         } else {
             green.set_high();