Initial node implementation #4

Merged
zack merged 51 commits from develop into master 2023-07-19 18:09:13 +00:00
12 changed files with 258 additions and 44 deletions
Showing only changes of commit 8355cc1f24 - Show all commits

View File

@ -1,3 +1,6 @@
#---------------------------------------------------------------------------------------------------------------------
#----- Workspace ------------------------
#---------------------------------------------------------------------------------------------------------------------
[workspace] [workspace]
members = [ members = [
# Device types # Device types
@ -15,20 +18,84 @@ readme = "README.md"
license = "MIT" license = "MIT"
[workspace.dependencies] [workspace.dependencies]
##### no-std ##### #----- no-std ----------------------------------
# Error handling # Math
[workspace.dependencies.thiserror] [workspace.dependencies.libm]
version = "1.0.*" version = "0.2.*"
# Units of measurement # Units of measurement
[workspace.dependencies.uom] [workspace.dependencies.uom]
version = "0.34.*" version = "0.34.*"
default-features = false
features = ["f32", "si"]
# Logging # Logging
[workspace.dependencies.tracing] [workspace.dependencies.tracing]
version = "0.1.*" version = "0.1.*"
[workspace.dependencies.defmt]
version = "0.3.*"
[workspace.dependencies.defmt-rtt]
version = "0.4.*"
# Serialization # Serialization
[workspace.dependencies.parity-scale-codec] [workspace.dependencies.parity-scale-codec]
version = "3.5.*" version = "3.5.*"
# Embedded-HAL
[workspace.dependencies.embedded-hal]
version = "1.0.0-alpha.10"
[workspace.dependencies.embedded-hal-async]
version = "0.2.0-alpha.1"
# Memory
[workspace.dependencies.static_cell]
version = "1.1.*"
[workspace.dependencies.heapless]
version = "0.7.*"
# Other embedded utilities
[workspace.dependencies.cortex-m]
version = "0.7.*"
[workspace.dependencies.cortex-m-rt]
version = "0.7.*"
[workspace.dependencies.panic-probe]
version = "0.3.*"
features = ["print-defmt"]
# Embassy
[workspace.dependencies.embassy-futures]
version = "0.1.*"
[workspace.dependencies.embassy-time]
version = "0.1.*"
features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "nightly", ]
[workspace.dependencies.embassy-sync]
version = "0.1.*"
features = ["defmt"]
[workspace.dependencies.embassy-embedded-hal]
version = "0.1.*"
features = ["nightly"]
[workspace.dependencies.embassy-executor]
version = "0.1.*"
features = ["defmt", "arch-cortex-m", "integrated-timers", "executor-interrupt", "executor-thread", "nightly"]
[workspace.dependencies.embassy-stm32]
version = "0.1.*"
features = ["defmt", "unstable-traits", "unstable-pac", "nightly"]
[workspace.dependencies.embassy-nrf]
version = "0.1.*"
features = ["defmt", "unstable-traits", "nightly"]
#---------------------------------------------------------------------------------------------------------------------
#----- Patch ------------------------
#---------------------------------------------------------------------------------------------------------------------
[patch.crates-io]
embassy-executor = { git = "https://github.com/embassy-rs/embassy", rev = "047ea9066f0d946fd4d706577b21df38fd3b1647" }
embassy-time = { git = "https://github.com/embassy-rs/embassy", rev = "047ea9066f0d946fd4d706577b21df38fd3b1647" }
embassy-futures = { git = "https://github.com/embassy-rs/embassy", rev = "047ea9066f0d946fd4d706577b21df38fd3b1647" }
embassy-sync = { git = "https://github.com/embassy-rs/embassy", rev = "047ea9066f0d946fd4d706577b21df38fd3b1647" }
embassy-embedded-hal = { git = "https://github.com/embassy-rs/embassy", rev = "047ea9066f0d946fd4d706577b21df38fd3b1647" }
embassy-net = { git = "https://github.com/embassy-rs/embassy", rev = "047ea9066f0d946fd4d706577b21df38fd3b1647" }
embassy-net-driver = { git = "https://github.com/embassy-rs/embassy", rev = "047ea9066f0d946fd4d706577b21df38fd3b1647" }
embassy-net-driver-channel = { git = "https://github.com/embassy-rs/embassy", rev = "047ea9066f0d946fd4d706577b21df38fd3b1647" }
embassy-nrf = { git = "https://github.com/embassy-rs/embassy", rev = "047ea9066f0d946fd4d706577b21df38fd3b1647" }
embassy-stm32 = { git = "https://github.com/embassy-rs/embassy", rev = "047ea9066f0d946fd4d706577b21df38fd3b1647" }
embassy-rp = { git = "https://github.com/embassy-rs/embassy", rev = "047ea9066f0d946fd4d706577b21df38fd3b1647" }
#---------------------------------------------------------------------------------------------------------------------
#----- Package ------------------------
#---------------------------------------------------------------------------------------------------------------------
[package] [package]
name = "physical" name = "physical"
description = "Physical is a library for interacting with the physical world." description = "Physical is a library for interacting with the physical world."
@ -39,4 +106,24 @@ readme.workspace = true
license.workspace = true license.workspace = true
[dependencies] [dependencies]
uom = { workspace = true } uom = { workspace = true }
parity-scale-codec = { workspace = true }
#---------------------------------------------------------------------------------------------------------------------
#----- Profiles ------------------------
#---------------------------------------------------------------------------------------------------------------------
[profile.release]
opt-level = 3
lto = true
codegen-units = 1
panic = "abort"
[profile.dev]
opt-level = 3
debug = true
debug-assertions = true
overflow-checks = true
lto = true
panic = "abort"
incremental = false
codegen-units = 1

View File

@ -7,8 +7,7 @@ repository.workspace = true
readme.workspace = true readme.workspace = true
license.workspace = true license.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies.physical]
path = ".."
[dependencies] [dependencies.tracing]
physical = { path = ".." } workspace = true
tracing.workspace = true

View File

@ -7,7 +7,15 @@ repository.workspace = true
readme.workspace = true readme.workspace = true
license.workspace = true license.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies.physical]
path = ".."
[dependencies] [dependencies.embedded-hal]
physical = { path = ".." } workspace = true
[dependencies.embedded-hal-async]
workspace = true
[dependencies.defmt]
workspace = true
[dependencies.uom]
workspace = true
[dependencies.embassy-sync]
workspace = true

14
rust-toolchain.toml Normal file
View File

@ -0,0 +1,14 @@
# Before upgrading check that everything is available on all tier1 targets here:
# https://rust-lang.github.io/rustup-components-history
[toolchain]
channel = "nightly-2023-04-18"
components = [ "rust-src", "rustfmt", "llvm-tools-preview" ]
targets = [
"thumbv7em-none-eabi",
"thumbv7m-none-eabi",
"thumbv6m-none-eabi",
"thumbv7em-none-eabihf",
"thumbv8m.main-none-eabihf",
"riscv32imac-unknown-none-elf",
"wasm32-unknown-unknown",
]