causal has quit [Read error: Connection reset by peer]
causal_ has joined #rust-embedded
causal_ has quit [Quit: WeeChat 3.5]
limpkin has quit [Ping timeout: 256 seconds]
rektide_ has quit [Ping timeout: 256 seconds]
limpkin has joined #rust-embedded
rektide has joined #rust-embedded
starblue1 has quit [Ping timeout: 268 seconds]
starblue1 has joined #rust-embedded
crabbedhaloablut has quit [Ping timeout: 268 seconds]
crabbedhaloablut has joined #rust-embedded
cr1901 has quit [Ping timeout: 272 seconds]
cr1901 has joined #rust-embedded
explore has quit [Quit: Connection closed for inactivity]
rardiol has quit [Ping timeout: 268 seconds]
explore has joined #rust-embedded
<re_irc>
<James Logan> chrysn: the only way I've found to guarantee that a crate is really no-std compatible (and stays that way) is to add a separate no-std test crate and build that test crate for a target with no OS as part of testing, and require passing tests to merge to main
<re_irc>
<James Logan> note that example uses LTO in order to also check panic-never compatibility, but you may not want that for testing no-std compatibility as thoroughly as possible
<re_irc>
<James Logan> ^ (uses LTO because otherwise panic branches do not get optimized out, and compilation will always fail with panic-never)
<re_irc>
<chrysn (@chrysn:matrix.org)> Nice, thanks, I'll use that!
* re_irc
chrysn (@chrysn:matrix.org) reads on what catnip is ... cool: no-std, heapless, minimal ... oh, physically-secured, that's not something I can rely on, making this nice-to-exist but not-for-my-applications.
<re_irc>
<James Logan> yeh it's sort of a personal experiment, because I didn't want to use a giant software stack for running a daq on a local network
<re_irc>
<James Logan> and I'm a complete newb w.r.t. networking so I'm not making any claims about security
<re_irc>
<chrysn (@chrysn:matrix.org)> Hm, the whole trick still does depend on having a platform for which we know that there is no std library for it, right?
<re_irc>
<James Logan> yeah which is where the "none" for the target comes in - no OS -> no std
<re_irc>
<James Logan> so all that test crate is going to do is show that it can be compiled for a platform that could not possibly have the standard library
<re_irc>
<chrysn (@chrysn:matrix.org)> Fair enough. I kept being worried that they add std to platoforms where it makes no sense at all (IMO wasm32-unknown-unknown should not have a std library), but given that "unknown" != "none", hopefully that'd be safe.
<re_irc>
<James Logan> yeah that example crate also specified #[no_std]
<re_irc>
<James Logan> you can also specify #[no_std] in a library, and crates that depend on that library can either have or not have std and it doesn't break them
<re_irc>
<chrysn (@chrysn:matrix.org)> Hm ... if I do rely on a platform not having a std for sure, I can probably just build the main library crate for that platform, with no need for an extra test crate (because I don't do the panic-never tests).
<re_irc>
<James Logan> could do, as long as you have a way to actually run it
<re_irc>
<James Logan> which is sort of the hangup
<re_irc>
<chrysn (@chrysn:matrix.org)> I just want to prove that it builds under forced no_std -- I don't see how it should build and then not run.
explore has quit [Quit: Connection closed for inactivity]
crabbedhaloablut has quit [Remote host closed the connection]
crabbedhaloablut has joined #rust-embedded
crabbedhaloablut has quit [Remote host closed the connection]
crabbedhaloablut has joined #rust-embedded
causal has joined #rust-embedded
<re_irc>
<explodingwaffle101> been writing / procrastinating writing an i2c device driver, wondering if there is a better way to deal with registers and their fields. https://github.com/tkeksa/lis2dh12/blob/master/src/lib.rs#L633 started off by using the methods from here, which is nicer than the bare e-h methods but still requires a load of const bitmasks, and still not great for dealing with anything that isn't just a true/false. went...
<re_irc>
... looking for other solutioms- found packed_struct, bounded-registers, i2c-reg, but not really a fan of any of them. been wondering- would a macro to generate an api sort of like the one svd2rust makes for pacs be a good way to go about it? might be overcomplicating this, i dunno