Skip to content

Commit 3f8b869

Browse files
committed
chore: multiple minor cleanups
### consolidate workspace settings * Ensure all crates are consistently configured and validated using workspace features * move edition, license, repo, and rust-version (where used) to workspace * remove readme setting (already set by default) * add lints section - this should be used in a separate PR ### Code changes * Migrate several examples to 2021 edition ### Other changes * `crates.json` reformatted for consistency and ease-of-reading * Reformat all Cargo.toml that have already been modified with consistent spacing using intellij built-in formatter (pretty similar to what was already used, and it is being proposed for the toml formatting in rustfmt, but that has stalled)
1 parent 82ceca7 commit 3f8b869

File tree

56 files changed

+416
-353
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+416
-353
lines changed

Cargo.toml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,20 @@ members = [
88
"boards/*",
99
]
1010

11+
[workspace.package]
12+
edition = "2021"
13+
license = "MIT OR Apache-2.0"
14+
repository = "https://github.com/atsamd-rs/atsamd"
15+
rust-version = "1.77.2"
16+
17+
[workspace.lints.rust]
18+
# TODO: add any workspace-wide rust lint configurations
19+
# TODO: enable to make identifier usage consistent per file
20+
# unused_qualifications = "warn"
21+
22+
[workspace.lints.clippy]
23+
# TODO: add any workspace-wide clippy lint configurations
24+
1125
[profile.dev]
1226
debug = true
1327
opt-level = 0
@@ -22,7 +36,6 @@ inherits = "dev"
2236
opt-level = 2
2337
lto = "thin"
2438

25-
2639
[profile.release]
2740
lto = true
2841
opt-level = "s"

atsamd-hal-macros/Cargo.toml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
[package]
22
authors = ["Tethys Svensson"]
33
name = "atsamd-hal-macros"
4-
rust-version = "1.77.2"
54
version = "0.2.5"
6-
edition = "2021"
7-
license = "MIT OR Apache-2.0"
85
categories = ["embedded", "hardware-support", "no-std"]
96
description = "Procedural macros for the atsamd-hal library"
107
documentation = "https://docs.rs/crate/atsamd-hal-macros/"
11-
repository = "https://github.com/atsamd-rs/atsamd"
8+
edition.workspace = true
9+
license.workspace = true
10+
repository.workspace = true
11+
rust-version.workspace = true
12+
13+
[lints]
14+
workspace = true
1215

1316
[lib]
1417
proc-macro = true

atsamd-hal-macros/src/lib.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//!
55
//! The main purpose of this crate is to separate the task of writing the code
66
//! to support peripherals of the atsamd families from the task of figuring out
7-
//! which specific devices has those peripherals.
7+
//! which specific devices have those peripherals.
88
//!
99
//! The actual mapping of devices to peripherals is specified in the
1010
//! `devices.yaml` file. In the `atsamd-hal` crate you then only need to care
@@ -40,8 +40,8 @@ use parsing::{eat_attribute, eat_eof, eat_group, eat_hal_expr, eat_operator, eat
4040
/// It can be used like `#[hal_cfg([peripheral expression])]`.
4141
///
4242
/// The macro will look up all devices that fulfill the expression and expand
43-
/// the macro into a cfg attribute of the form `#[cfg(any(feature = "device1",
44-
/// feature = "device2", ...)]`.
43+
/// the macro into a cfg attribute of the form
44+
/// `#[cfg(any(feature = "device1", feature = "device2", ...)]`.
4545
#[proc_macro_attribute]
4646
pub fn hal_cfg(args: TokenStream, input: TokenStream) -> TokenStream {
4747
hal_cfg_impl(args).map_or_else(
@@ -61,8 +61,7 @@ fn hal_cfg_impl(args: TokenStream) -> Result<Group, Error> {
6161
Ok(cfgs)
6262
}
6363

64-
/// Macro which expands to a `mod foo;` item with different paths for each
65-
/// device.
64+
/// Macro, which expands to a `mod foo;` item with different paths for each device.
6665
///
6766
/// It can be used like this:
6867
///
@@ -92,7 +91,7 @@ fn hal_cfg_impl(args: TokenStream) -> Result<Group, Error> {
9291
/// ```
9392
///
9493
/// Ideally you would be to write `pub mod calibration;` instead of
95-
/// `pub mod calibration {}`, but unfortunately non-inline modules are not
94+
/// `pub mod calibration {}`, but unfortunately, non-inline modules are not
9695
/// currently supposed in proc macros. See
9796
/// [rust#54727](https://github.com/rust-lang/rust/issues/54727) for details.
9897
#[proc_macro_attribute]
@@ -156,7 +155,7 @@ fn hal_module_impl(args: TokenStream, input: TokenStream) -> Result<TokenStream,
156155

157156
/// Helper macro to allow using `#[hal_cfg(..)]` macro in more places
158157
///
159-
/// Normally the `#[cfg(..)]` macro is allowed in many more places than
158+
/// Normally, the `#[cfg(..)]` macro is allowed in many more places than
160159
/// proc-macros, such as directly on a statement. This mitigates that
161160
/// restriction.
162161
///
@@ -170,7 +169,7 @@ fn hal_module_impl(args: TokenStream, input: TokenStream) -> Result<TokenStream,
170169
/// }
171170
/// ```
172171
///
173-
/// This works, because attributes are allowed on the outer item.
172+
/// This works because attributes are allowed on the outer item.
174173
///
175174
/// The `#[hal_macro_helper]` will search through the item and replace all
176175
/// instances of the `#[hal_cfg(..)]` attribute with the corresponding

boards/arduino_mkr1000/Cargo.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ authors = ["Eric Rushing <[email protected]>"]
55
description = "Board Support crate for the Arduino MKR 1000 WiFi"
66
keywords = ["no-std", "arm", "cortex-m", "embedded-hal"]
77
categories = ["embedded", "hardware-support", "no-std"]
8-
license = "MIT OR Apache-2.0"
9-
repository = "https://github.com/atsamd-rs/atsamd"
10-
readme = "README.md"
11-
edition = "2021"
8+
edition.workspace = true
9+
license.workspace = true
10+
repository.workspace = true
11+
12+
[lints]
13+
workspace = true
1214

1315
[dependencies.cortex-m-rt]
1416
version = "0.7"

boards/arduino_mkrvidor4000/Cargo.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ authors = ["Sameer Puri <[email protected]>"]
55
description = "Board Support crate for the Arduino MKR VIDOR 4000"
66
keywords = ["no-std", "arm", "cortex-m", "embedded-hal", "arduino"]
77
categories = ["embedded", "hardware-support", "no-std"]
8-
license = "MIT OR Apache-2.0"
9-
repository = "https://github.com/atsamd-rs/atsamd"
10-
readme = "README.md"
11-
edition = "2021"
8+
edition.workspace = true
9+
license.workspace = true
10+
repository.workspace = true
11+
12+
[lints]
13+
workspace = true
1214

1315
[dependencies.cortex-m-rt]
1416
version = "0.7"

boards/arduino_mkrzero/Cargo.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ authors = ["Wez Furlong <[email protected]>", "David McGillicuddy <contact@djmc
55
description = "Board Support crate for the Arduino MKRZERO"
66
keywords = ["no-std", "arm", "cortex-m", "embedded-hal", "arduino"]
77
categories = ["embedded", "hardware-support", "no-std"]
8-
license = "MIT OR Apache-2.0"
9-
repository = "https://github.com/atsamd-rs/atsamd"
10-
readme = "README.md"
11-
edition = "2021"
8+
edition.workspace = true
9+
license.workspace = true
10+
repository.workspace = true
11+
12+
[lints]
13+
workspace = true
1214

1315
[dependencies.cortex-m-rt]
1416
version = "0.7"

boards/arduino_nano33iot/Cargo.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ authors = ["Gus Wynn <[email protected]>"]
55
description = "Board Support crate for the Arduino Nano 33 IOT"
66
keywords = ["no-std", "arm", "cortex-m", "embedded-hal", "arduino"]
77
categories = ["embedded", "hardware-support", "no-std"]
8-
license = "MIT OR Apache-2.0"
9-
repository = "https://github.com/atsamd-rs/atsamd"
10-
readme = "README.md"
11-
edition = "2021"
8+
edition.workspace = true
9+
license.workspace = true
10+
repository.workspace = true
11+
12+
[lints]
13+
workspace = true
1214

1315
[dependencies.cortex-m-rt]
1416
version = "0.7"

boards/atsame54_xpro/Cargo.toml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
[package]
22
authors = [
3-
"Karsten Große <[email protected]>",
4-
"John Little <[email protected]>",
3+
"Karsten Große <[email protected]>",
4+
"John Little <[email protected]>",
55
]
66
categories = ["embedded", "hardware-support", "no-std"]
77
description = "Board Support crate for the SAM E54 Xplained Pro Evaluation Kit"
8-
edition = "2021"
98
keywords = ["no-std", "arm", "cortex-m", "embedded-hal"]
10-
license = "MIT OR Apache-2.0"
119
name = "atsame54_xpro"
1210
readme = "README.md"
13-
repository = "https://github.com/atsamd-rs/atsamd"
1411
version = "0.12.0"
12+
edition.workspace = true
13+
license.workspace = true
14+
repository.workspace = true
15+
16+
[lints]
17+
workspace = true
1518

1619
[dependencies.cortex-m-rt]
1720
optional = true
@@ -32,9 +35,9 @@ version = "0.3.1"
3235

3336
[dev-dependencies]
3437
mcan = "0.2"
35-
panic-rtt-target = {version = "0.1", features = ["cortex-m"]}
36-
rtic = {version = "2.1.2", features = ["thumbv7-backend"]}
37-
rtt-target = {version = "0.3", features = ["cortex-m"]}
38+
panic-rtt-target = { version = "0.1", features = ["cortex-m"] }
39+
rtic = { version = "2.1.2", features = ["thumbv7-backend"] }
40+
rtt-target = { version = "0.3", features = ["cortex-m"] }
3841

3942
[features]
4043
default = ["rt", "atsamd-hal/same54p"]

boards/circuit_playground_express/Cargo.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ version = "0.11.1"
44
authors = ["Paul Sajna <[email protected]>"]
55
description = "Board Support crate for the Adafruit Circuit Playground Express"
66
keywords = ["no-std", "arm", "cortex-m", "embedded-hal"]
7-
license = "MIT OR Apache-2.0"
8-
repository = "https://github.com/atsamd-rs/atsamd"
9-
readme = "README.md"
10-
edition = "2018"
7+
edition.workspace = true
8+
license.workspace = true
9+
repository.workspace = true
10+
11+
[lints]
12+
workspace = true
1113

1214
[dependencies.cortex-m-rt]
1315
version = "0.7"

boards/edgebadge/Cargo.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ authors = ["Jacob Rosenthal <@jacobrosenthal>"]
55
description = "Board Support crate for the Adafruit EdgeBadge"
66
keywords = ["no-std", "arm", "cortex-m", "embedded-hal"]
77
categories = ["embedded", "hardware-support", "no-std"]
8-
license = "MIT OR Apache-2.0"
9-
repository = "https://github.com/atsamd-rs/atsamd"
10-
readme = "README.md"
11-
edition = "2021"
128
exclude = ["assets"]
9+
edition.workspace = true
10+
license.workspace = true
11+
repository.workspace = true
12+
13+
[lints]
14+
workspace = true
1315

1416
[dependencies]
1517
cortex-m = "0.7"

boards/feather_m0/Cargo.toml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
authors = ["Ben Bergman <[email protected]>"]
33
categories = ["embedded", "hardware-support", "no-std"]
44
description = "Board Support crate for the Adafruit Feather M0"
5-
edition = "2021"
65
keywords = ["no-std", "arm", "cortex-m", "embedded-hal"]
7-
license = "MIT OR Apache-2.0"
86
name = "feather_m0"
9-
readme = "README.md"
10-
repository = "https://github.com/atsamd-rs/atsamd"
11-
resolver = "2"
127
version = "0.19.0"
8+
edition.workspace = true
9+
license.workspace = true
10+
repository.workspace = true
11+
12+
[lints]
13+
workspace = true
1314

1415
# for cargo flash
1516
[package.metadata]
@@ -47,14 +48,14 @@ cortex-m-semihosting = "0.3"
4748
defmt = "0.3"
4849
defmt-rtt = "0.4"
4950
drogue-nom-utils = "0.1"
50-
embassy-executor = {version = "0.6.2", features = ["arch-cortex-m", "executor-thread", "task-arena-size-64"]}
51+
embassy-executor = { version = "0.6.2", features = ["arch-cortex-m", "executor-thread", "task-arena-size-64"] }
5152
embedded-graphics = "0.7.1"
5253
heapless = "0.8"
53-
nom = {version = "5", default-features = false}
54+
nom = { version = "5", default-features = false }
5455
panic-halt = "0.2"
5556
panic-probe = "0.3"
5657
panic-semihosting = "0.6"
57-
rtic-monotonics = {version = "1.3.0", features = ["cortex-m-systick", "systick-10khz"]}
58+
rtic-monotonics = { version = "1.3.0", features = ["cortex-m-systick", "systick-10khz"] }
5859
ssd1306 = "0.7"
5960
usbd-serial = "0.2"
6061

boards/feather_m4/Cargo.toml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ authors = ["Theodore DeRego <[email protected]>"]
33
categories = ["embedded", "hardware-support", "no-std"]
44
description = "Board Support crate for the Adafruit Feather M4"
55
documentation = "https://atsamd-rs.github.io/atsamd/atsamd51j/feather_m4/"
6-
edition = "2021"
76
keywords = ["no-std", "arm", "cortex-m", "embedded-hal"]
8-
license = "MIT OR Apache-2.0"
97
name = "feather_m4"
10-
readme = "README.md"
11-
repository = "https://github.com/atsamd-rs/atsamd"
128
version = "0.17.0"
9+
edition.workspace = true
10+
license.workspace = true
11+
repository.workspace = true
12+
13+
[lints]
14+
workspace = true
1315

1416
# for cargo flash
1517
[package.metadata]
@@ -36,7 +38,7 @@ version = "0.3.1"
3638
heapless = "0.7"
3739
panic-halt = "0.2"
3840
panic-semihosting = "0.5"
39-
rtic = {version = "2.1.1", features = ["thumbv7-backend"]}
41+
rtic = { version = "2.1.1", features = ["thumbv7-backend"] }
4042
smart-leds = "0.3"
4143
usbd-serial = "0.2"
4244
ws2812-timer-delay = "0.3"

boards/gemma_m0/Cargo.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ authors = ["Wez Furlong <[email protected]>"]
55
description = "Board Support crate for the Adafruit Gemma M0"
66
keywords = ["no-std", "arm", "cortex-m", "embedded-hal"]
77
categories = ["embedded", "hardware-support", "no-std"]
8-
license = "MIT OR Apache-2.0"
9-
repository = "https://github.com/atsamd-rs/atsamd"
10-
readme = "README.md"
11-
edition = "2021"
8+
edition.workspace = true
9+
license.workspace = true
10+
repository.workspace = true
11+
12+
[lints]
13+
workspace = true
1214

1315
[dependencies.cortex-m-rt]
1416
version = "0.7"

boards/grand_central_m4/Cargo.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ authors = ["Dustin Little <[email protected]>"]
55
description = "Board Support crate for the Adafruit Grand Central M4 Express"
66
keywords = ["no-std", "arm", "cortex-m", "embedded-hal"]
77
categories = ["embedded", "hardware-support", "no-std"]
8-
license = "MIT OR Apache-2.0"
9-
edition = "2021"
10-
repository = "https://github.com/atsamd-rs/atsamd"
11-
readme = "README.md"
8+
edition.workspace = true
9+
license.workspace = true
10+
repository.workspace = true
11+
12+
[lints]
13+
workspace = true
1214

1315
[dependencies.cortex-m-rt]
1416
version = "0.7"

boards/itsybitsy_m0/Cargo.toml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@ authors = ["Ben Bergman <[email protected]>"]
55
description = "Board Support crate for the Adafruit ItsyBitsy M0"
66
keywords = ["no-std", "arm", "cortex-m", "embedded-hal"]
77
categories = ["embedded", "hardware-support", "no-std"]
8-
license = "MIT OR Apache-2.0"
9-
repository = "https://github.com/atsamd-rs/atsamd"
10-
readme = "README.md"
11-
edition = "2021"
8+
edition.workspace = true
9+
license.workspace = true
10+
repository.workspace = true
11+
12+
[lints]
13+
workspace = true
1214

1315
[dependencies]
1416
bitbang-hal = "0.3"
1517
apa102-spi = "0.3"
16-
embedded-hal-02 = {package = "embedded-hal", version = "0.2", features = ["unproven"]}
18+
embedded-hal-02 = { package = "embedded-hal", version = "0.2", features = ["unproven"] }
1719
smart-leds = "0.3"
1820

1921
[dependencies.cortex-m-rt]
@@ -34,7 +36,7 @@ optional = true
3436

3537
[dev-dependencies]
3638
cortex-m-rtic = "1.0"
37-
cortex-m = {version = "0.7", features = ["critical-section-single-core"]}
39+
cortex-m = { version = "0.7", features = ["critical-section-single-core"] }
3840
usbd-serial = "0.2.2"
3941
usbd-hid = "0.8.2"
4042
cortex-m-semihosting = "0.3"

0 commit comments

Comments
 (0)