Skip to content
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
6 changes: 0 additions & 6 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Use nightly rust
run: rustup default nightly
- name: Use nightly rust toolchain
run: rustup toolchain install nightly --component rust-src
- name: Add target
run: rustup target add riscv32imc-unknown-none-elf
- name: Build
run: cargo build --verbose
- name: Install rustfmt
Expand Down
45 changes: 0 additions & 45 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ esp-hal-embassy = { version = "0.1.0", features = ["esp32c3", "defmt", "inte
esp-println = { version = "0.11.0", features = ["esp32c3", "defmt-espflash"] }
defmt = "0.3.6"

bme280 = { version = "0.5.0", features = ["async", "embedded-hal-async"] }
nmea0183 = "0.4.0"
micromath = "2.1.0"
lora-phy = "3.0.0"
Expand Down
11 changes: 0 additions & 11 deletions Embed.toml

This file was deleted.

5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@ Each prehipheral is maintained in a resuable library in `/src/[prehipheral].rs`

## Getting started

Install the prerequisites
Install the prerequisites (not required if `rustup` automatically detects `rust-toolchain.toml`)

```bash
rustup default nightly
rustup toolchain install nightly --component rust-src
rustup toolchain install stable --component rust-src
rustup target add riscv32imc-unknown-none-elf
```

Expand Down
4 changes: 4 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[toolchain]
channel = "stable"
components = ["rust-src"]
targets = ["riscv32imc-unknown-none-elf"]
32 changes: 16 additions & 16 deletions src/alt.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use bme280::i2c::AsyncBME280;
// use bme280::i2c::AsyncBME280;
use embassy_embedded_hal::shared_bus::asynch::i2c::I2cDevice;
use embassy_executor::task;
use embassy_sync::blocking_mutex::raw::NoopRawMutex;
Expand All @@ -16,25 +16,25 @@ fn get_absolute_altitude_from_pressure(pressure: f32) -> f32 {

#[task]
pub async fn sample(i2c: I2cDevice<'static, NoopRawMutex, I2C<'static, I2C0, Async>>) -> ! {
let mut alitmeter = AsyncBME280::new_primary(i2c);
alitmeter.init(&mut Delay).await.unwrap();
// let mut alitmeter = AsyncBME280::new_primary(i2c);
// alitmeter.init(&mut Delay).await.unwrap();

// Idk try waiting 1 sec for things to get going?
Timer::after_millis(5_000).await;
// // Idk try waiting 1 sec for things to get going?
// Timer::after_millis(5_000).await;

let starting_alt = alitmeter.measure(&mut Delay).await.unwrap();
let starting_alt = get_absolute_altitude_from_pressure(starting_alt.pressure);
// let starting_alt = alitmeter.measure(&mut Delay).await.unwrap();
// let starting_alt = get_absolute_altitude_from_pressure(starting_alt.pressure);

loop {
let current_alt = alitmeter.measure(&mut Delay).await.unwrap();
{
let mut state = STATE.lock().await;
let alt = get_absolute_altitude_from_pressure(current_alt.pressure);
state.aaa = Some(alt);
state.aar = Some(alt - starting_alt);
state.aaa = Some(current_alt.temperature)
}
// let current_alt = alitmeter.measure(&mut Delay).await.unwrap();
// {
// let mut state = STATE.lock().await;
// let alt = get_absolute_altitude_from_pressure(current_alt.pressure);
// state.aaa = Some(alt);
// state.aar = Some(alt - starting_alt);
// state.aaa = Some(current_alt.temperature)
// }

Timer::after_millis(1_000).await;
// Timer::after_millis(1_000).await;
}
}
4 changes: 2 additions & 2 deletions src/bin/av.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ async fn main(_spawner: Spawner) -> () {

let i2c_bus = i2c::init(peripherals.I2C0, &clocks, i2c_clock, i2c_data);

let i2c_alt = I2cDevice::new(i2c_bus);
_spawner.spawn(alt::sample(i2c_alt)).ok();
// let i2c_alt = I2cDevice::new(i2c_bus);
// _spawner.spawn(alt::sample(i2c_alt)).ok();

let i2c_imu = I2cDevice::new(i2c_bus);
_spawner.spawn(imu::sample(i2c_imu)).ok();
Expand Down
Loading