Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imu i2c: 100 & 400 kHz #171

Merged
merged 3 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 66 additions & 2 deletions .github/workflows/sfy-buoy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:

env:
CARGO_TERM_COLOR: always
BUOYPR: test.product

jobs:
build:
Expand Down Expand Up @@ -41,7 +40,7 @@ jobs:

- name: Build (buoy)
working-directory: sfy-buoy/sfy-artemis
run: cargo build --verbose
run: cargo build --verbose --release

- name: Test (host-tests)
working-directory: sfy-buoy/
Expand All @@ -51,3 +50,68 @@ jobs:
working-directory: sfy-buoy/target-test
run: cargo build --verbose --tests

- name: Build firmware (default)
working-directory: sfy-buoy/
run: |
mkdir -p target/bins
make T=r bin
mv target/sfy-buoy.bin target/bins/sfy-fw-default-no-storage.bin

CARGO_FLAGS="--features storage" make T=r bin
mv target/sfy-buoy.bin target/bins/sfy-fw-default-with-storage.bin

- name: Build firmware (5 min GPS)
working-directory: sfy-buoy/
run: |
mkdir -p target/bins
GPS_PERIOD=300 GPS_HEARTBEAT=-5 SYNC_PERIOD=20 make T=r bin
mv target/sfy-buoy.bin target/bins/sfy-fw-5min-gps-no-storage.bin

GPS_PERIOD=300 GPS_HEARTBEAT=-5 SYNC_PERIOD=20 CARGO_FLAGS="--features storage" make T=r bin
mv target/sfy-buoy.bin target/bins/sfy-fw-5min-gps-with-storage.bin


- name: Build firmware (surf)
working-directory: sfy-buoy/
run: |
mkdir -p target/bins
GPS_PERIOD=300 GPS_HEARTBEAT=-5 SYNC_PERIOD=20 CARGO_FLAGS="--features surf" make T=r bin
mv target/sfy-buoy.bin target/bins/sfy-fw-surf-no-storage.bin

GPS_PERIOD=300 GPS_HEARTBEAT=-5 SYNC_PERIOD=20 CARGO_FLAGS="--features surf,storage" make T=r bin
mv target/sfy-buoy.bin target/bins/sfy-fw-surf-with-storage.bin

- name: Build firmware (26Hz, 10min GPS, drifter)
working-directory: sfy-buoy/
run: |
mkdir -p target/bins
GPS_PERIOD=300 GPS_HEARTBEAT=-5 SYNC_PERIOD=20 CARGO_FLAGS="--features 20Hz" make T=r bin
mv target/sfy-buoy.bin target/bins/sfy-fw-26Hz-drifter-no-storage.bin

GPS_PERIOD=300 GPS_HEARTBEAT=-5 SYNC_PERIOD=20 CARGO_FLAGS="--features 20Hz,storage" make T=r bin
mv target/sfy-buoy.bin target/bins/sfy-fw-26Hz-drifter-with-storage.bin

- name: Build firmware (Mooring, 1h gps, 26Hz)
working-directory: sfy-buoy/
run: |
mkdir -p target/bins
GPS_PERIOD=3600 GPS_HEARTBEAT=1 SYNC_PERIOD=40 CARGO_FLAGS="--features 20Hz" make T=r bin
mv target/sfy-buoy.bin target/bins/sfy-fw-26Hz-mooring-no-storage.bin

GPS_PERIOD=3600 GPS_HEARTBEAT=1 SYNC_PERIOD=40 CARGO_FLAGS="--features 20Hz,storage" make T=r bin
mv target/sfy-buoy.bin target/bins/sfy-fw-26Hz-mooring-with-storage.bin

- name: Build firmware (Mooring, 1h gps, 52Hz)
working-directory: sfy-buoy/
run: |
mkdir -p target/bins
GPS_PERIOD=3600 GPS_HEARTBEAT=1 SYNC_PERIOD=40 make T=r bin
mv target/sfy-buoy.bin target/bins/sfy-fw-52Hz-mooring-no-storage.bin

GPS_PERIOD=3600 GPS_HEARTBEAT=1 SYNC_PERIOD=40 CARGO_FLAGS="--features storage" make T=r bin
mv target/sfy-buoy.bin target/bins/sfy-fw-52Hz-mooring-with-storage.bin

- uses: actions/upload-artifact@v4
with:
name: firmware
path: sfy-buoy/target/bins
2 changes: 1 addition & 1 deletion sfy-buoy/sfy-artemis/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ fn main() -> ! {
delay.delay_ms(1_000u32);

let i2c4 = i2c::I2c::new(dp.IOM4, pins.d10, pins.d9, i2c::Freq::F100kHz);
let i2c3 = i2c::I2c::new(dp.IOM3, pins.d6, pins.d7, i2c::Freq::F1mHz);
let i2c3 = i2c::I2c::new(dp.IOM3, pins.d6, pins.d7, i2c::Freq::F400kHz);

// Set up RTC
let mut rtc = hal::rtc::Rtc::new(dp.RTC, &mut dp.CLKGEN);
Expand Down
Loading