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
ivche_ has joined #rust-embedded
ivche has quit [Ping timeout: 260 seconds]
ivche_ is now known as ivche
sroemer has joined #rust-embedded
_catircservices1 has quit [Quit: Bridge terminating on SIGTERM]
Ralph[m] has quit [Quit: Bridge terminating on SIGTERM]
diondokter[m] has quit [Quit: Bridge terminating on SIGTERM]
M9names[m] has quit [Quit: Bridge terminating on SIGTERM]
JamesMunns[m] has quit [Quit: Bridge terminating on SIGTERM]
korbin[m] has quit [Quit: Bridge terminating on SIGTERM]
finga[m] has quit [Quit: Bridge terminating on SIGTERM]
wassasin[m] has quit [Quit: Bridge terminating on SIGTERM]
DominicFischer[m has quit [Quit: Bridge terminating on SIGTERM]
Koen[m] has quit [Quit: Bridge terminating on SIGTERM]
thejpster[m] has quit [Quit: Bridge terminating on SIGTERM]
RobinMueller[m] has quit [Quit: Bridge terminating on SIGTERM]
dngrs[m] has quit [Quit: Bridge terminating on SIGTERM]
dirbaio[m] has quit [Quit: Bridge terminating on SIGTERM]
jason-kairos[m] has quit [Quit: Bridge terminating on SIGTERM]
_catircservices has joined #rust-embedded
rainingmessages3 has joined #rust-embedded
rainingmessages has quit [Read error: Connection reset by peer]
rainingmessages3 is now known as rainingmessages
m5zs7k has quit [Read error: Connection reset by peer]
m5zs7k_ has joined #rust-embedded
m5zs7k_ is now known as m5zs7k
pcs38 has joined #rust-embedded
Foxyloxy has quit [Read error: Connection reset by peer]
rainingmessages has quit [Quit: bye]
rainingmessages has joined #rust-embedded
Foxyloxy has joined #rust-embedded
jason-kairos[m] has joined #rust-embedded
<jason-kairos[m]> Has anyone tried the BugStalker debugger?
<jason-kairos[m]> Sort of wonder if it can be coaxed into talking to a MCU.
KevinPFleming[m] has joined #rust-embedded
<KevinPFleming[m]> Has there ever been any consideration of having a `Read` interface which understood per-byte timeouts? I'm reading data over a UART, the message size varies from 16 to 2048 bytes, and I want to timeout if the sender stops sending, but if the sender stops sending after the third byte I don't want to wait for an overall message timeout.
<KevinPFleming[m]> My current implementation just uses a loop and does single-byte reads so I can use the same timeout for each read, but that seems terribly inefficient.
JamesMunns[m] has joined #rust-embedded
<JamesMunns[m]> It's something you could probably do in your "read" impl, the issue with making it a standard is that it's not particularly easy to do in all hardware, depending on how it is implemented.
<JamesMunns[m]> Some hardware has "idle detection", lots of hardware doesn't
<JamesMunns[m]> Usually "line idle" is defined as:
<JamesMunns[m]> * some bytes have been received
<JamesMunns[m]> * some interval of time passes without receiving another byte
<JamesMunns[m]> A fun example of this is on the RP2040, which CAN do this, but ONLY if you aren't using DMA
<JamesMunns[m]> because it detects the cased based on "there is data in the FIFO AND some time has elapsed", but if you use DMA then there will never be any bytes left in the FIFO.
<KevinPFleming[m]> I'm using embassy-stm32, which does have idle detection on some USART flavors.
<JamesMunns[m]> s/cased/case/
<KevinPFleming[m]> And I'm not using DMA, just interrupt-driven buffered interfaces.
<JamesMunns[m]> IMO you'd be best off defining your own interface for this that handles it the way you want. It's definitely a reasonable thing to want.
<KevinPFleming[m]> I'll put that on my list for a future improvement then :-)
<JamesMunns[m]> At least in embassy, you could implement it as another flavor of UART, that could be implemented for whatever USART variants that do have a reasonable idle detection
<KevinPFleming[m]> Ahh... good point. So just a first-byte-timeout plus idle detection would be sufficient.
<JamesMunns[m]> It just probably won't play nice with things like `embedded-io` impls, because you're specifying something similar but not exactly overlapping
<JamesMunns[m]> so 10ms between bytes, 2s for the total wait time
<KevinPFleming[m]> Yes, that's the idea.
<JamesMunns[m]> You could look at the read_until_break methods, which do something similar but with a line break
<KevinPFleming[m]> Thanks!
<JamesMunns[m]> you'd just need to provide the "line idle time"
<JamesMunns[m]> maybe read_until_idle is a better name :D
<KevinPFleming[m]> Or in my case, it's read_exact but with some sort of error result indicating that the idle time elapsed.
pcs38 has quit [Quit: leaving]
sroemer has quit [Quit: WeeChat 4.5.2]
pcs38 has joined #rust-embedded
dreamcat4 has joined #rust-embedded
pcs38 has quit [Quit: leaving]
sroemer has joined #rust-embedded