explore has quit [Quit: Connection closed for inactivity]
Socke has quit [Ping timeout: 248 seconds]
Socke has joined #rust-embedded
emerent has quit [Ping timeout: 260 seconds]
emerent has joined #rust-embedded
tokomak has joined #rust-embedded
ymwm has joined #rust-embedded
ymwm has quit [Max SendQ exceeded]
ymwm has joined #rust-embedded
ymwm has quit [Max SendQ exceeded]
ymwm has joined #rust-embedded
ymwm has quit [Max SendQ exceeded]
ymwm has joined #rust-embedded
ymwm has quit [Max SendQ exceeded]
ymwm has joined #rust-embedded
ymwm has quit [Max SendQ exceeded]
IsaacClayton[m] has quit [Quit: You have been kicked for being idle]
<re_irc>
<nihal.pasham> I'm using the "log" crate for some quick testing on the raspberry pi 4 (which I believe rpi4 has support for atomics). The "impl" is a copy-paste from the crate's documentation.
<re_irc>
<nihal.pasham> the thread-unsafe version (i.e. "set_logger_racy") works as expected. I wonder why the safe version does not work. My guess is - probably has something to do the MMU being disabled. I'm writing some bare-metal stuff that doesn't need the MMU.
<re_irc>
<chmanie> I mean it's weard, embedded_time is specifically targeting no_std, why would format! be in the docs
<re_irc>
<chmanie> * weird,
<re_irc>
<Martin> also in the super cool heapless crate you have a String type to allows you:
<re_irc>
let mut out: String<U256> = String::new();
<re_irc>
let my_var = Type::new()
<re_irc>
write!(&mut out, "{}", my_var).unwrap();
<re_irc>
<chmanie> Ah yeah I forgot about heapless!
<re_irc>
<chmanie> But I also just saw that there's an "integer()" method on the Rates
<re_irc>
<chmanie> Thanks Martin!
gsalazar has joined #rust-embedded
CheeksTheGeek has joined #rust-embedded
CheeksTheGeek has left #rust-embedded [#rust-embedded]
cyrozap has quit [Ping timeout: 260 seconds]
cyrozap has joined #rust-embedded
gsalazar has quit [Ping timeout: 240 seconds]
<re_irc>
<ryan-summers> Question: If you have an array of "[MaybeUninit<u8>; N]", is it sound to transmute that memory into an array of "[u8; N]" since all memory values are valid for "u8"?
<re_irc>
<ryan-summers> I essentially just want that uninitialized u8 array as a "&mut [u8]" slice so I can pass it to an external function. I don't have control to make that external function take "&mut [MaybeUninit<u8>]" instead
<re_irc>
<ryan-summers> I guess you can do "let array = uninit_array.map(|x| unsafe { x.assume_init() });" as well. Unsure if that compiles into any actual instructions
<re_irc>
<ryan-summers> Follow up: No, it's not valid to do, and I always forget this
tokomak has quit [Ping timeout: 268 seconds]
<re_irc>
<dngrs (spookyvision@github)> it sure is slightly irritating that you get nonsensical missing stdlib build errors when you just haven't done the required "rustup target add whatever-target-triple"
<re_irc>
<dngrs (spookyvision@github)> ryan-summers: hmm, I suppose because the compiler will be like "yeah this is invalid memory so I can do UB in any way I want" when you try to access it?
<re_irc>
<jamwaffles> They really meant min when "min_const_generics" was stabilised :((((
<re_irc>
Is there a way to do "let buf = [0u8; N / u8::BITS]" where "const N: usize" on stable rust?
<re_irc>
<jamwaffles> Hm that doesn't look too bad actually, thanks for the tip 🙂
<re_irc>
<dirbaio> it doesn't work if the user passes _another_ const generic to the macro, of course...
<re_irc>
<jamwaffles> I think I can get away with "PackedBuffer<const W: u32, const H: u32, const N: usize>" where "N = (W * H) / 8", no need for a fourth one (which was the cause of my original question). I suppose a macro would let me elide "N" but I'm doing an assertion to check the invariant anyway
<re_irc>
<dirbaio> fun
emerent has quit [Remote host closed the connection]