From a631cc08ff8ba01684a06067af2992b204e7bb60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Fita?= <4925040+michalfita@users.noreply.github.com> Date: Sat, 23 Dec 2023 14:18:39 +0000 Subject: [PATCH] [Fixes #72] Make `critical-section` optional for HAL crate --- .github/workflows/build.yml | 10 ++--- hal/Cargo.toml | 87 ++++++++++++++++++++++--------------- 2 files changed, 58 insertions(+), 39 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5b13285..73182b9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: - id: boards run: echo "::set-output name=board_matrix::$(ls ./boards --indicator-style=none | jq -ncR '[inputs]')" - id: features - run: echo "::set-output name=feature_matrix::[\"reconfigurable-system-pins\",\"usart-spi-host-without-select\",\"rt\"]" + run: echo "::set-output name=feature_matrix::[\"reconfigurable-system-pins\",\"usart-spi-host-without-select\",\"rt\",\"critical-section\"]" outputs: pac_matrix: ${{ steps.pacs.outputs.pac_matrix }} board_matrix: ${{ steps.boards.outputs.board_matrix }} @@ -39,7 +39,7 @@ jobs: - name: Install Rust (thumbv7em) run: rustup target add thumbv7em-none-eabihf - name: Build HAL for ${{ matrix.pac }} - run: cargo check --package atsamx7x-hal --features ${{ matrix.pac }},unproven + run: cargo check --package atsamx7x-hal --features ${{ matrix.pac }},unproven,rt,critical-section build-latest: if: github.event.pull_request.head.repo.full_name != github.repository @@ -59,7 +59,7 @@ jobs: - name: Install Rust (thumbv7em) run: rustup target add thumbv7em-none-eabihf - name: Build HAL for ${{ matrix.pac }} - run: cargo check --package atsamx7x-hal --features ${{ matrix.pac }},unproven + run: cargo check --package atsamx7x-hal --features ${{ matrix.pac }},unproven,rt,critical-section build-features: if: github.event.pull_request.head.repo.full_name != github.repository @@ -146,6 +146,6 @@ jobs: - name: Install Rust (thumbv7em) run: rustup target add thumbv7em-none-eabihf - name: Build HAL documentation - run: cargo doc --package atsamx7x-hal --no-deps --features samv71q21b,unproven,reconfigurable-system-pins,rt + run: cargo doc --package atsamx7x-hal --no-deps --features samv71q21b,unproven,reconfigurable-system-pins,rt,critical-section - name: Build HAL doc tests - run: cargo test --package atsamx7x-hal --doc --features samv71q21b,unproven,rt --target x86_64-unknown-linux-gnu + run: cargo test --package atsamx7x-hal --doc --features samv71q21b,unproven,rt,critical-section --target x86_64-unknown-linux-gnu diff --git a/hal/Cargo.toml b/hal/Cargo.toml index 06810a5..b04814c 100644 --- a/hal/Cargo.toml +++ b/hal/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "atsamx7x-hal" -version = "0.4.3-alpha1" +version = "0.4.3-alpha3" # in no particular order authors = [ "Michal Fita ", @@ -40,39 +40,39 @@ void = { version = "1", default-features = false } strum = { version = "0.24.1", default-features = false, features = ["derive"]} cfg-if = "1" mcan-core = { version = "0.2", optional = true } -atsame70j19b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsame70j20b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsame70j21b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsame70n19b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsame70n20b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsame70n21b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsame70q19b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsame70q20b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsame70q21b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsams70j19b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsams70j20b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsams70j21b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsams70n19b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsams70n20b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsams70n21b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsams70q19b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsams70q20b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsams70q21b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsamv70j19b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsamv70j20b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsamv70n19b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsamv70n20b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsamv70q19b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsamv70q20b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsamv71j19b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsamv71j20b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsamv71j21b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsamv71n19b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsamv71n20b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsamv71n21b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsamv71q19b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsamv71q20b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} -atsamv71q21b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsame70j19b = { version = "0.29.0-alpha3", optional = true } +atsame70j20b = { version = "0.29.0-alpha3", optional = true } +atsame70j21b = { version = "0.29.0-alpha3", optional = true } +atsame70n19b = { version = "0.29.0-alpha3", optional = true } +atsame70n20b = { version = "0.29.0-alpha3", optional = true } +atsame70n21b = { version = "0.29.0-alpha3", optional = true } +atsame70q19b = { version = "0.29.0-alpha3", optional = true } +atsame70q20b = { version = "0.29.0-alpha3", optional = true } +atsame70q21b = { version = "0.29.0-alpha3", optional = true } +atsams70j19b = { version = "0.29.0-alpha3", optional = true } +atsams70j20b = { version = "0.29.0-alpha3", optional = true } +atsams70j21b = { version = "0.29.0-alpha3", optional = true } +atsams70n19b = { version = "0.29.0-alpha3", optional = true } +atsams70n20b = { version = "0.29.0-alpha3", optional = true } +atsams70n21b = { version = "0.29.0-alpha3", optional = true } +atsams70q19b = { version = "0.29.0-alpha3", optional = true } +atsams70q20b = { version = "0.29.0-alpha3", optional = true } +atsams70q21b = { version = "0.29.0-alpha3", optional = true } +atsamv70j19b = { version = "0.29.0-alpha3", optional = true } +atsamv70j20b = { version = "0.29.0-alpha3", optional = true } +atsamv70n19b = { version = "0.29.0-alpha3", optional = true } +atsamv70n20b = { version = "0.29.0-alpha3", optional = true } +atsamv70q19b = { version = "0.29.0-alpha3", optional = true } +atsamv70q20b = { version = "0.29.0-alpha3", optional = true } +atsamv71j19b = { version = "0.29.0-alpha3", optional = true } +atsamv71j20b = { version = "0.29.0-alpha3", optional = true } +atsamv71j21b = { version = "0.29.0-alpha3", optional = true } +atsamv71n19b = { version = "0.29.0-alpha3", optional = true } +atsamv71n20b = { version = "0.29.0-alpha3", optional = true } +atsamv71n21b = { version = "0.29.0-alpha3", optional = true } +atsamv71q19b = { version = "0.29.0-alpha3", optional = true } +atsamv71q20b = { version = "0.29.0-alpha3", optional = true } +atsamv71q21b = { version = "0.29.0-alpha3", optional = true } [patch.crates-io] atsame70j19b = { path = "../../atsamx7x-pac/pac/atsame70j19b" } @@ -180,6 +180,25 @@ rt = ["atsame70j19b?/rt", "atsame70j20b?/rt", "atsame70j21b?/rt", "atsamv71n19b?/rt", "atsamv71n20b?/rt", "atsamv71n21b?/rt", "atsamv71q19b?/rt", "atsamv71q20b?/rt", "atsamv71q21b?/rt"] +critical-section = [ + "atsame70j19b?/critical-section", "atsame70j20b?/critical-section", + "atsame70j21b?/critical-section", "atsame70n19b?/critical-section", + "atsame70n20b?/critical-section", "atsame70n21b?/critical-section", + "atsame70q19b?/critical-section", "atsame70q20b?/critical-section", + "atsame70q21b?/critical-section", "atsams70j19b?/critical-section", + "atsams70j20b?/critical-section", "atsams70j21b?/critical-section", + "atsams70n19b?/critical-section", "atsams70n20b?/critical-section", + "atsams70n21b?/critical-section", "atsams70q19b?/critical-section", + "atsams70q20b?/critical-section", "atsams70q21b?/critical-section", + "atsamv70j19b?/critical-section", "atsamv70j20b?/critical-section", + "atsamv70n19b?/critical-section", "atsamv70n20b?/critical-section", + "atsamv70q19b?/critical-section", "atsamv70q20b?/critical-section", + "atsamv71j19b?/critical-section", "atsamv71j20b?/critical-section", + "atsamv71j21b?/critical-section", "atsamv71n19b?/critical-section", + "atsamv71n20b?/critical-section", "atsamv71n21b?/critical-section", + "atsamv71q19b?/critical-section", "atsamv71q20b?/critical-section", + "atsamv71q21b?/critical-section"] + [package.metadata.docs.rs] # docs.rs build target