Skip to content

Commit

Permalink
fix linker error
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbeechey committed Nov 20, 2024
1 parent 0aca232 commit 133a508
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 70 deletions.
31 changes: 6 additions & 25 deletions Cargo.lock

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

24 changes: 6 additions & 18 deletions boards/stm32f767zi/Cargo.lock

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

2 changes: 1 addition & 1 deletion boards/stm32f767zi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"

[dependencies]
embassy-stm32 = { version = "0.1.0", features = ["defmt", "stm32f767zi", "memory-x", "unstable-pac", "time-driver-any", "exti"] , git = "https://github.com/embassy-rs/embassy", rev = "1c466b81e6af6b34b1f706318cc0870a459550b7"}
embassy-sync = { version = "0.6.0", features = ["defmt"], git = "https://github.com/embassy-rs/embassy"}
embassy-sync = { version = "0.6.0", features = ["defmt"], git = "https://github.com/embassy-rs/embassy", rev = "1c466b81e6af6b34b1f706318cc0870a459550b7"}
embassy-executor = { version = "0.6.0", features = ["task-arena-size-32768", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"], git = "https://github.com/embassy-rs/embassy", rev = "1c466b81e6af6b34b1f706318cc0870a459550b7"}
embassy-time = { version = "0.3.1", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"], git = "https://github.com/embassy-rs/embassy", rev = "1c466b81e6af6b34b1f706318cc0870a459550b7"}
embassy-net = { version = "0.4.0", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet"], git = "https://github.com/embassy-rs/embassy", rev = "1c466b81e6af6b34b1f706318cc0870a459550b7"}
Expand Down
2 changes: 1 addition & 1 deletion boards/stm32f767zi/src/io/adc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ impl<'d, T: Instance> HypedAdc for Stm32f767ziAdc<'d, T> {

impl<'d, T: Instance> Stm32f767ziAdc<'d, T> {
/// Create a new instance of our ADC implementation for the STM32F767ZI
pub fn new(mut adc: Adc<'d, T>, channel: AnyAdcChannel<T>) -> Self {
pub fn new(adc: Adc<'d, T>, channel: AnyAdcChannel<T>) -> Self {
Self { adc, channel }
}
}
7 changes: 5 additions & 2 deletions boards/stm32f767zi/src/tasks/temperature.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
use core::cell::RefCell;

use crate::io::i2c::Stm32f767ziI2c;
use defmt_rtt as _;
use embassy_stm32::i2c::I2c;
use embassy_stm32::time::Hertz;
use embassy_sync::blocking_mutex::Mutex;
use hyped_sensors::temperature::{Status, Temperature, TemperatureAddresses};

/// Test task that just reads the temperature from the sensor and prints it to the console
#[embassy_executor::task]
pub async fn read_temp() -> ! {
let p = embassy_stm32::init(Default::default());
let i2c = I2c::new_blocking(p.I2C1, p.PB8, p.PB9, Hertz(100_000), Default::default());
let mut hyped_i2c = Stm32f767ziI2c::new(i2c);
let hyped_i2c = Mutex::new(RefCell::new(Stm32f767ziI2c::new(i2c)));

let mut temperature_sensor = Temperature::new(&mut hyped_i2c, TemperatureAddresses::Address3f)
let mut temperature_sensor = Temperature::new(&hyped_i2c, TemperatureAddresses::Address3f)
.expect(
"Failed to create temperature sensor. Check the wiring and the I2C address of the sensor.",
);
Expand Down
24 changes: 6 additions & 18 deletions boards/stm32l476rg/Cargo.lock

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

2 changes: 1 addition & 1 deletion boards/stm32l476rg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"

[dependencies]
embassy-stm32 = { version = "0.1.0", features = ["defmt", "stm32l476rg", "memory-x", "unstable-pac", "time-driver-any", "exti"] , git = "https://github.com/embassy-rs/embassy", rev = "1c466b81e6af6b34b1f706318cc0870a459550b7"}
embassy-sync = { version = "0.6.0", features = ["defmt"], git = "https://github.com/embassy-rs/embassy"}
embassy-sync = { version = "0.6.0", features = ["defmt"], git = "https://github.com/embassy-rs/embassy", rev = "1c466b81e6af6b34b1f706318cc0870a459550b7"}
embassy-executor = { version = "0.6.0", features = ["task-arena-size-32768", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"], git = "https://github.com/embassy-rs/embassy", rev = "1c466b81e6af6b34b1f706318cc0870a459550b7"}
embassy-time = { version = "0.3.1", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"], git = "https://github.com/embassy-rs/embassy", rev = "1c466b81e6af6b34b1f706318cc0870a459550b7"}
embassy-net = { version = "0.4.0", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet"], git = "https://github.com/embassy-rs/embassy", rev = "1c466b81e6af6b34b1f706318cc0870a459550b7"}
Expand Down
6 changes: 4 additions & 2 deletions boards/stm32l476rg/src/tasks/temperature.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
use crate::io::i2c::Stm32l476rgI2c;
use core::cell::RefCell;
use defmt_rtt as _;
use embassy_stm32::i2c::I2c;
use embassy_stm32::time::Hertz;
use embassy_sync::blocking_mutex::Mutex;
use hyped_sensors::temperature::{Status, Temperature, TemperatureAddresses};

/// Test task that just reads the temperature from the sensor and prints it to the console
#[embassy_executor::task]
pub async fn read_temp() -> ! {
let p = embassy_stm32::init(Default::default());
let i2c = I2c::new_blocking(p.I2C1, p.PB8, p.PB9, Hertz(100_000), Default::default());
let mut hyped_i2c = Stm32l476rgI2c::new(i2c);
let hyped_i2c = Mutex::new(RefCell::new(Stm32l476rgI2c::new(i2c)));

let mut temperature_sensor = Temperature::new(&mut hyped_i2c, TemperatureAddresses::Address3f)
let mut temperature_sensor = Temperature::new(&hyped_i2c, TemperatureAddresses::Address3f)
.expect(
"Failed to create temperature sensor. Check the wiring and the I2C address of the sensor.",
);
Expand Down
6 changes: 4 additions & 2 deletions lib/sensors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ edition = "2021"

[dependencies]
heapless = "0.8.0"
embassy-sync = { version = "0.6.0", features = ["defmt"], git = "https://github.com/embassy-rs/embassy"}

embassy-sync = { version = "0.6.0", features = ["defmt"], git = "https://github.com/embassy-rs/embassy", rev = "1c466b81e6af6b34b1f706318cc0870a459550b7"}
hyped_core = { path = "../core" }
hyped_io = { path = "../io" }

[dev-dependencies]
embassy-sync = { version = "0.6.0", features = ["defmt", "std"], git = "https://github.com/embassy-rs/embassy", rev = "1c466b81e6af6b34b1f706318cc0870a459550b7"}

0 comments on commit 133a508

Please sign in to comment.