Skip to content

Commit 25c1b8f

Browse files
authored
Merge branch 'master' into embedded-hal-bus-atomic-device
2 parents 3ddc31a + f91fcbc commit 25c1b8f

File tree

30 files changed

+274
-138
lines changed

30 files changed

+274
-138
lines changed

.github/workflows/clippy.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v4
14-
- uses: dtolnay/rust-toolchain@master
14+
- uses: dtolnay/rust-toolchain@stable
1515
with:
16-
# embedded-hal-async needs nightly.
17-
# Use a pinned version to avoid spontaneous breakages (new clippy lints are added often)
18-
toolchain: nightly-2023-10-14
1916
components: clippy
2017
- run: cargo clippy --all-features -- --deny=warnings

.github/workflows/rustdoc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ jobs:
1313
- uses: actions/checkout@v4
1414
- uses: dtolnay/rust-toolchain@master
1515
with:
16-
toolchain: nightly-2023-10-14
16+
toolchain: nightly-2024-07-26
1717
# tokio/net required to workaround https://github.com/tokio-rs/tokio/issues/6165
1818
- run: RUSTDOCFLAGS="--deny=warnings --cfg=docsrs" cargo doc --all-features --features tokio/net

.github/workflows/rustfmt.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v4
15-
- uses: dtolnay/rust-toolchain@master
15+
- uses: dtolnay/rust-toolchain@stable
1616
with:
17-
toolchain: nightly
1817
components: rustfmt
1918
- run: cargo fmt --check

embedded-can/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@ repository = "https://github.com/rust-embedded/embedded-hal"
1414

1515
[dependencies]
1616
nb = "1"
17+
defmt = { version = "0.3", optional = true }
18+
19+
[features]
20+
defmt-03 = ["dep:defmt"]

embedded-can/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ This project is developed and maintained by the [HAL team](https://github.com/ru
1313

1414
[API reference]: https://docs.rs/embedded-can
1515

16+
## Optional features
17+
18+
- **`defmt-03`**: Derive `defmt::Format` from `defmt` 0.3 for enums and structs.
19+
1620
## Minimum Supported Rust Version (MSRV)
1721

1822
This crate is guaranteed to compile on stable Rust 1.60 and up. It *might*

embedded-can/src/id.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
/// Standard 11-bit CAN Identifier (`0..=0x7FF`).
44
#[derive(Debug, Copy, Clone, Eq, PartialEq, PartialOrd, Ord, Hash)]
5+
#[cfg_attr(feature = "defmt-03", derive(defmt::Format))]
56
pub struct StandardId(u16);
67

78
impl StandardId {
@@ -44,6 +45,7 @@ impl StandardId {
4445

4546
/// Extended 29-bit CAN Identifier (`0..=1FFF_FFFF`).
4647
#[derive(Debug, Copy, Clone, Eq, PartialEq, PartialOrd, Ord, Hash)]
48+
#[cfg_attr(feature = "defmt-03", derive(defmt::Format))]
4749
pub struct ExtendedId(u32);
4850

4951
impl ExtendedId {
@@ -93,6 +95,7 @@ impl ExtendedId {
9395

9496
/// A CAN Identifier (standard or extended).
9597
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
98+
#[cfg_attr(feature = "defmt-03", derive(defmt::Format))]
9699
pub enum Id {
97100
/// Standard 11-bit Identifier (`0..=0x7FF`).
98101
Standard(StandardId),

embedded-can/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ impl Error for core::convert::Infallible {
7373
/// free to define more specific or additional error types. However, by providing
7474
/// a mapping to these common CAN errors, generic code can still react to them.
7575
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
76+
#[cfg_attr(feature = "defmt-03", derive(defmt::Format))]
7677
#[non_exhaustive]
7778
pub enum ErrorKind {
7879
/// The peripheral receive buffer was overrun.

embedded-hal-async/build.rs

Lines changed: 0 additions & 18 deletions
This file was deleted.

embedded-hal-async/src/lib.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
#![doc = include_str!("../README.md")]
22
#![warn(missing_docs)]
33
#![no_std]
4-
// disable warning for already-stabilized features.
5-
// Needed to pass CI, because we deny warnings.
6-
// We don't immediately remove them to not immediately break older nightlies.
7-
// When all features are stable, we'll remove them.
8-
#![cfg_attr(nightly, allow(stable_features, unknown_lints))]
9-
#![cfg_attr(nightly, feature(async_fn_in_trait, impl_trait_projections))]
104
#![allow(async_fn_in_trait)]
115

126
pub mod delay;

embedded-hal-bus/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10-
(Add unreleased changes here)
10+
- Added the `alloc` feature.
11+
- Added a new `RcDevice` for I2C and SPI, a reference-counting equivalent to `RefCellDevice`.
1112

1213
## [v0.2.0] - 2024-04-23
1314

0 commit comments

Comments
 (0)