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
bpye has quit [Quit: Ping timeout (120 seconds)]
bpye has joined #rust-embedded
ego_undefined has joined #rust-embedded
ego_undefined has quit [Changing host]
ego_undefined has joined #rust-embedded
ego_undefined has quit [Remote host closed the connection]
GolfMike has joined #rust-embedded
GolfMike has quit [Client Quit]
majors has quit [Quit: ZNC 1.8.2+deb2ubuntu0.1 - https://znc.in]
majors has joined #rust-embedded
majors has quit [Client Quit]
majors has joined #rust-embedded
pbsds3 has quit [Quit: The Lounge - https://thelounge.chat]
pbsds3 has joined #rust-embedded
emerent has quit [Ping timeout: 252 seconds]
emerent has joined #rust-embedded
Makarov has joined #rust-embedded
Makarov has quit [Quit: Client closed]
Makarov has joined #rust-embedded
M9names[m] has quit [Quit: Idle timeout reached: 172800s]
yruama_lairba[m] has quit [Quit: Idle timeout reached: 172800s]
mameluc[m] has quit [Quit: Idle timeout reached: 172800s]
<JamesMunns[m]> btw, new podcast episode, this one about Frame Synchronization, which covers a lot of common mistakes I see when people try to set up their own communication protocols over UARTs and such :)
<JamesMunns[m]> * [Episode Page](https://sdr-podcast.com/episodes/frame-sync/)
<JamesMunns[m]> * [YouTube](https://www.youtube.com/watch?v=KTrVpgw82Gg)
dngrs[m] has joined #rust-embedded
<dngrs[m]> so what's the go-to solution in 2024 when I don't want to go crazy writing a crate that should do either log or defmt logging? I remember some macros by ?dirbaio? ... other approaches?
<diondokter[m]> Pretty much every embassy crate has a file like this: https://github.com/embassy-rs/embassy/blob/main/embassy-executor/src/fmt.rs
<diondokter[m]> I used to hate it, but now with #[collapse_debuginfo(yes)] added it's pretty nice :P
<dngrs[m]> <omani[m]> "anybody know of mpsc or channels..." <- https://github.com/hawkw/thingbuf might be worth checking out
<dngrs[m]> diondokter[m]: TIL đź‘€
<dngrs[m]> I wonder if this can be turned into a crate? copy paste is annoying :|
<diondokter[m]> I think it could. One downside though is that your logging has to be the subset of normal formatting and defmt
<dngrs[m]> tradeoffs be tradeoffin
<diondokter[m]> I once tried adding non-defmt logs to defmt. I think that's the best route.
<diondokter[m]> Didn't have time then to finish it
<dngrs[m]> well I'll click this friendly subscribe button and just wait for things to manifest
Makarov58 has joined #rust-embedded
Makarov has quit [Ping timeout: 256 seconds]
Foxyloxy has quit [Quit: Textual IRC Client: www.textualapp.com]
Makarov16 has joined #rust-embedded
Makarov58 has quit [Ping timeout: 256 seconds]
Makarov78 has joined #rust-embedded
Makarov86 has joined #rust-embedded
Makarov16 has quit [Ping timeout: 256 seconds]
Makarov78 has quit [Ping timeout: 256 seconds]
Makarov6 has joined #rust-embedded
Makarov86 has quit [Ping timeout: 256 seconds]
<omani[m]> <dngrs[m]> "https://github.com/hawkw/..."; <- thanks. will try this one.
Makarov6 has quit [Ping timeout: 256 seconds]
Foxyloxy has joined #rust-embedded
kriszd[m] has quit [Quit: Idle timeout reached: 172800s]
Makarov6 has joined #rust-embedded
i509vcb[m] has quit [Quit: Idle timeout reached: 172800s]
FreeKill[m] has quit [Quit: Idle timeout reached: 172800s]
Artea has quit [Quit: ZNC 1.8.2 - https://znc.in]
AlexKlemenchuk[m has joined #rust-embedded
<AlexKlemenchuk[m> So I'm trying to use: fdti-embedded-hal and write a function which takes any SpiDevice and writes to it (fdti-embedded-hal 0.22.0, embedded-hal: 1.0.0):... (full message at <https://catircservices.org/_irc/v1/media/download/ARxwLlt1Igu8ewEs0NQH5vVCFAQfMrE2wh246FkiIwWBoChC3asgGToVSAU1mUNjazidbmiUA86Fm80lS4q6qddCeScmucAwAGNhdGlyY3NlcnZpY2VzLm9yZy9XYUVNelJvcFJYVlVYTVRjUlFJSnNmT2U>)
<AlexKlemenchuk[m> * So I'm trying to use: fdti-embedded-hal and write a function which takes any SpiDevice and writes to it (fdti-embedded-hal 0.22.0, embedded-hal: 1.0.0):... (full message at <https://catircservices.org/_irc/v1/media/download/ASh43yiASxojlxjD4Wg3IyUzxqpTWByh-RTq89tcWOsgX-RJgKyU_qbLOY90RT22hXRnRREnJmKzhY4_RFuJjepCeScnBeJgAGNhdGlyY3NlcnZpY2VzLm9yZy9UcVZBWVZJbXh0Rm54ZVhRWEpYRUJOdU0>)
<AlexKlemenchuk[m> * So I'm trying to use: fdti-embedded-hal and write a function which takes any SpiDevice and writes to it (fdti-embedded-hal 0.22.0, embedded-hal: 1.0.0):... (full message at <https://catircservices.org/_irc/v1/media/download/ASrByzuLtgT3oVNHHbI1Fjz25gndD3MPo2OuXTCUDaV-qebB8MCjzgnwxSsDL8Gc290xuA3TaKxhYbRHoCtCnGpCeScnhadAAGNhdGlyY3NlcnZpY2VzLm9yZy9kbElNUG1UZ0NYQmJFdUlmSlVjUlJLcVc>)
i509vcb[m] has joined #rust-embedded
<i509vcb[m]> <AlexKlemenchuk[m> "So I'm trying to use: fdti-..." <- > <@alextechcc:matrix.org> So I'm trying to use: fdti-embedded-hal and write a function which takes any SpiDevice and writes to it (fdti-embedded-hal 0.22.0, embedded-hal: 1.0.0):... (full message at
<AlexKlemenchuk[m> i509vcb[m]: Sorry, I don't understand, do you see this library write this line somewhere?
Makarov74 has joined #rust-embedded
Makarov6 has quit [Ping timeout: 256 seconds]
<i509vcb[m]> <AlexKlemenchuk[m> "Sorry, I don't understand, do..." <- https://docs.rs/embedded-hal/1.0.0/embedded_hal/spi/trait.SpiDevice.html#impl-SpiDevice%3CWord%3E-for-%26mut+T
<i509vcb[m]> You should just be able to take a S
<i509vcb[m]> And rely on the caller to borrow as needed to not give ownership to your function
Makarov74 has quit [Quit: Client closed]
Makarov74 has joined #rust-embedded
<AlexKlemenchuk[m> I cloned the library, removed the "&'a" in the `for &'a SpiDevice` and it works as expected.
<AlexKlemenchuk[m> * removed the `"&'a", * "&'a"` in
<AlexKlemenchuk[m> * I cloned the library, removed the `"&'a"` in the `for &'a SpiDevice` and it works as expected.
<AlexKlemenchuk[m> I don't understand if what I did is bad, or why the library authors did it the way they did.
<AlexKlemenchuk[m> * I cloned the library, removed the `"&'a"` in the `for &'a SpiDevice` and it works as expected.
<AlexKlemenchuk[m> I don't understand if/why what I did is bad, or why the library authors did it the way they did.
<dirbaio[m]> yeah I don't get it either, ftdi-embedded-hal should impl the trait for `SpiDevice` not `&SpiDevice`
<AlexKlemenchuk[m> Alright, I consider that a +1 to create an issue :). Wanted to avoid pestering developers after I accidentally complained about spidev-rust not implementing embedded-hal when linux-embedded-hal exists.
<dirbaio[m]> (if it's to allow some kind of sharing it could *also* impl it for `&SpiDevice`, but it's weird to *only* impl it for `&`)
<i509vcb[m]> oh okay this doesn't use embedded-hal
<AlexKlemenchuk[m> It does use embedded-hal.
nadja has quit [Read error: Connection reset by peer]
nadja has joined #rust-embedded
JamesMunns[m] has quit [Ping timeout: 248 seconds]
JamesMunns[m] has joined #rust-embedded
jessebraham[m] has quit [Ping timeout: 252 seconds]
omani[m] has quit [Ping timeout: 248 seconds]
jessebraham[m] has joined #rust-embedded
omani[m] has joined #rust-embedded
<omani[m]> <dngrs[m]> "https://github.com/hawkw/..."; <- unfortunately this lib requires alloc:sync which is gated behind `ptr`.
<omani[m]> afaik the risc target has no atomic pointers? anyone knows?
<omani[m]> * anyone knows? and I cant use portable-atomics I guess.
<omani[m]> any idea what I can do here?
<omani[m]> * anyone knows? and I cant use portable-atomics I guess. <- or this has nothing to do with it!?!
<omani[m]> oh got it. The ESP32-C3 lacks support for pointer-sized atomic operations..
<omani[m]> hence why I cant use alloc::sync.
<omani[m]> specifically, imc. imac would. but you guys probably know this :)
<omani[m]> * atomic operations..it's a hardware limitation.
<dngrs[m]> <omani[m]> "unfortunately this lib requires..." <- the README explicitly mentions a `no_alloc` scenario so that's ... unexpected?
Makarov74 has quit [Quit: Client closed]
<omani[m]> <dngrs[m]> "the README explicitly mentions a..." <- `If you can’t allocate or you need to build with #![no_std] because you’re working on embedded systems or other bare-metal software. Thingbuf provides a statically-allocated MPSC channel and a statically-allocated lock-free queue. These can be placed in a static initializer and used without requiring any runtime allocations.`
<omani[m]> s/`/readme: "/, s/.`/."/
<omani[m]> * > If you can’t allocate or you need to build with #![no_std] because you’re working on embedded systems or other bare-metal software. Thingbuf provides a statically-allocated MPSC channel and a statically-allocated lock-free queue. These can be placed in a static initializer and used without requiring any runtime allocations.
<omani[m]> readme
<omani[m]> and I used the static channel. which needs alloc crate. which uses alloc::sync, etc.
<omani[m]> I guess they didnt think about edge cases.
<omani[m]> I'll stick to `heapless::mpmc` which just works fine.
<dngrs[m]> <omani[m]> "and I used the static channel..." <- > <@omani:matrix.org> and I used the static channel. which needs alloc crate. which uses alloc::sync, etc.... (full message at <https://catircservices.org/_irc/v1/media/download/AX9-GOEOkHG7m_tYZO584sUcypNMDLqutu6Ktl7s7phBjxcUMvKZ_L6LkdqTi2u8Pgpfk64CnJKXfvC7PU9tpmJCeScv0lmwAGNhdGlyY3NlcnZpY2VzLm9yZy9GbFFxREJOc21aREhQSE1tQVVBV1V1cU4>)
<dngrs[m]> thingbuf = { version = "0.1.6", default-features = false, features = ["static"] }
<dngrs[m]> * no it doesn't
<dngrs[m]> (but it does need atomics) (and compare_exchange)
<dngrs[m]> <omani[m]> "oh got it. The ESP32-C3 lacks..." <- that's the actual issue, it doesn't have anything to do with `alloc::`
<omani[m]> <dngrs[m]> "that's the actual issue, it..." <- gotya
<omani[m]> * gotcha
roklobsta[m] has quit [Quit: Idle timeout reached: 172800s]
danielb[m] has quit [Quit: Idle timeout reached: 172800s]
huayra1[m] has quit [Quit: Idle timeout reached: 172800s]