-
Notifications
You must be signed in to change notification settings - Fork 3
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
e-hal@v1 support #5
Comments
Hey, I saw you starred my recent Rust AVR AS5600 repo using your crate and now I just saw this issue! :) Would it make sense to implement traits from embedded_hal_async I2c instead. I'm targetting embassy and perhaps a non-blocking impl could be more interesting for this use case and also in general? /cc @jubeormk1 |
Both make sense |
I'm going over my driver crates and this one is next! Unless PR :) |
Please go ahead, I think it'd take me more time to understand how to integrate sync and async I2C and PR than if you implement it. I'm currently reading some resources and it's unclear (to me) which route to take and how to implement it properly: therealprof/display-interface#48 /cc @jubeormk1 |
upcoming crates.io release 0.7.0 with e-hal (blocking) support @brainstorm |
@brainstorm the v0.8.0 release has the feature "async". Please let me know if it works for you! |
Thanks heaps for adding this in record speed! Unfortunately I'm still facing a panic when querying the $ cargo build
WARN rustc_codegen_ssa::back::link Linker does not support -no-pie command line option. Retrying without.
Finished `dev` profile [optimized + debuginfo] target(s) in 0.16s
$ simavr --mcu atmega2560 target/avr-atmega2560/debug/embassy-avr-as5600-encoder.elf
Loaded 10124 .text at address 0x0
Loaded 3242 .data
Reading angle.
Firmware panic!..
At src/main.rs:63:38..
^Csignal caught, simavr terminating The code above is essentially trying to read the sensor angle on the loop: (...)
loop {
ufmt::uwriteln!(&mut serial, "{}", "Reading angle").unwrap();
let status = encoder.angle().unwrap();
ufmt::uwriteln!(&mut serial, "{}", "Angle has been read").unwrap_infallible();
ufmt::uwriteln!(&mut serial, "{}", status).unwrap_infallible();
} |
Can you not unwrap the results and print them instead? If that doesn't work because of ufmt, then match on the result and print at least which variant it was |
Thanks! Just did that and seems to be about comms ( Tomorrow I'll solder the 100nF & 1nF caps recommended by the datasheet and try again :) |
I thought so. Likely the Comms error will be an underlying i2c nak error. Btw of course it doesn't panic if you don't unwrap :) you have pull-ups in place? |
Heh, yes indeed I should have written the Probably Result is not common in Anyway, yes, I'm using a RAMPS 1.4 hat so it does have a couple of 4K7 resistors installed for pull-ups (on D20/D21): |
I don't think returning a result from main in embedded is a good idea. Where does it return to? Unless you make it another function and call that one from main of course. But it sounds like you have different problems rn :) let me know how it goes :) |
No description provided.
The text was updated successfully, but these errors were encountered: