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 :)
<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?
<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>
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]>
* 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.