]> patrickod personal git archive - tincan.git/commitdiff
wip on getting this thing to do USB
authorAndy Isaacson <adi@hexapodia.org>
Mon, 12 Jul 2021 02:55:41 +0000 (19:55 -0700)
committerAndy Isaacson <adi@hexapodia.org>
Mon, 12 Jul 2021 02:55:41 +0000 (19:55 -0700)
rs-lorachat/Cargo.toml
rs-lorachat/src/main.rs

index f64427cb35884f9fb8e1329a67b20bf22060a4f5..cff8d1af3e723f0f79f97d448383549302afd962 100644 (file)
@@ -6,7 +6,9 @@ edition = "2018"
 
 [dependencies]
 feather_m0 = { git = "https://github.com/atsamd-rs/atsamd" }
-
+# feather_m0 = { path = "/home/adi/opp/atsamd" }
+cortex-m = "0.6"
+embedded-hal = "0.2.3"
 
 [dependencies.cortex-m-rt]
 version = "0.6.12"
@@ -14,13 +16,35 @@ optional = true
 
 [dependencies.atsamd-hal]
 version = "0.12"
-default-features = false
 
 [dependencies.panic-halt]
 version = "0.2"
 optional = true
 
+[dependencies.usb-device]
+version = "0.2"
+optional = true
+
+[dependencies.rtic-monotonic]
+version = "=0.1.0-alpha.1"
+optional = true
+
+[dependencies.usbd-serial]
+version = "0.1"
+optional = true
+
+[dev-dependencies]
+cortex-m-semihosting = "0.3"
+heapless = "0.5"
+
+[dev-dependencies.cortex-m-rtic]
+version = "0.6.0-alpha.4"
+
 [features]
 default = ["rt", "atsamd-hal/samd21g", "panic_halt"]
 rt = ["cortex-m-rt", "atsamd-hal/samd21g-rt"]
 panic_halt = ["panic-halt"]
+usb = ["atsamd-hal/usb", "usb-device", "usbd-serial"]
+unproven = ["atsamd-hal/unproven"]
+# Enable pins for the radio on "RadioFruits" with RFM95, RFM96, RFM69
+rfm = []
index a0395d5c7edb6aee6774e607da205cd9dfc6c22b..92e4f458b9cc0de51cf81de13ee84dae9f7d6927 100644 (file)
@@ -4,14 +4,13 @@
 use panic_halt as _;
 
 use bsp::hal;
-use bsp::pac;
 use feather_m0 as bsp;
 
 use bsp::entry;
-use hal::clock::GenericClockController;
+use hal::clock::{GenericClockController};
 use hal::delay::Delay;
+use hal::pac::{CorePeripherals, Peripherals};
 use hal::prelude::*;
-use pac::{CorePeripherals, Peripherals};
 
 #[entry]
 fn main() -> ! {
@@ -24,19 +23,24 @@ fn main() -> ! {
         &mut peripherals.NVMCTRL,
     );
     let pins = bsp::Pins::new(peripherals.PORT);
-    let mut red_led: bsp::RedLed = pins.d13.into();
     let mut delay = Delay::new(core.SYST, &mut clocks);
+    let mut red_led = pins.d13.into_push_pull_output();
+
+
+    red_led.set_high().unwrap();
+    delay.delay_ms(500_u32);
+    red_led.set_low().unwrap();
+    delay.delay_ms(500_u32);
+    red_led.set_high().unwrap();
+
+    red_led.set_low().unwrap();
+    delay.delay_ms(500_u32);
+
+
     loop {
-        delay.delay_ms(250u8);
-        delay.delay_ms(250u8);
-        delay.delay_ms(250u8);
-        delay.delay_ms(250u8);
-        red_led.set_high().unwrap();
-        delay.delay_ms(100u8);
-        red_led.set_low().unwrap();
-        delay.delay_ms(100u8);
+        delay.delay_ms(1_000_u32);
         red_led.set_high().unwrap();
-        delay.delay_ms(100u8);
+        delay.delay_ms(1_000_u32);
         red_led.set_low().unwrap();
     }
 }