ryan-summers[m] has quit [Quit: Idle timeout reached: 172800s]
<BenPh[m]>
what would the usage be? `thing.....(???)`
<BenPh[m]>
i asume `thing` implements the `SpiDevice` trait. what is the shape of the argument? `& impl ???`, `embedded_hal::SpiCommandEnum::Foo(...)`?
<BenPh[m]>
is the context "im putting together something that implements `SpiDevice` and this is my struct specific method" or is the context more "making changes to the e-hal spi module"?
<diondokter[m]>
It'd be something like device.give_command(Foo)
mabez[m] has quit [Quit: Idle timeout reached: 172800s]
<BenPh[m]>
and device is a project specific implementor of e-hal SpiDecive trait, I'm assuming?
<diondokter[m]>
No, it uses the SpiDevice trait
<BenPh[m]>
...and Foo is a project-specific type?
<diondokter[m]>
Just a normal device driver
<diondokter[m]>
Yes
<diondokter[m]>
Also part of the device driver
pronvis has quit [Ping timeout: 260 seconds]
<BenPh[m]>
so under the hood, something, somewhere, implements the SpiDevice trait so that somewhere SpiDevice::write(...) is used using a buff loaded up by some sort of serialisation of Foo. Do I understand the context to a close enough level?
<BenPh[m]>
out of scope of your question, and perhaps a pathalogical approach for your use case, so appologies if it's doesn't fit: Perhaps consider command.send(device), where device is something that can send. Could be spi, could be a tx/rx channel, usb device, etc.
<BenPh[m]>
I hope that helps.
<diondokter[m]>
Thanks! Dispatch isn't bad.
<diondokter[m]>
BenPh[m]: I don't think this inversion would work well here
lulf[m] has quit [Quit: Idle timeout reached: 172800s]
pronvis has quit [Ping timeout: 240 seconds]
dirbaio[m] has quit [Quit: Idle timeout reached: 172800s]
pronvis has joined #rust-embedded
pronvis has quit [Remote host closed the connection]
pronvis has joined #rust-embedded
IlPalazzo-ojiisa has joined #rust-embedded
pronvis has quit [Remote host closed the connection]
pronvis has joined #rust-embedded
pronvis has quit [Ping timeout: 260 seconds]
eldruin[m] has quit [Quit: Idle timeout reached: 172800s]
pronvis has joined #rust-embedded
pronvis has quit [Ping timeout: 256 seconds]
dark[m] has quit [Quit: Idle timeout reached: 172800s]
pronvis has joined #rust-embedded
pronvis has quit [Ping timeout: 268 seconds]
pronvis has joined #rust-embedded
pronvis has quit [Ping timeout: 264 seconds]
pronvis has joined #rust-embedded
pronvis has quit [Ping timeout: 268 seconds]
pronvis has joined #rust-embedded
pronvis has quit [Ping timeout: 240 seconds]
pronvis has joined #rust-embedded
pronvis has quit [Ping timeout: 260 seconds]
pronvis has joined #rust-embedded
pronvis has quit [Ping timeout: 240 seconds]
pronvis has joined #rust-embedded
andar1an[m] has joined #rust-embedded
<andar1an[m]>
Has anyone bumped into any oss Rust projects to do with high pressure aeroponics using either arduino or raspberry pi for hobbiest use?
<andar1an[m]>
* arduino or some SBC like raspberry pi
Amit[m] has joined #rust-embedded
<Amit[m]>
diondokter: big ups on the optimize_for_size PR in libs! We're going to use it for Tock as soon as it lands in a nightly. Will be exciting to see it start getting used for real inside the core lib
<diondokter[m]>
Amit[m]: Thanks! Yes, tomorrow I think I'll submit two PRs that actually use the flag
<Amit[m]>
Curious if/how people are using `panic_immediate_abort` in bare-metal embedded scenarios. It's a big for size (~4kB compared to an empty panic handler in my brief experiments), but presumably something needs to handle the hard fault that inevitably might occur. Are you checking for this in, say, a hard fault ISR?
<Amit[m]>
(the relationship is that I learned about that from diondokter's PR referencing it :) )
<diondokter[m]>
Any panic will just become a `udf` instruction. So yeah, you'll likely want to do something with the hardfault handler.
<diondokter[m]>
But in production hopefully you already did that :P
<Amit[m]>
Sure, the expectation is a bit different with a normal panic handler handing explicit panics vs other sources of hard faults
<diondokter[m]>
Some of the binary size savings come from not having to generate the panic branches.
<diondokter[m]>
But a lot of it comes from not having to save the panic info (messages and file paths)
<Amit[m]>
Right, so in development settings, I care about having those for sure, and the use is much much larger than 4kB, but in production might be fine to just note the faulting context (e.g. dumping the PC and other registers to flash and restarting)
<diondokter[m]>
Yep, pretty much the same as with a panic really
<diondokter[m]>
Log and reboot
<diondokter[m]>
Though, apparently you can recover from many faults in cortex-m.
<diondokter[m]>
But ehh... you have to know what you're doing to make that work well
<Amit[m]>
diondokter[m]: If you wanted to get very very fancy and extremely expensive, you could use memory faults to emulate virtual memory in software. Which would be a fun demo if you wanted to turn a 20MHz CPU into a, in practice, ~2KHz CPU.
<JamesMunns[m]1>
Hey, I mean if esp-rs could use it for emulating atomics... :D
<JamesMunns[m]1>
<Amit[m]> "Right, so in development..." <- Yeah, I know dirbaio uses it in production, he logs to an in-mem ring buffer, so after panic+reboot it's still retrievable. you can save a HUGE amount using P-I-A, like 10-40% of the whole codesize of your program, depending on how many panics you and your deps have.
danielb[m] has joined #rust-embedded
<danielb[m]>
<JamesMunns[m]1> "Hey, I mean if esp-rs could..." <- not anymore
<JamesMunns[m]1>
yeah, I know :D
NickStevens[m] has quit [Quit: Idle timeout reached: 172800s]
dne has quit [Remote host closed the connection]
dne has joined #rust-embedded
pronvis has quit [Remote host closed the connection]
pronvis has joined #rust-embedded
pronvis has quit [Ping timeout: 260 seconds]
dngrs[m] has quit [Quit: Idle timeout reached: 172800s]