<re_irc>
<@dirbaio:matrix.org> TIL github actions already comes with rustup... so no `- uses: actions-rs/toolchain@v1` needed! You can choose the rust version with `rust-toolchain.toml`.
<re_irc>
<@adamgreig:matrix.org> huh
<re_irc>
<@adamgreig:matrix.org> which gha, ubuntu-20.04?
<re_irc>
<@dirbaio:matrix.org> not sure.. `runs-on: ubuntu-latest`
<re_irc>
<@adamgreig:matrix.org> ubuntu-latest currently maps to ubuntu-20.04
<re_irc>
<@adamgreig:matrix.org> idk why they even provide it... it seems like it would be a surprise nightmare for all your CI to suddenly change OS, lol
<re_irc>
<@dirbaio:matrix.org> Rustup 1.24.3
<re_irc>
<@dirbaio:matrix.org> right.. no idea 🤣
<re_irc>
<@adamgreig:matrix.org> i just use "ubuntu-20.04" now but didn't realise it already had rustc 1.53 and rustup
<re_irc>
<@adamgreig:matrix.org> will rustup go ahead and install a missing toolchain if rust-toolchain specifies it?
<re_irc>
<@adamgreig:matrix.org> I guess it's still kinda a pain if you want to test on a few specific versions like stable, nightly, msrv for the same crate?
<re_irc>
<@dirbaio:matrix.org> adamgreig: yep
<re_irc>
<@dirbaio:matrix.org> adamgreig: 🤷♂️ I guess you can set overrides with `rustup` from shell commands
<re_irc>
<@adamgreig:matrix.org> hmm, I think you can just use actions-rs/toolchain anyway
<re_irc>
<@adamgreig:matrix.org> just looked and in a recent GHA run, I asked for stable, and it noticed rustup and 1.53 were both already installed and no-op
<re_irc>
<@adamgreig:matrix.org> if you ask for some other target it can just install that, and you can put override:true on the toolchain action to make it use it for the rest of the run
<re_irc>
<@adamgreig:matrix.org> so maybe still the easiest way?
<re_irc>
<@dirbaio:matrix.org> otherwise it'll install what you tell it in the yaml, but then when you actually run cargo it'll install again the one in rust-toolchain.toml
dcz_ has joined #rust-embedded
<re_irc>
<@newam:matrix.org> Does anyone know of a compile time cfg macro to ensure features are exclusive?
<re_irc>
<@newam:matrix.org> I am looking for a way to make `--all-features` fail to compile as fast as possible for this:
<re_irc>
<@firefrommoonlight:matrix.org> Is this to catch errors where someone specifies multiple (exclusive) MCU-selection features?
<re_irc>
<@newam:matrix.org> Yeah, it will fail to compile if that happens, but only after some time and with a less-than-helpful message.
<re_irc>
<@firefrommoonlight:matrix.org> What's consuming the time? How about something at the top of lib.rs that makes sure you don't have more than one exclusive features set
<re_irc>
<@newam:matrix.org> > What's consuming the time?
<re_irc>
<@newam:matrix.org> Just actually compiling until it hits a duplicated symbol (there are other places in the crate that expose different APIs for different hardware).
<re_irc>
<@newam:matrix.org> Checking for an exclusive feature is what I want to do, just seeing if anyone else has made a convenience macro since it seems like it would be a common problem in the embedded space.
<re_irc>
<@firefrommoonlight:matrix.org> I just assume users will only use one! But I agree this would be useful
<re_irc>
<@firefrommoonlight:matrix.org> I'll use it once you've finished
<re_irc>
<@firefrommoonlight:matrix.org> I think some messy `cfg_if!` logic at the top of `lib.rs` would do the trick
<re_irc>
<@dirbaio:matrix.org> shame it grows like O(n^2)
fabic_ has quit [Ping timeout: 240 seconds]
<re_irc>
<@john_socha:matrix.org> I'm very new to embedded Rust. In my main.rs, I'm getting a warning "Can't find crate for test." This is in VSCode. Is there a way to suppress this message? I seem to remember seeing something somewhere, but haven't been able to find it with the searches I've tried.
<re_irc>
<@yatekii:matrix.org> does anyone know a way to make a proc_macro scope aware
<re_irc>
<@dkhayes117:matrix.org> john_socha: Maybe put `test=false` in the cargo.toml?
<re_irc>
<@john_socha:matrix.org> Nope. This seems to be an error from the Rust language server rather than the compiler. I don't see any warnings when I build--just in VSCode.
<re_irc>
<@adamgreig:matrix.org> are you using rust-analyzer?
<re_irc>
<@john_socha:matrix.org> I'm using the Rust 0.7.8 extension. Should I be using Rust-Analyzer instead?
<re_irc>
<@adamgreig:matrix.org> I think it's widely considered the best option for vscode users, https://rust-analyzer.github.io/
<re_irc>
<@john_socha:matrix.org> adamgreig: That's good to know. I chose based on download numbers as I didn't see anything in t he rust-analyzer help pages that explained how it might be better.
<re_irc>
<@john_socha:matrix.org> adamgreig: Perfect! That fixed it. And I learned that there is a better language server!
<re_irc>
<@dkhayes117:matrix.org> Oh yeah, I had that trouble in IntelliJ. I had to set build all targets to false in the settings.
tokomak has quit [Read error: Connection reset by peer]
<re_irc>
<@almindor:matrix.org> Rust analyzer is pretty good overall. Also for non embedded builds check out https://github.com/rui314/mold it improves linking speed considerably on x86
<re_irc>
<@yatekii:matrix.org> ^ nice!
<re_irc>
<@firefrommoonlight:matrix.org> Btw, if y'all haven't tried IntelliJ Rust plugin - it's phenomenal for code introspection, refactoring, highlighting errors etc
<re_irc>
<@firefrommoonlight:matrix.org> With a cost of a somewhat sluggish IDE
<re_irc>
<@thejpster:matrix.org> Does anyone fancy some super simple code reviews for an open source (GPL) Embedded Rust project?
<re_irc>
<@thejpster:matrix.org> I'm managing to muck things up without a second pair of eyes.
dcz_ has quit [Ping timeout: 256 seconds]
rjframe has joined #rust-embedded
rjframe has quit [Remote host closed the connection]
<re_irc>
<@yruama_lairba:matrix.org> Hi, can somone give several examples of lib to talk to a write only chip throught i2c or SPI ? i'd like to see if there is some convention when writing such lib
<re_irc>
<@yruama_lairba:matrix.org> i wander those thing because i found a hal for wm8731 and i find it not so much convenient. The main reason is because a "Register" need to be manually transformed (bit shift and bit masking) before being sended into a serial bus
Yruama has joined #rust-embedded
<Yruama>
some people here ?
<re_irc>
<@yruama_lairba:matrix.org> does the irc bridge work properly ?
<agg>
seems to be?
<re_irc>
<@yruama_lairba:matrix.org> "seems to be" to what ?
<Shell>
yes :p
<agg>
sorry, i mean, it seems to be working properly
<re_irc>
<@yruama_lairba:matrix.org> yes it work, but it doesn't work like the former freenode bridge
<agg>
yes, for various boring reasons it's not currently possible to use the same bridge as before
<re_irc>
<@yruama_lairba:matrix.org> can i have help into some reflexion ? i just want to confirm something
<re_irc>
<@yruama_lairba:matrix.org> if i understand correctly, inside a PAC, writing (not modifying) to a register is done throught a closure, because it's possible to read the register inside a closure ?
<re_irc>
<@adamgreig:matrix.org> with svd2rust pacs, the closure for writing is just an API design, it's not essential
<re_irc>
<@newam:matrix.org> > if i understand correctly, inside a PAC, writing (not modifying) to a register is done throught a closure, because it's possible to read the register inside a closure ?
<re_irc>
<@newam:matrix.org> The closure is a stylistic choice.
<re_irc>
<@newam:matrix.org> Though, svd2rust is the most ubiquitous because tock (and most others) require nightly.
<re_irc>
<@yruama_lairba:matrix.org> lol, i was expecting simpler answer
<re_irc>
<@yruama_lairba:matrix.org> i should explain more my mind, in fact i'm looking into a hal to control a codec, and the guy who did this seems to have stupidly immitaded svd2rust pacs
<re_irc>
<@newam:matrix.org> yruama_lairba: There can be valid reasons for doing this; one thing svd2rust is not great at is handling register arrays.
<re_irc>
<@thalesfragoso:matrix.org> newam: Not sure what svd4rust does different, but you can (manually) apply some transformation and it behaves really well when creating arrays
<re_irc>
<@thalesfragoso:matrix.org> I would think they are quite similar
<re_irc>
<@yruama_lairba:matrix.org> i'm not talking about tock
<re_irc>
<@thalesfragoso:matrix.org> But maybe Im talking non-sense, dirbaio should know better
<re_irc>
<@yruama_lairba:matrix.org> to be short, for the wm8731 chip, I think a much more simple and stupid but more conveninent API can be written
<re_irc>
<@yruama_lairba:matrix.org> maybe the guy use sv2rust for this chip ? i don't know if there is svd file for codecs
<re_irc>
<@adamgreig:matrix.org> svd2rust only generates stuff for memory mapped IO, so probably not
<re_irc>
<@yruama_lairba:matrix.org> this codec have registers with addresses
<re_irc>
<@adamgreig:matrix.org> yes, but you don't access it to writing to those addresses in your own chip's RAM, right?
<re_irc>
<@adamgreig:matrix.org> it goes over SPI or I2C etc?
<re_irc>
<@yruama_lairba:matrix.org> yes goes SPI or I2C (this chip can do both)
<re_irc>
<@adamgreig:matrix.org> svd2rust doesn't generate code that can use spi to access registers, only memory mapped IO (MMIO) where you directly write to (your own) memory
<re_irc>
<@adamgreig:matrix.org> so it is probably not made using svd2rust
<re_irc>
<@yruama_lairba:matrix.org> the crate don't manage SPI or I2C
<re_irc>
<@yruama_lairba:matrix.org> it just has function to generate address and data to write
<re_irc>
<@yatekii:matrix.org> am I weird because I like building proc_macros?
<re_irc>
<@yruama_lairba:matrix.org> it's only weird if what you do with proc_macro can be achieve in a simpler way
<re_irc>
<@yatekii:matrix.org> ofc not :P
<re_irc>
<@yruama_lairba:matrix.org> lol, i really don't understand why pacs use closure to write to a register