From: Patrick O'Doherty Date: Tue, 13 Jul 2021 07:06:19 +0000 (-0700) Subject: working main.rs build X-Git-Url: https://git.patrickod.com/tor-browser-?a=commitdiff_plain;h=8b63499a590ecf56e52bb867684d2f669e575954;p=tincan.git working main.rs build * resolve import issues in main.rs to get a clean build * condense dependencies list in cargo.toml * add direnv configuration to point to nix flake env --- diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/rs-lorachat/Cargo.lock b/rs-lorachat/Cargo.lock new file mode 100644 index 0000000..2d990ec --- /dev/null +++ b/rs-lorachat/Cargo.lock @@ -0,0 +1,375 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aligned" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c19796bd8d477f1a9d4ac2465b464a8b1359474f06a96bb3cda650b4fca309bf" +dependencies = [ + "as-slice", +] + +[[package]] +name = "as-slice" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45403b49e3954a4b8428a0ac21a4b7afadccf92bfd96273f1a58cd4812496ae0" +dependencies = [ + "generic-array 0.12.4", + "generic-array 0.13.3", + "generic-array 0.14.4", + "stable_deref_trait", +] + +[[package]] +name = "atsamd-hal" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "868f22ff864d664efd9a0134cad0905d918f62f3b14d7761ca6d64bdcb1df96b" +dependencies = [ + "atsamd21g", + "bitfield", + "cortex-m 0.6.7", + "embedded-hal", + "nb 0.1.3", + "paste", + "rand_core", + "usb-device", + "vcell", + "void", +] + +[[package]] +name = "atsamd21g" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d4092551cf82644de22191ad79c734adbd88df8e2b861e7b614d7e7891c83c7" +dependencies = [ + "bare-metal", + "cortex-m 0.6.7", + "cortex-m-rt", + "vcell", +] + +[[package]] +name = "bare-metal" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5deb64efa5bd81e31fcd1938615a6d98c82eafcbcd787162b6f63b91d6bac5b3" +dependencies = [ + "rustc_version", +] + +[[package]] +name = "bitfield" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "cortex-m" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9075300b07c6a56263b9b582c214d0ff037b00d45ec9fde1cc711490c56f1bb9" +dependencies = [ + "aligned", + "bare-metal", + "bitfield", + "cortex-m 0.7.3", + "volatile-register", +] + +[[package]] +name = "cortex-m" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ac919ef424449ec8c08d515590ce15d9262c0ca5f0da5b0c901e971a3b783b3" +dependencies = [ + "bare-metal", + "bitfield", + "embedded-hal", + "volatile-register", +] + +[[package]] +name = "cortex-m-rt" +version = "0.6.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d8353767db816419630a76d5f1ad5b09610d22b67ceb59647df6a8abc667f8" +dependencies = [ + "cortex-m-rt-macros", + "r0", +] + +[[package]] +name = "cortex-m-rt-macros" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4717562afbba06e760d34451919f5c3bf3ac15c7bb897e8b04862a7428378647" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "cortex-m-semihosting" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bffa6c1454368a6aa4811ae60964c38e6996d397ff8095a8b9211b1c1f749bc" +dependencies = [ + "cortex-m 0.7.3", +] + +[[package]] +name = "embedded-hal" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db184d3fa27bc7a2344250394c0264144dfe0bc81a4401801dcb964b8dd172ad" +dependencies = [ + "nb 0.1.3", + "void", +] + +[[package]] +name = "feather_m0" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2340b26e52342f2ddadbaed755ecf0a7993b5a2b59912840afe06c33dd22b6a6" +dependencies = [ + "atsamd-hal", + "cortex-m 0.6.7", + "cortex-m-rt", + "embedded-hal", + "nb 0.1.3", + "panic-halt", + "usb-device", + "usbd-serial", +] + +[[package]] +name = "generic-array" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +dependencies = [ + "typenum", +] + +[[package]] +name = "generic-array" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f797e67af32588215eaaab8327027ee8e71b9dd0b2b26996aedf20c030fce309" +dependencies = [ + "typenum", +] + +[[package]] +name = "generic-array" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "hash32" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4041af86e63ac4298ce40e5cca669066e75b6f1aa3390fe2561ffa5e1d9f4cc" +dependencies = [ + "byteorder", +] + +[[package]] +name = "heapless" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74911a68a1658cfcfb61bc0ccfbd536e3b6e906f8c2f7883ee50157e3e2184f1" +dependencies = [ + "as-slice", + "generic-array 0.13.3", + "hash32", + "stable_deref_trait", +] + +[[package]] +name = "nb" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" +dependencies = [ + "nb 1.0.0", +] + +[[package]] +name = "nb" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "546c37ac5d9e56f55e73b677106873d9d9f5190605e41a856503623648488cae" + +[[package]] +name = "panic-halt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de96540e0ebde571dc55c73d60ef407c653844e6f9a1e2fdbd40c07b9252d812" + +[[package]] +name = "paste" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58" + +[[package]] +name = "proc-macro2" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "quote" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r0" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2a38df5b15c8d5c7e8654189744d8e396bddc18ad48041a500ce52d6948941f" + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" + +[[package]] +name = "rs-lorachat" +version = "0.1.0" +dependencies = [ + "atsamd-hal", + "cortex-m 0.6.7", + "cortex-m-rt", + "cortex-m-semihosting", + "embedded-hal", + "feather_m0", + "heapless", + "panic-halt", + "usb-device", + "usbd-serial", +] + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver", +] + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "syn" +version = "1.0.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "typenum" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" + +[[package]] +name = "unicode-xid" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" + +[[package]] +name = "usb-device" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6be90410d4772074ea49525e2e753b65920b94b57eee21a6ef7b6a6fe6296245" + +[[package]] +name = "usbd-serial" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db75519b86287f12dcf0d171c7cf4ecc839149fe9f3b720ac4cfce52959e1dfe" +dependencies = [ + "embedded-hal", + "nb 0.1.3", + "usb-device", +] + +[[package]] +name = "vcell" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" + +[[package]] +name = "version_check" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "volatile-register" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d67cb4616d99b940db1d6bd28844ff97108b498a6ca850e5b6191a532063286" +dependencies = [ + "vcell", +] diff --git a/rs-lorachat/Cargo.toml b/rs-lorachat/Cargo.toml index b76ed91..904d7e8 100644 --- a/rs-lorachat/Cargo.toml +++ b/rs-lorachat/Cargo.toml @@ -5,30 +5,14 @@ authors = ["Andy Isaacson "] edition = "2018" [dependencies] -feather_m0 = { git = "https://github.com/atsamd-rs/atsamd" } -# feather_m0 = { path = "/home/adi/opp/atsamd" } +feather_m0 = { version = "0.9.0", features = ["usb"] } cortex-m = "0.6" embedded-hal = "0.2.3" - -[dependencies.cortex-m-rt] -version = "0.6.12" -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.usbd-serial] -version = "0.1" -optional = true +cortex-m-rt = { version = "0.6.12", optional = true } +atsamd-hal = "0.12" +panic-halt = { version = "0.2", optional = true } +usb-device = { version = "0.2", optional = true } +usbd-serial = { version = "0.1", optional = true } [dev-dependencies] cortex-m-semihosting = "0.3" diff --git a/rs-lorachat/src/main.rs b/rs-lorachat/src/main.rs index 89ad868..1331552 100644 --- a/rs-lorachat/src/main.rs +++ b/rs-lorachat/src/main.rs @@ -1,16 +1,12 @@ #![no_std] #![no_main] -extern crate cortex_m; -extern crate feather_m0 as hal; -extern crate panic_halt; -extern crate usb_device; -extern crate usbd_serial; +use panic_halt as _; +use feather_m0 as hal; +use hal::entry; use hal::clock::GenericClockController; -use hal::entry; use hal::pac::{interrupt, CorePeripherals, Peripherals}; -use hal::prelude::*; use hal::usb::UsbBus; use usb_device::bus::UsbBusAllocator; @@ -98,4 +94,4 @@ fn poll_usb() { #[interrupt] fn USB() { poll_usb(); -} +} \ No newline at end of file