takkaryx[m]: > <@takkaryx:matrix.org> question. I'm noticing I keep trying to fall back to patterns I'm used to in C when attempting to do Rust things, for example, Initialize a peripheral in it's module, but then have a global struct that is then accessed to get information from that peripheral. something like an RTC. > > ATM I noticed I'm trying to generate a static variable to hold the RTC peripheral that I can then pull time out of, but that seems,,, un-rust like? but at the same time, It seems silly that I would instead need to pass the reference to the peripheral or wrapper trait to every module/function that needs the RTC, since it's a global thing. > > Is there somewhere I could look for examples, or does anyone have some thoughts on better ways to do this? Global statics is how RTIC handles this from what I understand. The other approach is to use async tasks where the objects are owned in the async task itself