diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 163ce2c..edcbe50 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -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 diff --git a/Cargo.lock b/Cargo.lock index 26bab49..702266f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -65,17 +65,6 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" -[[package]] -name = "bme280" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "169ac81b9123f316fde5b0e00175294dcdcdd800c1a6c92a4b58caf42a14cf1f" -dependencies = [ - "embedded-hal 1.0.0", - "embedded-hal-async", - "maybe-async-cfg", -] - [[package]] name = "bno055" version = "0.4.0" @@ -868,19 +857,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "maybe-async-cfg" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21fb8fac02158b9b529eb692491895d8459dbac939f3bc6e32159969646ffe55" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "pulldown-cmark", - "quote", - "syn 1.0.109", -] - [[package]] name = "memchr" version = "2.7.2" @@ -1033,17 +1009,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "pulldown-cmark" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b" -dependencies = [ - "bitflags 2.5.0", - "memchr", - "unicase", -] - [[package]] name = "quote" version = "1.0.36" @@ -1181,7 +1146,6 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" name = "stack-ripper" version = "0.0.1" dependencies = [ - "bme280", "bno055", "cfg-if", "critical-section", @@ -1334,15 +1298,6 @@ dependencies = [ "winnow", ] -[[package]] -name = "unicase" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] - [[package]] name = "unicode-ident" version = "1.0.12" diff --git a/Cargo.toml b/Cargo.toml index 5d8564e..3574a1e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/Embed.toml b/Embed.toml deleted file mode 100644 index 9ff8de1..0000000 --- a/Embed.toml +++ /dev/null @@ -1,11 +0,0 @@ -[default.general] - chip = "nrf52833_xxAA" - -[default.reset] -halt_afterwards = false - -[default.rtt] -enabled = false - -[default.gdb] -enabled = false diff --git a/README.md b/README.md index c54e7eb..22c142c 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..84d2639 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +channel = "stable" +components = ["rust-src"] +targets = ["riscv32imc-unknown-none-elf"] \ No newline at end of file diff --git a/src/alt.rs b/src/alt.rs index 7a62143..c4df900 100644 --- a/src/alt.rs +++ b/src/alt.rs @@ -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; @@ -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; } } diff --git a/src/bin/av.rs b/src/bin/av.rs index 8a53b15..a823eb7 100644 --- a/src/bin/av.rs +++ b/src/bin/av.rs @@ -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();