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
IlPalazzo-ojiisa has quit [Quit: Leaving.]
IlPalazzo-ojiisa has joined #rust-embedded
IlPalazzo-ojiisa has quit [Client Quit]
wes_ has quit [Remote host closed the connection]
wes_ has joined #rust-embedded
<wes_> exit
wes_ has quit [Quit: WeeChat 2.8]
starblue has quit [Ping timeout: 268 seconds]
starblue has joined #rust-embedded
Foxyloxy has quit [Read error: Connection reset by peer]
Foxyloxy has joined #rust-embedded
<re_irc> < (@burrbull:matrix.org)> : why so old svd-parser version in dependencies?
<re_irc> < (@762spr:matrix.org)> Got another noob question for you guys 💩...
<re_irc> In C I would do (sorry for formatting, on my phone now...)
<re_irc> Im reading a block of 512 bytes and need to extract a u32 address from that buffer.
<re_irc> Addr= 0x00 | buf[0] | buf[1] << 8 | buf[2] << 16 | buf[3] << 24
<re_irc> Pretty straight forward... but in rust it complains that the bytes in the array are u8 so I need to cast them by "as u32" which becomes kind of obnoxiously verbose... is there a more proper way to do this in rust or am I stuck with the "as" casts?
<re_irc> < (@762spr:matrix.org)> I guess this applies to any kind of forming bytes from smaller types or doing bitwise operations on them in general
<re_irc> < (@762spr:matrix.org)> Like masks and flags, etc.
<re_irc> < (@762spr:matrix.org)> Well now that's just TOO easy 😅
<re_irc> What about say or'ing flag bits. Should I just define those as the same type as the parent?
<re_irc> < (@762spr:matrix.org)> > https://docs.rs/bitflags/latest/bitflags/
<re_irc> Very interesting! Thank you for your help!
<re_irc> I am curious now though, what exactly the bitflags! Macro gains you? Is it just the traits and functions from bitflags crate?
<re_irc> In other words why not just make a regular struct of flag values and use them to or together a value? It seems their examples somewhat work this way.
<re_irc> I will dig deeper when I am not on my phone!
IlPalazzo-ojiisa has joined #rust-embedded
starblue has quit [Ping timeout: 268 seconds]
starblue has joined #rust-embedded
<re_irc> < (@chemicstry:matrix.org)> : It implements a bunch of functions for you: operators (and/or/xor/etc) and utility functions like set/clear/is_set/etc. I assume it could be done with a trait instead of a macro with not that much extra code, but never tried
<re_irc> < (@dirbaio:matrix.org)> : lots of breaking changes, and I didn't see anything in the newer ones I could benefit from. I didn't look very hard though. PR's welcome to update it.
<re_irc> < (@kaspar:schleiser.de)> hi everyone, I got a question, are <16 byte structs consisting of 4 u32s, or a tuble of 4 u32, returned in registers (r0-r3), on Cortex-M?
<re_irc> < (@kaspar:schleiser.de)> * tuple
<re_irc> < (@dirbaio:matrix.org)> https://godbolt.org/z/563roqb3K
<re_irc> < (@dirbaio:matrix.org)> interesting
<re_irc> < (@dirbaio:matrix.org)> seems like no with rust ABI, yes with C ABI
<re_irc> < (@kaspar:schleiser.de)> : here you're returning the sum (single u32).
<re_irc> < (@dirbaio:matrix.org)> ah, _returned_
<re_irc> < (@dirbaio:matrix.org)> sorry
<re_irc> < (@kaspar:schleiser.de)> I was meaning this, https://rust.godbolt.org/z/jWqMWoTen
<re_irc> < (@dirbaio:matrix.org)> I should read the q 😂
<re_irc> < (@kaspar:schleiser.de)> :)
<re_irc> < (@kaspar:schleiser.de)> thanks for the hint trying "extern "C"", but no change: https://rust.godbolt.org/z/bzfa49Prd
<re_irc> < (@kaspar:schleiser.de)> It does when going through u128: https://rust.godbolt.org/z/MrPshGY7x - and there I am again, looking at compiler output, thinking "it all happens for a reason" ...😀
vancz has quit []
vancz has joined #rust-embedded
vancz has quit [Client Quit]
vancz has joined #rust-embedded
dfgweb has joined #rust-embedded
<re_irc> <thejpster> sounds like something the ARM EABI would define.
<re_irc> <thejpster> Given the target is thumbv6m-none-eabi (or similar).
<re_irc> <thejpster> Specifically, the ARM Procedure Call Standard
<re_irc> < (@dirbaio:matrix.org)> I don't think the Rust ABI is guaranteed to follow the AAPCS. Only the C one.
DepthDeluxe has joined #rust-embedded
<re_irc> <thejpster> Interesting!
<re_irc> <Crylo (he/they)> wonder if anyone has had any luck running rust on the pinetime chip
<re_irc> < (@matoushybl:matrix.org)> The smartwatch?
<re_irc> <Crylo (he/they)> yep
<re_irc> <Crylo (he/they)> i would have better luck saying the nRF52832
<re_irc> < (@jamesmunns:beeper.com)> Crylo (he/they): I looked at it, but never bought one. I'm pretty sure you'd be able to get something going pretty well with embassy + embedded-graphics
<re_irc> < (@jamesmunns:beeper.com)> IIRC, the SPI display was using something fairly standard?
<re_irc> < (@jamesmunns:beeper.com)> Yeah, it's using a ST7789. I found https://github.com/almindor/st7789 (is that a pinetime in the screenshot?) that looks like it has been replaced by https://github.com/almindor/mipidsi
<re_irc> < (@jamesmunns:beeper.com)> https://github.com/almindor/st7789-examples
<re_irc> oh hey!
<re_irc> > ST7789 driver examples for use with the PineTime watch.
<re_irc> <Crylo (he/they)> i should pick one up
<re_irc> < (@jamesmunns:beeper.com)> So, the answer is has, at least :D
<re_irc> <Crylo (he/they)> : now i want to really get one and make a basic OS for it
<re_irc> < (@jamesmunns:beeper.com)> You might consider "embassy" a very basic OS (async scheduling, drivers, etc.), but I also won't try and convince you not to reinvent any wheels :)
<re_irc> < (@jamesmunns:beeper.com)> https://github.com/tstellanova/cst816s seems to be a touch screen driver, as well.
<re_irc> < (@762spr:matrix.org)> : Perfect, thanks for the explanation. I get confused sometimes with the overlap that macros can produce. Always learning! 🙃
<re_irc> < (@wucke13:matrix.org)> If an integration test needs a temporary directory, where would it make sense to create this? Somewhere in target, or rather somewhere in whatever the current OS considers the linux equivalent of "/tmp"?
<re_irc> < (@k900:0upti.me)> $TMPDIR?
<re_irc> < (@wucke13:matrix.org)> Yeah, that's exactly what I was looking for. Thank you!
DepthDeluxe has quit [Ping timeout: 260 seconds]
mightypork has quit [Ping timeout: 260 seconds]
DepthDeluxe has joined #rust-embedded
mightypork has joined #rust-embedded
IlPalazzo-ojiisa has quit [Quit: Leaving.]
<re_irc> < (@dirbaio:matrix.org)> PSA: everyone using "nrf-softdevice", update ASAP. There's a fix (https://github.com/embassy-rs/nrf-softdevice/commit/6f6d07bbf15a6eb48f47545dcbe653ce9775eca7) for a very embarrasing bug that caused the critical section impl to not disable all interrupts it should!
<re_irc> < (@adamgreig:matrix.org)> : you might also find something like https://crates.io/crates/tempfile useful