From 52ad513020392da7aee20778527ffd426db02b78 Mon Sep 17 00:00:00 2001 From: Ryan Summers Date: Mon, 15 Jul 2024 15:02:25 +0200 Subject: [PATCH 1/5] Updating CI checks --- .github/workflows/ci.yml | 66 +++++++++++----------------------------- 1 file changed, 17 insertions(+), 49 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcfe7a0..6327c0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,72 +17,40 @@ jobs: style: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: thumbv7em-none-eabihf - override: true - - uses: Swatinem/rust-cache@v1 - - name: cargo fmt --check - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check - - uses: actions-rs/clippy-check@v1 + - uses: actions/checkout@v4 + + - uses: dtolany/rust-toolchain@stable with: - token: ${{ secrets.GITHUB_TOKEN }} + targets: thumbv7em-none-eabihf + components: rustfmt, clippy + + - run: cargo fmt --all -- --check + - run: cargo check + + - run: cargo clippy --all-features compile: runs-on: ubuntu-latest - continue-on-error: ${{ matrix.toolchain == 'nightly' }} - strategy: - max-parallel: 2 - matrix: - toolchain: - - stable steps: - uses: actions/checkout@v2 - - name: Install Rust ${{ matrix.toolchain }} - uses: actions-rs/toolchain@v1 + - uses: dtolany/rust-toolchain@stable with: - toolchain: ${{ matrix.toolchain }} - target: thumbv7em-none-eabihf - override: true - components: llvm-tools-preview + targets: thumbv7em-none-eabihf - uses: Swatinem/rust-cache@v1 - if: ${{ matrix.toolchain != 'nightly' }} - - - name: Install Binutils - uses: actions-rs/cargo@v1 - with: - command: install - args: cargo-binutils - - name: Build [Debug] - uses: actions-rs/cargo@v1 - with: - command: build + - run: cargo install cargo-binutils - - name: Build [Release] - uses: actions-rs/cargo@v1 - with: - command: build - args: --release + - run: cargo build + - run: cargo build --release - name: Extract Binary - uses: actions-rs/cargo@v1 - with: - command: objcopy - args: --release --verbose -- -O binary booster-release.bin + run: cargo objcopy --release --verbose -- -O binary booster-release.bin - name: Upload Artifacts uses: actions/upload-artifact@v2 - if: ${{ matrix.toolchain == 'stable' - && (github.ref == 'refs/heads/master' - || github.ref == 'refs/heads/develop') }} + if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop') with: name: Firmware Images path: | From f07af09053bc7bf59cd35b574246e91303c30ebd Mon Sep 17 00:00:00 2001 From: Ryan Summers Date: Mon, 15 Jul 2024 15:06:32 +0200 Subject: [PATCH 2/5] Fixing spelling --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6327c0c..fb3de65 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: dtolany/rust-toolchain@stable + - uses: dtolnay/rust-toolchain@stable with: targets: thumbv7em-none-eabihf components: rustfmt, clippy @@ -34,7 +34,7 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: dtolany/rust-toolchain@stable + - uses: dtolnay/rust-toolchain@stable with: targets: thumbv7em-none-eabihf From 03e2a326d851339bcb43e8dc19047b04d66d6514 Mon Sep 17 00:00:00 2001 From: Ryan Summers Date: Mon, 15 Jul 2024 15:09:38 +0200 Subject: [PATCH 3/5] Deny warnings, llvm-tools-preview, an dupload-artfiacts bump --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb3de65..2ab1c7e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: - run: cargo fmt --all -- --check - run: cargo check - - run: cargo clippy --all-features + - run: cargo clippy --all-features -- -D warnings compile: runs-on: ubuntu-latest @@ -37,6 +37,7 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: targets: thumbv7em-none-eabihf + components: llvm-tools-preview - uses: Swatinem/rust-cache@v1 @@ -49,7 +50,7 @@ jobs: run: cargo objcopy --release --verbose -- -O binary booster-release.bin - name: Upload Artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop') with: name: Firmware Images From 6b1b5100a4d743f56c511db4fdc63bc24ee76cc0 Mon Sep 17 00:00:00 2001 From: Ryan Summers Date: Mon, 15 Jul 2024 15:11:24 +0200 Subject: [PATCH 4/5] Bumping rust-cache --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ab1c7e..ca2433c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 - uses: dtolnay/rust-toolchain@stable with: @@ -39,7 +40,7 @@ jobs: targets: thumbv7em-none-eabihf components: llvm-tools-preview - - uses: Swatinem/rust-cache@v1 + - uses: Swatinem/rust-cache@v2 - run: cargo install cargo-binutils From 806abfd681b86b6d0af8ad5da96d4bc84349d9f6 Mon Sep 17 00:00:00 2001 From: Ryan Summers Date: Mon, 15 Jul 2024 15:15:41 +0200 Subject: [PATCH 5/5] Fixing clippy --- src/hardware/rf_channel.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hardware/rf_channel.rs b/src/hardware/rf_channel.rs index 48a99c0..5e57ee5 100644 --- a/src/hardware/rf_channel.rs +++ b/src/hardware/rf_channel.rs @@ -155,7 +155,7 @@ impl Devices { ) -> Option<(Self, Microchip24AA02E48)> { // The ADS7924 and DAC7571 are present on the booster mainboard, so instantiation // and communication should never fail. - let mut dac7571 = Dac7571::default(i2c::AtomicDevice::new(&manager)); + let mut dac7571 = Dac7571::default(i2c::AtomicDevice::new(manager)); // Ensure the bias DAC is placing the RF amplifier in pinch off (disabled). dac7571 @@ -163,7 +163,7 @@ impl Devices { .expect("Bias DAC did not respond"); // Verify we can communicate with the power monitor. - let mut ads7924 = Ads7924::default(i2c::AtomicDevice::new(&manager), delay) + let mut ads7924 = Ads7924::default(i2c::AtomicDevice::new(manager), delay) .expect("Power monitor did not enumerate"); ads7924 .get_voltage(ads7924::Channel::Three) @@ -176,11 +176,11 @@ impl Devices { assert!(ads7924.clear_alarm().expect("Failed to clear alarm") == 0); // Query devices on the RF module to verify they are present. - let ad5627 = Ad5627::default(i2c::AtomicDevice::new(&manager)).ok()?; - let eui48 = Microchip24AA02E48::new(i2c::AtomicDevice::new(&manager)).ok()?; - let mut max6642 = Max6642::att94(i2c::AtomicDevice::new(&manager)); + let ad5627 = Ad5627::default(i2c::AtomicDevice::new(manager)).ok()?; + let eui48 = Microchip24AA02E48::new(i2c::AtomicDevice::new(manager)).ok()?; + let mut max6642 = Max6642::att94(i2c::AtomicDevice::new(manager)); max6642.get_remote_temperature().ok()?; - let mut mcp3221 = Mcp3221::default(i2c::AtomicDevice::new(&manager)); + let mut mcp3221 = Mcp3221::default(i2c::AtomicDevice::new(manager)); mcp3221.get_voltage().ok()?; Some((