Skip to content

Commit

Permalink
Merge pull request #424 from quartiq/feature/ci-updates
Browse files Browse the repository at this point in the history
Updating CI checks
  • Loading branch information
ryan-summers authored Jul 15, 2024
2 parents 1f1321c + 806abfd commit 5ef9339
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 56 deletions.
70 changes: 20 additions & 50 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,72 +17,42 @@ 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: Swatinem/rust-cache@v2

- uses: dtolnay/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 -- -D warnings

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: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.toolchain }}
target: thumbv7em-none-eabihf
override: true
targets: thumbv7em-none-eabihf
components: llvm-tools-preview

- uses: Swatinem/rust-cache@v1
if: ${{ matrix.toolchain != 'nightly' }}

- name: Install Binutils
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-binutils
- uses: Swatinem/rust-cache@v2

- 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') }}
uses: actions/upload-artifact@v4
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')
with:
name: Firmware Images
path: |
Expand Down
12 changes: 6 additions & 6 deletions src/hardware/rf_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,15 @@ impl Devices {
) -> Option<(Self, Microchip24AA02E48<I2cProxy>)> {
// 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
.set_voltage(platform::BIAS_DAC_VCC)
.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)
Expand All @@ -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((
Expand Down

0 comments on commit 5ef9339

Please sign in to comment.