embedded HAL v1 and defmt support #2

Merged
muellerr merged 3 commits from bump-embedded-hal into main 2024-06-16 15:57:06 +02:00
4 changed files with 63 additions and 31 deletions
Showing only changes of commit aab40bc027 - Show all commits

2
.github/bors.toml vendored
View File

@ -1,2 +0,0 @@
status = ["ci"]
delete_merged_branches = true

View File

@ -1,43 +1,72 @@
on: push
name: ci
on: [push, pull_request]
jobs:
ci:
name: Check build
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo check --release
cross-check:
name: Check Cross-Compilation
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
target:
- x86_64-unknown-linux-gnu
- thumbv6m-none-eabi
- armv7-unknown-linux-gnueabihf
- thumbv7em-none-eabihf
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
components: rustfmt, clippy
targets: "armv7-unknown-linux-gnueabihf, thumbv7em-none-eabihf"
- run: cargo check --release --target=${{matrix.target}} --no-default-features
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: check
check:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install nextest
uses: taiki-e/install-action@nextest
- run: cargo nextest run --all-features
- run: cargo test --doc
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
msrv:
name: Check MSRV
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.68.2
- run: cargo check --release
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: clippy
args: -- -D warnings
fmt:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo fmt --all -- --check
docs:
name: Check Documentation Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- run: cargo +nightly doc --all-features --config 'build.rustdocflags=["--cfg", "docs_rs"]'
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo clippy -- -D warnings

View File

@ -15,3 +15,7 @@ categories = ["embedded", "no-std", "hardware-support"]
embedded-hal = "1"
nb = "1"
defmt = { version = "0.3", optional = true }
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docs_rs", "--generate-link-to-definition"]

View File

@ -21,6 +21,7 @@
//! You can find an example application [here](https://egit.irs.uni-stuttgart.de/rust/vorago-reb1/src/branch/main/examples/max11619-adc.rs)
//! using a [thin abstraction layer](https://egit.irs.uni-stuttgart.de/rust/vorago-reb1/src/branch/main/src/max11619.rs)
#![no_std]
#![cfg_attr(docs_rs, feature(doc_auto_cfg))]
use core::convert::Infallible;
use core::{marker::PhantomData, slice::IterMut};
use embedded_hal::delay::DelayNs;