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
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
starblue1 has joined #rust-embedded
duderonomy has joined #rust-embedded
starblue1 has quit [Ping timeout: 258 seconds]
<re_irc> <@u5282:matrix.org> Finally a real Rust room. Btw. Rusty and Rust are different things?
<re_irc> <@k900:conduit.0upti.me> ^ pretty sure this is either a bot or a person _severely_ struggling with a language barrier
<re_irc> <@u5282:matrix.org> K900: Nope
<re_irc> <@k900:conduit.0upti.me> So the nonsense you posted in #rust:matrix.org (https://matrix.to/#/#rust:matrix.org) was intentional?
<re_irc> <@u5282:matrix.org> I was asking Rust OT room and you banned
<re_irc> <@u5282:matrix.org> It is not my fault
<re_irc> <@k900:conduit.0upti.me> I am sorry then, because there's definitely some sort of communication issue there
<re_irc> <@k900:conduit.0upti.me> I still have no idea what your first messages meant
<re_irc> <@u5282:matrix.org> K900: Sure it looks like
<re_irc> <@k900:conduit.0upti.me> Anyway, I've unbanned you in #rust:matrix.org (https://matrix.to/#/#rust:matrix.org) and there's an off-topic room at #rust-off-topic:computer.surgery (https://matrix.to/#/#rust-off-topic:computer.surgery)
<re_irc> <@u5282:matrix.org> K900: Thanks
<re_irc> <@k900:conduit.0upti.me> And please don't post extremely confusing things again
<re_irc> <@u5282:matrix.org> Yes... I must remember I'm the only smart one here.
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sigmaris has quit [Server closed connection]
sigmaris has joined #rust-embedded
kenny has quit [Quit: WeeChat 3.8]
kenny has joined #rust-embedded
<re_irc> <@explodingwaffle101:matrix.org> any matrix-heads in here? all the messages on my phone (element ios app) are showing up as red, as if i'd been mentioned, but it's not that. everything is is good encryption wise i think (it wasn't, but now it is). not a big deal just annoying and a bit weird
<re_irc> <@Ablu:matrix.org> : I got no issues like that.
<re_irc> <@jamesmunns:beeper.com> : Maybe check your notification settings for the room? I think you might be able to set it to notify on ALL messages, or only @ pings, maybe it got swapped over at some point for you?
<re_irc> <@jamesmunns:beeper.com> At least on the web app, you click "settings" for the room, then "notifications", and I have mine set for "at mentions and keywords", but there is a "all messages" option.
<re_irc> <@jamesmunns:beeper.com> * an
<re_irc> <@explodingwaffle101:matrix.org> i like getting the notifications so i have that on. it never used to make things red, maybe they’ve changed it
<re_irc> it’s fine on desktop as well
<re_irc> <@explodingwaffle101:matrix.org> i did just turn it off before that message and it didn’t change anything either
<re_irc> <@jamesmunns:beeper.com> Gotcha! That's the only idea I had, sorry :/
<re_irc> <@explodingwaffle101:matrix.org> it certainly is a chat app, isn’t it x)
<re_irc> <@jamesmunns:beeper.com> You're very brave for getting notifs for every message, this is a pretty high traffic room :D
<re_irc> <@explodingwaffle101:matrix.org> makes me look busier :D
<re_irc> <@juliand:fehler-in-der-matrix.de> the red messages are a bug imo, I got this from time to time on android, as well... But I guess writing a bug report is kinda useless as they are working on new apps now anyway :/
IlPalazzo-ojiisa has joined #rust-embedded
<re_irc> <@firefrommoonlight:matrix.org> Does anyone know if it's possible to use nalgebra/ndarray etc on embedded to, say, create a NxM array, and do things like transpose and take its inverse? Thank you
emerent has quit [Ping timeout: 240 seconds]
emerent has joined #rust-embedded
<re_irc> <@ilpalazzo-ojiisan:matrix.org> : It ought to. It's possible to use "nalgebra" such that it doesn't depend on "std".
<re_irc> <@ilpalazzo-ojiisan:matrix.org> Still, I think that giving it a try will be by far the quickest way for you to check.
<re_irc> <@firefrommoonlight:matrix.org> Thank you
<re_irc> <@firefrommoonlight:matrix.org> I had no luck with teh docs
<re_irc> <@firefrommoonlight:matrix.org> will check GH examples
<re_irc> <@firefrommoonlight:matrix.org> So far, it seems its either low-val matrix fixed-size constructors, or allocator DMatrixes for nalgebra
<re_irc> <@ilpalazzo-ojiisan:matrix.org> https://github.com/dimforge/nalgebra/blob/dev/Cargo.toml#L24
<re_irc> <@ilpalazzo-ojiisan:matrix.org> Apparently, although multiplying matrices needs an allocator, none of the other common operations do.
<re_irc> <@firefrommoonlight:matrix.org> Thanks
<re_irc> <@firefrommoonlight:matrix.org> I'll give ndarray a shot
<re_irc> <@firefrommoonlight:matrix.org> Or experiment with nalgebra to see if there's a away around it
<re_irc> <@dirbaio:matrix.org> why would matmul require alloc? 😭
<re_irc> <@firefrommoonlight:matrix.org> I'm implementing a least-squares ellipse algo, and found a good Python code base, but am not sure how to translate a certain part of it. (Which needs a large, asymetric matrix, and inverse on it)
<re_irc> <@firefrommoonlight:matrix.org> * ellipsoid
<re_irc> <@firefrommoonlight:matrix.org> Alternatively, if anyone knows of any good magnetometer cal algos in rust...
<re_irc> <@ilpalazzo-ojiisan:matrix.org> : Because const generics in Rust are not yet advanced enough to implement a function like
<re_irc> fn multiply_arrays<const N: usize, const M: usize>(x: [T; N], y: [T; M]) -> [T; N*M]
<re_irc> ```.
<re_irc> <@ilpalazzo-ojiisan:matrix.org> * ```
<re_irc> <@ilpalazzo-ojiisan:matrix.org> -```
<re_irc> <@dirbaio:matrix.org> :(
<re_irc> <@dirbaio:matrix.org> you can totally do this though
<re_irc> "fn matmul<const N: usize, const M: usize, const P: usize>(x: [[T; N]; M], y: [[T; M];P]) -> [[T; N]; P]"
<re_irc> <@ilpalazzo-ojiisan:matrix.org> Wait, you're right.
<re_irc> <@ilpalazzo-ojiisan:matrix.org> Hum.
<re_irc> <@firefrommoonlight:matrix.org> There is hope!
<re_irc> <@dirbaio:matrix.org> maybe they don't for ergonomics
<re_irc> <@dirbaio:matrix.org> * ergonomics?
<re_irc> <@dirbaio:matrix.org> because so many const-generics gets annoyingfast
<re_irc> <@dirbaio:matrix.org> * annoying fast
<re_irc> <@firefrommoonlight:matrix.org> For this use, IDK
<re_irc> <@firefrommoonlight:matrix.org> It's a few lines of numpy code, and it's nto a huge deal if it turns into a syntax mess
<re_irc> <@dirbaio:matrix.org> and in non-embedded you can simply yolo-alloc everything 🤪
<re_irc> <@ilpalazzo-ojiisan:matrix.org> Oh!
<re_irc> <@firefrommoonlight:matrix.org> Trying to learn the API now
<re_irc> <@ilpalazzo-ojiisan:matrix.org> "matrixmultiply" is a separate crate,
<re_irc> <@firefrommoonlight:matrix.org> For this use, IDC
<re_irc> <@firefrommoonlight:matrix.org> yea
<re_irc> <@ilpalazzo-ojiisan:matrix.org> and it's meant for "f32" and "f64" matrices.
<re_irc> <@firefrommoonlight:matrix.org> Would probably be an easy translation in non-embedded rust
<re_irc> <@firefrommoonlight:matrix.org> The main computational issue here is the inverse
<re_irc> <@firefrommoonlight:matrix.org> I wonder how that fairs
<re_irc> <@ilpalazzo-ojiisan:matrix.org> So integers are _probably_ fine, I guess?
<re_irc> <@firefrommoonlight:matrix.org> f32 here
<re_irc> <@ilpalazzo-ojiisan:matrix.org> That said, you can't really invert a matrix without floating-point,.
<re_irc> <@ilpalazzo-ojiisan:matrix.org> * floating-point.
<re_irc> <@dirbaio:matrix.org> why doesn't serde allow this? it's stupid
<re_irc> resource: u32,
<re_irc> #[serde(default = 42)]
<re_irc> <@dirbaio:matrix.org> you have to amke a dummy funciton instead :(
<re_irc> <@firefrommoonlight:matrix.org> For this particular use, I could probably do some hacky stuff to sidestep this, but my intuition says fitting an ellipsoid is the answer, and I found the numpy code to do it
<re_irc> <@firefrommoonlight:matrix.org> * estimatinos
<re_irc> <@firefrommoonlight:matrix.org> I wonder if anyone else in Rust has tackled this, since mags are a fairly common sensor
<re_irc> <@fuse117:matrix.org> I have a struct Foo with member Bar. Bar uses externally managed rx and tx buffers. It needs references passed to its constructor. I am not sure how to best create such buffers in Foo's constructor such that they have the required lifetime. What is the idiomatic way to do this in Rust?
<re_irc> <@dirbaio:matrix.org> you want to have "Foo" contain both the buffers, and the "Bar" which borrows the buffers?
<re_irc> <@dirbaio:matrix.org> that's a self-referential struct
<re_irc> <@dirbaio:matrix.org> it's generally not possible
<re_irc> <@dirbaio:matrix.org> (you can do it with lots of cursed caveats, for example with Pin and lots of unsafe, or there's some crates specially for that)
<re_irc> <@dirbaio:matrix.org> (but it's so cursed I would recommend not trying)
<re_irc> <@dirbaio:matrix.org> either make "Foo" borrow the buffers, or if you only ever construct one statically-allocate them with "StaticCell"
<re_irc> <@dirbaio:matrix.org> or Box::leak if you're OK with alloc
<re_irc> <@fuse117:matrix.org> one should only ever be created. Foo is effectively a BSP, so it should be a singleton
<re_irc> <@dirbaio:matrix.org> or "static mut" and unsafe
<re_irc> <@fuse117:matrix.org> "static mut" and "unsafe" is the approach i have used before. i
<re_irc> <@dirbaio:matrix.org> "StaticCell" is a no-unsafe alternative to "static mut" https://docs.rs/static_cell/latest/static_cell/
<re_irc> at the cost of using 1 "bool" of extra RAM
<re_irc> <@dirbaio:matrix.org> "make_static!" is especially handy but it requires nightly
<re_irc> <@dirbaio:matrix.org> "make_static!([0u8; 1024])" -> returns a "&'static mut [u8; 1024]"
<re_irc> <@jamesmunns:beeper.com> There's also "cortex-m::singleton!()", which seems to do the same thing, but doesn't require nightly?
<re_irc> <@jamesmunns:beeper.com> (I see TAIT mentioned, so it probably matters for futures and such, but for simple buffers like that, singleton! will work too)
<re_irc> <@dirbaio:matrix.org> yeah
<re_irc> <@dirbaio:matrix.org> "make_static!" is the same as singleton except you don't have to write the type (that's what it needs TAIT for)
<re_irc> <@jamesmunns:beeper.com> ahhh
<re_irc> <@dirbaio:matrix.org> writing the type can get annoying if you have generic dumpster fires going on
<re_irc> <@jamesmunns:beeper.com> Yeah, makes sense for ergonomics (and futures and stuff where you can't name the type)
<re_irc> <@fuse117:matrix.org> "StaticCell" seems to work well. Will continue to play with it.
Foxyloxy_ has joined #rust-embedded
Foxyloxy has quit [Ping timeout: 240 seconds]
duderonomy has joined #rust-embedded
stephe has quit [Server closed connection]
stephe has joined #rust-embedded
starblue1 has joined #rust-embedded
IlPalazzo-ojiisa has quit [Remote host closed the connection]
dc740 has joined #rust-embedded
stephe has quit [Read error: Connection reset by peer]
stephe has joined #rust-embedded
emerent has quit [Remote host closed the connection]
emerent has joined #rust-embedded
zagura has quit [Server closed connection]
zagura has joined #rust-embedded
<re_irc> <@fuse117:matrix.org> design question. i am working on an nrf9160 and using nrf-modem. is it good practice to configure nrf-modem IRQs and initialize the package inside the BSP package?
<re_irc> <@fuse117:matrix.org> * package i am developing for my board?
<re_irc> <@fuse117:matrix.org> * nrf-modem
<re_irc> <@diondokter:matrix.org> fuse117: Doesn't really matter IMO as long as they get set and it's documented
<re_irc> <@diondokter:matrix.org> Cool to see more people use it 😀
<re_irc> If you notice any bugs, please open an issue!
starblue1 has quit [Ping timeout: 240 seconds]
dc740 has quit [Remote host closed the connection]
tafama has quit [Server closed connection]
tafa has joined #rust-embedded
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]