From 98ae1bc5a8fced3980e036ac29fdbc0b19ec04f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Fita?= <4925040+michalfita@users.noreply.github.com> Date: Thu, 14 Sep 2023 20:01:59 +0100 Subject: [PATCH 1/9] [Fixes #62] Remove re-exports to avoid warnings promoted to errors --- hal/src/serial/mod.rs | 4 ---- hal/src/serial/usart/uart.rs | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/hal/src/serial/mod.rs b/hal/src/serial/mod.rs index 8dd472c7..653a6418 100644 --- a/hal/src/serial/mod.rs +++ b/hal/src/serial/mod.rs @@ -20,15 +20,11 @@ impl ExtBpsU32 for u32 { } pub mod uart; -pub use uart::*; pub mod usart; -pub use usart::*; pub mod twi; pub use twi::*; #[cfg(not(feature = "pins-64"))] pub mod spi; -#[cfg(not(feature = "pins-64"))] -pub use spi::*; diff --git a/hal/src/serial/usart/uart.rs b/hal/src/serial/usart/uart.rs index 18339e56..62ec661c 100644 --- a/hal/src/serial/usart/uart.rs +++ b/hal/src/serial/usart/uart.rs @@ -14,7 +14,7 @@ use crate::ehal::{self, blocking}; pub enum UartError { /// A frame's stop bit was read as zero. Framing, - /// Parity check of the recived frame failed. + /// Parity check of the received frame failed. Parity, /// A word was received before the previous word was read. Overrun, From afd9cce6354dacb2e12d2fd663b655dec6227656 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Fita?= <4925040+michalfita@users.noreply.github.com> Date: Sun, 17 Sep 2023 11:48:10 +0100 Subject: [PATCH 2/9] [Fixes #62] Amend `CHANGELOG.md` --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67d9285f..99afc924 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,7 @@ ### Added -- [Integration](https://crates.io/crates/mcan-core) with the -[`mcan`](https://crates.io/crates/mcan) crate. +- [Integration](https://crates.io/crates/mcan-core) with the [`mcan`](https://crates.io/crates/mcan) crate. - Implementation of blocking::i2c::Transactional trait from [embedded-hal](https://crates.io/crates/embedded-hal) for TWI device. ### Changed @@ -14,6 +13,7 @@ ### Removed ### Fixed +- [#62] Remove ambiguous reexports from `src/serial/mod.rs`. ## [v0.4.2] 2022-11-06 From 0550fc0a28c7dcdeb822437555d98d6246ff9a22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Fita?= <4925040+michalfita@users.noreply.github.com> Date: Sun, 17 Sep 2023 12:06:09 +0100 Subject: [PATCH 3/9] [Fixes #62] Add build w/latest toolchain --- .github/workflows/build.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 61c4d881..e20a9487 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,6 +39,24 @@ jobs: - name: Build HAL for ${{ matrix.pac }} run: cargo check --package atsamx7x-hal --features ${{ matrix.pac }},unproven + build-latest: + needs: setup + runs-on: ubuntu-latest + strategy: + matrix: + pac: ${{ fromJson(needs.setup.outputs.pac_matrix) }} + steps: + - name: Checkout sources + uses: actions/checkout@v2 + - name: Update toolchain + run: rustup update + - name: Specify toolchain + run: rustup override set stable + - 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 + build-features: needs: setup runs-on: ubuntu-latest From 0729118b23a672cd9e683a6e8631d584d5866cd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Fita?= <4925040+michalfita@users.noreply.github.com> Date: Sun, 17 Sep 2023 12:21:52 +0100 Subject: [PATCH 4/9] [Fixes #62] Let latest toolchain fail --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e20a9487..f9536f74 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,6 +45,7 @@ jobs: strategy: matrix: pac: ${{ fromJson(needs.setup.outputs.pac_matrix) }} + continue-on-error: true # we let this fail and carry on, but GH UI is poor not showing amber like other CIs steps: - name: Checkout sources uses: actions/checkout@v2 From 9122b536f61a8fdcb8132ff1619a0183278145d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Fita?= <4925040+michalfita@users.noreply.github.com> Date: Sun, 17 Sep 2023 12:45:14 +0100 Subject: [PATCH 5/9] [Fixes #62] Push trigger is enough to appear in PRs --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f9536f74..9dda64bb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,5 @@ name: HAL -on: [push, pull_request] +on: [push] env: RUSTDOCFLAGS: -D warnings From 2d75357e2be52ea1b2ecaa3e0eb9e7132b34e5e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Fita?= <4925040+michalfita@users.noreply.github.com> Date: Sun, 1 Oct 2023 17:16:01 +0100 Subject: [PATCH 6/9] [Fixes #62] Restore building on `pull_request` but not for local branches --- .github/workflows/build.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9dda64bb..e49e8e85 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,5 @@ name: HAL -on: [push] +on: [push, pull_request] env: RUSTDOCFLAGS: -D warnings @@ -8,6 +8,7 @@ env: jobs: setup: + if: github.event.pull_request.head.repo.full_name != github.repository runs-on: ubuntu-latest steps: - name: Checkout sources @@ -24,6 +25,7 @@ jobs: feature_matrix: ${{ steps.features.outputs.feature_matrix }} build: + if: github.event.pull_request.head.repo.full_name != github.repository needs: setup runs-on: ubuntu-latest strategy: @@ -40,6 +42,7 @@ jobs: run: cargo check --package atsamx7x-hal --features ${{ matrix.pac }},unproven build-latest: + if: github.event.pull_request.head.repo.full_name != github.repository needs: setup runs-on: ubuntu-latest strategy: @@ -59,6 +62,7 @@ jobs: run: cargo check --package atsamx7x-hal --features ${{ matrix.pac }},unproven build-features: + if: github.event.pull_request.head.repo.full_name != github.repository needs: setup runs-on: ubuntu-latest strategy: @@ -75,6 +79,7 @@ jobs: run: cargo check --package atsamx7x-hal --features ${{ matrix.features }},samv71q21b,unproven board-examples: + if: github.event.pull_request.head.repo.full_name != github.repository needs: setup runs-on: ubuntu-latest strategy: @@ -93,6 +98,7 @@ jobs: cargo check --examples clippy-hal: + if: github.event.pull_request.head.repo.full_name != github.repository needs: build runs-on: ubuntu-latest steps: @@ -108,6 +114,7 @@ jobs: run: cargo clippy --package atsamx7x-hal --no-deps --features samv71q21b,unproven,reconfigurable-system-pins -- --deny warnings clippy-examples: + if: github.event.pull_request.head.repo.full_name != github.repository needs: [setup, build, board-examples] runs-on: ubuntu-latest strategy: @@ -128,6 +135,7 @@ jobs: cargo clippy --examples --no-deps -- --deny warnings docs: + if: github.event.pull_request.head.repo.full_name != github.repository needs: build runs-on: ubuntu-latest steps: From 7248ecb3f038ec7b6c4401a4feb6db4444cdd1f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=20H=C3=A5kansson?= Date: Tue, 14 Feb 2023 10:21:14 +0100 Subject: [PATCH 7/9] Update `cortex-m-rt` version in examples to 0.7.3 Due to the discovery in https://github.com/rust-embedded/cortex-m/discussions/469, it is not advisable to be using 0.7.1 or 0.7.2 of `cortex-m-rt` anymore. --- CHANGELOG.md | 1 + boards/atsame70_xpro/Cargo.lock | 14 ++++++++++++-- boards/atsamv71_xult/Cargo.lock | 4 ++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74225546..2da191ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ### Changed - Remove `rust-toolchain.toml` and control MSRV from .github/workflow/ files instead. +- Update `cortex-m-rt` version in examples to `0.7.3`. ### Removed diff --git a/boards/atsame70_xpro/Cargo.lock b/boards/atsame70_xpro/Cargo.lock index a693e1e9..3e3119dd 100644 --- a/boards/atsame70_xpro/Cargo.lock +++ b/boards/atsame70_xpro/Cargo.lock @@ -53,6 +53,7 @@ dependencies = [ "cortex-m", "embedded-hal", "fugit", + "mcan-core", "nb 1.0.0", "paste", "rtic-monotonic", @@ -126,9 +127,9 @@ dependencies = [ [[package]] name = "cortex-m-rt" -version = "0.7.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c433da385b720d5bb9f52362fa2782420798e68d40d67bfe4b0d992aba5dfe7" +checksum = "ee84e813d593101b1723e13ec38b6ab6abbdbaaa4546553f5395ed274079ddb1" dependencies = [ "cortex-m-rt-macros", ] @@ -272,6 +273,15 @@ dependencies = [ "scopeguard", ] +[[package]] +name = "mcan-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b3dee4ff5269e2465cc856d37103cce916c1ef73b4377f006c963872e69f7ca" +dependencies = [ + "fugit", +] + [[package]] name = "memchr" version = "2.5.0" diff --git a/boards/atsamv71_xult/Cargo.lock b/boards/atsamv71_xult/Cargo.lock index 48971694..3549f9f3 100644 --- a/boards/atsamv71_xult/Cargo.lock +++ b/boards/atsamv71_xult/Cargo.lock @@ -135,9 +135,9 @@ dependencies = [ [[package]] name = "cortex-m-rt" -version = "0.7.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c433da385b720d5bb9f52362fa2782420798e68d40d67bfe4b0d992aba5dfe7" +checksum = "ee84e813d593101b1723e13ec38b6ab6abbdbaaa4546553f5395ed274079ddb1" dependencies = [ "cortex-m-rt-macros", ] From 7e9c1259242e92b0959ba477eb051ace3d421cc0 Mon Sep 17 00:00:00 2001 From: Benoit LIETAER Date: Tue, 28 Nov 2023 11:39:47 +0100 Subject: [PATCH 8/9] ADC Example tested on Xult/EXT-1 PIN#4 (PA19/AFEC0_AD8) --- boards/atsamv71_xult/examples/periodic_adc_sample.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/boards/atsamv71_xult/examples/periodic_adc_sample.rs b/boards/atsamv71_xult/examples/periodic_adc_sample.rs index ba5ac551..64ae4d05 100644 --- a/boards/atsamv71_xult/examples/periodic_adc_sample.rs +++ b/boards/atsamv71_xult/examples/periodic_adc_sample.rs @@ -25,7 +25,7 @@ mod app { #[local] struct Local { afec: Afec, - pin: Pin, + pin: Pin, } #[init] @@ -65,7 +65,7 @@ mod app { ); let afec = Afec::new_afec0(ctx.device.AFEC0, &mut mck).unwrap(); - let pin = banka.pa17.into_input(PullDir::PullUp); + let pin = banka.pa19.into_input(PullDir::PullUp); adc_sample::spawn().unwrap(); @@ -77,7 +77,7 @@ mod app { let adc_sample::LocalResources { afec, pin } = ctx.local; let v: f32 = afec.read(pin).unwrap(); - rprintln!("PA17 (channel 6) = {:.2}V", v); + rprintln!("PA19 (channel 6) = {:.2}V", v); adc_sample::spawn_after(1.secs()).unwrap(); } From c62ad8810581a565528fa113be45d45d5e53287a Mon Sep 17 00:00:00 2001 From: Benoit LIETAER Date: Tue, 28 Nov 2023 12:27:15 +0100 Subject: [PATCH 9/9] ADC Example tested on Xult/EXT-1 PIN#4 (PA19/AFEC0_AD8) --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd21d7a2..df85f7b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ### Changed - Remove `rust-toolchain.toml` and control MSRV from .github/workflow/ files instead. - Update `cortex-m-rt` version in examples to `0.7.3`. +- Switched from AFE0_AD6 to AFE0_AD8 for the atsamv71_xult board ADC example code. ### Removed