ChanServ changed the topic of #rust-embedded to: Welcome to the Rust Embedded IRC channel! Bridged to #rust-embedded:matrix.org and logged at https://libera.irclog.whitequark.org/rust-embedded, code of conduct at https://www.rust-lang.org/conduct.html
<cr1901> Where is Peripherals::take?
<cr1901> Ahhh, it requires the critical-section feature
starblue has quit [Ping timeout: 252 seconds]
starblue has joined #rust-embedded
dc740 has quit [Remote host closed the connection]
<re_irc> <ignormies> burrbull: I'm probably going to just be reimplementing the logic of the crate myself (with "blocking::spi::Write") for my own use-case specific purposes (there's not much in there after all).
<re_irc> But I don't understand how the stm32f1 example (https://github.com/smart-leds-rs/smart-leds-samples/blob/master/stm32f1-examples/examples/stm32f1_ws2812_spi_blink.rs) _ever_ worked if "ws2812-spi-rs" always uses "FullDuplex". Is it just a borked example?
<re_irc> <ignormies> I guess it's because it _always_ ".read()"s after ".send()"ing? But that still doesn't explain why I get "Overrun" errors whenever I use the example...
emerent has joined #rust-embedded
dc740 has joined #rust-embedded
causal has quit [Quit: WeeChat 3.6]
neceve has joined #rust-embedded
crabbedhaloablut has quit [Remote host closed the connection]
crabbedhaloablut has joined #rust-embedded
crabbedhaloablut has quit [Ping timeout: 258 seconds]
crabbedhaloablut has joined #rust-embedded
Shell has quit [Quit: ZNC 1.8.2 - https://znc.in]
Shell has joined #rust-embedded
Shell has quit [Quit: ZNC 1.8.2 - https://znc.in]
Shell has joined #rust-embedded
Shell has quit [Remote host closed the connection]
Shell has joined #rust-embedded
rardiol has joined #rust-embedded
Shell has quit [Quit: ZNC 1.8.2 - https://znc.in]
Shell has joined #rust-embedded
Shell has quit [Quit: ZNC 1.8.2 - https://znc.in]
Shell has joined #rust-embedded
Shell has quit [Quit: ZNC 1.8.2 - https://znc.in]
Shell has joined #rust-embedded
Shell has quit [Remote host closed the connection]
Shell has joined #rust-embedded
Shell has quit [Quit: ZNC 1.8.2 - https://znc.in]
Shell has joined #rust-embedded
Shell has quit [Remote host closed the connection]
Shell has joined #rust-embedded
Shell- has joined #rust-embedded
Shell has quit [Killed (NickServ (GHOST command used by Shell-!~Shell@user/shell))]
Shell- is now known as Shell
VShell has joined #rust-embedded
VShell has quit [Remote host closed the connection]
rardiol has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
causal has joined #rust-embedded
starblue has quit [Ping timeout: 244 seconds]
GenTooMan has quit [Ping timeout: 244 seconds]
<re_irc> <nihal.pasham> question: are there any good crates for parsing "config files" (like toml files) in a no_std environment?
<re_irc> <newam> nihal.pasham: Serde works in no_std, and there are .ini parsers for that which most config files follow.
<re_irc> <newam> -for that which most config files follow.
GenTooMan has joined #rust-embedded
<re_irc> <nihal.pasham> yeah, hoping to save some time and pick an existing one. "ini parsers" - would you recommend any crate in particular
<re_irc> <newam> Have not tried ini serde implementations myself
<re_irc> <nihal.pasham> Thanks, I'll take a look at available uni parsers. Guess it's either this or roll your own parser using something like nom
<re_irc> <nihal.pasham> * "nom"
emerent has quit [Remote host closed the connection]
emerent has joined #rust-embedded
GenTooMan has quit [Ping timeout: 244 seconds]
GenTooMan has joined #rust-embedded
neceve has quit [Ping timeout: 268 seconds]
neceve has joined #rust-embedded
neceve has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
neceve has joined #rust-embedded
neceve has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
neceve has joined #rust-embedded
<re_irc> <GrantM11235> burrbull: Without "#[macro_export]", you can only do "pub(crate) use" 😭
<re_irc> <GrantM11235> > error[E0364]: "spi_transaction_helper" is only public within the crate, and cannot be re-exported outside
<re_irc> > --> src/spi.rs:108:9
<re_irc> > 108 | pub use spi_transaction_helper as transaction_helper;
<re_irc> > |
neceve has quit [Client Quit]
neceve has joined #rust-embedded
starblue has joined #rust-embedded
neceve has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
neceve has joined #rust-embedded
<re_irc> <alvela> Anyone have any suggestions for how to manage ownership of a variable which needs use by both application and driver code?
<re_irc> There's a delay variable used by this LCD driver I'm hacking on and it takes ownership of it, preventing me from using it directly in application code
<re_irc> <alvela> I considered passing it as a mut reference to all the functions which need it (not the most elegant) but am prevented from doing so due to a function which uses the delay adhering to a trait
<re_irc> <newam> if your delay variable can be expressed as an integer and you're on a platform with atomic that can work
<re_irc> <newam> * atomics
<re_irc> <alvela> Mind elaborating on what you mean by atomics? For more context, the delay I'm using is "cortex_m::delay::Delay" and the library uses "embedded_hal::blocking::delay::DelayMs"
<re_irc> <newam> Are you trying to pass around a mutable struct that implements delay ("cortex_m::delay::Delay") or the duration the delay consumes ("embedded_hal::blocking::delay::DelayMs")?
<re_irc> <alvela> The struct itself
<re_irc> <alvela> My initial question is on good software patterns. Can change on either side of app/library if there's a better approach
<re_irc> <newam> Ahhh, yeah that's more difficult :S
<re_irc> Generally I rely on the RTOS to provide a delay function.
<re_irc> <alvela> Maybe it's time I finally work on some RTIC stuff haha
<re_irc> <alvela> I was just mostly annoyed that I can't use the delay after initializing the driver
<re_irc> <GrantM11235> Can you just create a new delay struct?
<re_irc> <alvela> I don't believe so, the delay takes ownership of the system timer
<re_irc> <newam> There's also this if you want a quick hack: https://docs.rs/cortex-m/0.7.6/cortex_m/asm/fn.delay.html
<re_irc> <GrantM11235> That doesn't implement the delay trait though
<re_irc> <newam> No, but you could make a new type that does implement delay with that function as the backend
<re_irc> <GrantM11235> You could also create a newtype for the cortex-m delay struct that impls the delay traits for "&mut MyNewType" as well
<re_irc> Wouldn't work for concurrent delays without extra logic though
<re_irc> <newam> since it modifies the systick registers each time it gets called
<re_irc> <alvela> Will consider these approaches, thanks! I think I may hold off on changing anything until I get a better picture of what's most "ergonomic" when working with an RTOS
<re_irc> <GrantM11235> This would be super easy with embassy btw
<re_irc> <newam> https://arewertosyet.com/
<re_irc> ^ shameless plug
<re_irc> <alvela> I've been off and on following James' MnemOS dev on twitter. Cool to see all the work different folks are doing in this space
<re_irc> <GrantM11235> Does your display driver _need_ to take ownership of a delay struct? The display driver that I used only needed to borrow the delay struct during initialization. You could try patching your display driver to do the same
<re_irc> <alvela> Fair point. I hadn't considered that. Only one way to find out 🤷
<re_irc> I know it does for init for sure, but there's some delays after data transfers (to I2C backpack) sprinkled in
<re_irc> <alvela> Only my third or so foray into reading datasheets, so it's been pretty easy to get lost....esp w/ the extra i2c backpack in the mix
<re_irc> <adamgreig> newam: man, the "issues" badge goes green if there's 0 open? that's the first time i've seen it :D
starblue has quit [Ping timeout: 244 seconds]
starblue has joined #rust-embedded
dc740 has quit [Remote host closed the connection]
dc740 has joined #rust-embedded
dc740 has quit [Remote host closed the connection]