You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got lost on your example for using shared-bus with threads.
My cargo.toml file in [dependencies]
shared-bus = {git = "https://github.com/Rahix/shared-bus.git", version = "0.2.3", features = ["eh-alpha", "std"]}
My main.rs
let peripherals = Peripherals::take().unwrap();
let pins = peripherals.pins;
// Create i2c interface on I2C0 with bus speed of 400kHz
let i2c0 = peripherals.i2c0;
let scl = pins.gpio22;
let sda = pins.gpio21;
let i2c_config = <i2c::config::MasterConfig as Default>::default().baudrate(400.kHz().into());
let i2c_bus_0 =
i2c::Master::<i2c::I2C0, _, _>::new(i2c0, i2c::MasterPins { sda, scl }, i2c_config)
.unwrap();
// Create a shared-bus for the I2C devices
let i2c_bus_manager: &'static _ = shared_bus::new_std!(i2c_bus_0).unwrap(); <-------- ERROR IS HERE
My error
expected 1 argument, found 0
unexpected end of macro invocation
missing tokens in macro arguments
1. Sorry I am new to rust, what needs to be done to get rid of the error. 2. I tried xtensa feature but that failed with " cannot find macro llvm_asm in this scope"
The text was updated successfully, but these errors were encountered:
Well the problem is you are not calling the macro correctly. Check the documentation for new_std!(), you need to state the type signature explicitly as well. The usual pattern would be something like:
I got lost on your example for using shared-bus with threads.
My cargo.toml file in [dependencies]
My main.rs
My error
1. Sorry I am new to rust, what needs to be done to get rid of the error.
2. I tried xtensa feature but that failed with " cannot find macro
llvm_asm
in this scope"The text was updated successfully, but these errors were encountered: