diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7203ede..c7f068b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,8 +10,8 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: targets: "thumbv6m-none-eabi" - - run: cargo check --release - - run: cargo check --examples --release + - run: cargo check --target thumbv6m-none-eabi --release + - run: cargo check --target thumbv6m-none-eabi --examples --release test: name: Run Tests @@ -21,8 +21,9 @@ jobs: - uses: dtolnay/rust-toolchain@stable - name: Install nextest uses: taiki-e/install-action@nextest - - run: cargo nextest run --all-features - - run: cargo test --doc + - run: cargo nextest run --all-features -p va108xx-hal + # I think we can skip those on an embedded crate.. + # - run: cargo test --doc -p va108xx-hal fmt: name: Check formatting @@ -46,4 +47,6 @@ jobs: steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - - run: cargo clippy -- -D warnings + with: + targets: "thumbv6m-none-eabi" + - run: cargo clippy --target thumbv6m-none-eabi -- -D warnings diff --git a/README.md b/README.md index a5495b3..7c939ea 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Vorago VA108xx Rust Support ========= -This crate collection provided support to write Rust applications for the VA108XX family +This crate collection provides support to write Rust applications for the VA108XX family of devices. ## List of crates diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 3698cca..6ac6a4e 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -13,29 +13,31 @@ pipeline { } } stage('Clippy') { - steps { - sh 'cargo clippy' - } + steps { + sh 'cargo clippy --target thumbv6m-none-eabi' + } } stage('Rustfmt') { - steps { - sh 'cargo fmt' - } + steps { + sh 'cargo fmt' + } } stage('Docs') { - steps { - sh: cargo +nightly doc --all-features --config 'build.rustdocflags=["--cfg", "docs_rs"]' - } + steps { + sh """ + cargo +nightly doc --all-features --config 'build.rustdocflags=["--cfg", "docs_rs"]' + """ + } } stage('Check') { - steps { - sh 'cargo check --target thumbv6m-none-eabi' - } + steps { + sh 'cargo check --target thumbv6m-none-eabi' + } } stage('Check Examples') { - steps { - sh 'cargo check --target thumbv6m-none-eabi --examples' - } + steps { + sh 'cargo check --target thumbv6m-none-eabi --examples' + } } } } diff --git a/board-tests/Cargo.toml b/board-tests/Cargo.toml index 39c6af6..36b34c9 100644 --- a/board-tests/Cargo.toml +++ b/board-tests/Cargo.toml @@ -18,3 +18,4 @@ embedded-io = "0.6" version = "0.6" path = "../va108xx-hal" features = ["rt"] + diff --git a/examples/simple/examples/uart-irq-rtic.rs b/examples/simple/examples/uart-irq-rtic.rs index d808749..1ff01e5 100644 --- a/examples/simple/examples/uart-irq-rtic.rs +++ b/examples/simple/examples/uart-irq-rtic.rs @@ -13,15 +13,15 @@ #[rtic::app(device = pac, dispatchers = [OC4])] mod app { use embedded_io::Write; + use panic_rtt_target as _; use rtic_monotonics::systick::Systick; use rtic_sync::make_channel; - use panic_rtt_target as _; use rtt_target::{rprintln, rtt_init_print}; use va108xx_hal::{ - time::Hertz, gpio::PinsB, pac, prelude::*, + time::Hertz, uart::{self, IrqCfg, IrqResult, UartWithIrqBase}, }; @@ -52,7 +52,11 @@ mod app { // Initialize the systick interrupt & obtain the token to prove that we did let systick_mono_token = rtic_monotonics::create_systick_token!(); - Systick::start(cx.core.SYST, Hertz::from(50.MHz()).raw(), systick_mono_token); + Systick::start( + cx.core.SYST, + Hertz::from(50.MHz()).raw(), + systick_mono_token, + ); let mut dp = cx.device; let gpiob = PinsB::new(&mut dp.sysconfig, Some(dp.ioconfig), dp.portb); diff --git a/va108xx-hal/Cargo.toml b/va108xx-hal/Cargo.toml index 50b21b8..f632158 100644 --- a/va108xx-hal/Cargo.toml +++ b/va108xx-hal/Cargo.toml @@ -43,3 +43,7 @@ default-features = false [features] default = ["rt"] rt = ["va108xx/rt"] + +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docs_rs", "--generate-link-to-definition"] diff --git a/va108xx-hal/src/lib.rs b/va108xx-hal/src/lib.rs index f74b8ee..f2dea5c 100644 --- a/va108xx-hal/src/lib.rs +++ b/va108xx-hal/src/lib.rs @@ -1,4 +1,5 @@ #![no_std] +#![cfg_attr(docs_rs, feature(doc_auto_cfg))] pub use va108xx; pub use va108xx as pac; diff --git a/va108xx/Cargo.toml b/va108xx/Cargo.toml index fbd2d35..ebbfe07 100644 --- a/va108xx/Cargo.toml +++ b/va108xx/Cargo.toml @@ -21,3 +21,7 @@ version = ">=0.6.15,<0.8" [features] rt = ["cortex-m-rt/device"] + +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docs_rs", "--generate-link-to-definition"] diff --git a/va108xx/src/lib.rs b/va108xx/src/lib.rs index 15bab0c..388c5b6 100644 --- a/va108xx/src/lib.rs +++ b/va108xx/src/lib.rs @@ -3,6 +3,8 @@ svd2rust release can be generated by cloning the svd2rust [repository], checking #![allow(non_camel_case_types)] #![allow(non_snake_case)] #![no_std] +// Manually inserted. +#![cfg_attr(docs_rs, feature(doc_auto_cfg))] use core::marker::PhantomData; use core::ops::Deref; #[doc = r"Number available in the NVIC for configuring priority"] diff --git a/va108xx/src/porta.rs b/va108xx/src/porta.rs index a909f4b..e315416 100644 --- a/va108xx/src/porta.rs +++ b/va108xx/src/porta.rs @@ -1,3 +1,6 @@ +// Manually inserted. +#![allow(clippy::identity_op)] + #[repr(C)] #[doc = "Register block"] pub struct RegisterBlock { diff --git a/vorago-reb1/Cargo.toml b/vorago-reb1/Cargo.toml index f046493..2ab42ae 100644 --- a/vorago-reb1/Cargo.toml +++ b/vorago-reb1/Cargo.toml @@ -18,8 +18,6 @@ dummy-pin = "1" [dependencies.max116xx-10bit] version = "0.3" -git = "https://egit.irs.uni-stuttgart.de/rust/max116xx-10bit" -branch = "bump-embedded-hal" [dependencies.va108xx-hal] version = "0.6" @@ -39,3 +37,7 @@ version = "0.5" [dev-dependencies.panic-rtt-target] version = "0.1" + +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docs_rs", "--generate-link-to-definition"] diff --git a/vorago-reb1/src/lib.rs b/vorago-reb1/src/lib.rs index e2fd4e2..e51be97 100644 --- a/vorago-reb1/src/lib.rs +++ b/vorago-reb1/src/lib.rs @@ -1,4 +1,5 @@ #![no_std] +#![cfg_attr(docs_rs, feature(doc_auto_cfg))] pub mod button; pub mod leds;