Skip to content
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

RTIC example? #11

Closed
arrowcircle opened this issue Sep 18, 2020 · 5 comments
Closed

RTIC example? #11

arrowcircle opened this issue Sep 18, 2020 · 5 comments

Comments

@arrowcircle
Copy link

Hi!
I am struggling to use this driver with RTIC because of delay provider.
What is the best way to use this library with RTIC?

@nebelgrau77
Copy link

@arrowcircle You can get the delay in RTIC from core:

 #[init]
    fn init(cx: init::Context) -> init::LateResources {
        let dp = cx.device;
        let core = cx.core;

        //clocks and other peripherals defined here

        let mut delay = Delay::new(core.SYST, clocks);

Here's an example with a different I2C device:

https://github.com/jamwaffles/ssd1306/blob/master/examples/rtic_dvd.rs

@arrowcircle
Copy link
Author

@nebelgrau77 I already tried this thing, but it does not work.

no field `SYST` on type `rtic::Peripherals`

@nebelgrau77
Copy link

OK, here's my repo that works:

https://github.com/nebelgrau77/sensor_data_forwarder_Rust

You need to get SYST from cx.core, not cx.device.

@arrowcircle
Copy link
Author

@nebelgrau77 I use bluepill and it looks like there are no SYST in cx.core of F1.

@nebelgrau77
Copy link

nebelgrau77 commented Dec 17, 2020

I see... hmmm, try asking in RTIC channel here: https://app.element.io/#/room/#rtic:matrix.org - I didn't realize it might be a board/MCU specific issue.

...it's strange, though: that first example I indicated, the SSD1306, is for the F1xx. Weird...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants