<re_irc>
<@dirbaio:matrix.org> panics on incoming garbage shouldn't happen yup
<re_irc>
<@oddstr13:matrix.org> hehe
fabic_ has joined #rust-embedded
<re_irc>
<@oddstr13:matrix.org> dirbaio: seems I'm never hitting TxToken consume, any idea why that might be?
fabic_ has quit [Remote host closed the connection]
<re_irc>
<@dirbaio:matrix.org> maybe because it isn't trying to tx anything..?
fabic has joined #rust-embedded
<re_irc>
<@dirbaio:matrix.org> if you're using defmt, you can enable features defmt + defmt-trace to see more stuff
<re_irc>
<@dirbaio:matrix.org> is it hitting Device::transmit?
<re_irc>
<@dirbaio:matrix.org> it is normal for the TxToken from Device::receive to go unused, smoltcp will only use it if it wants to transmit a response to the just-received packet
<re_irc>
<@dirbaio:matrix.org> it's rarer for the TxToken from Device::transmit to go unused, smoltcp will only call Device::transmit when it actually wants to transmit something
<re_irc>
<@oddstr13:matrix.org> I'll have a look at the trace stuff, but I know it's hitting this block;
<re_irc>
<@oddstr13:matrix.org> dirbaio: I'm getting two bytes cut off at the end on udp rx it seems, but other than that it looks like it's working! π
<re_irc>
<@oddstr13:matrix.org> Still need to figure out how neighbor discovery is *supposed* to work tho, I was having trouble with the manually set one timing out from cache too quickly π
DepthDeluxe has quit [Read error: Connection reset by peer]
Ekho has quit [*.net *.split]
Ekho has joined #rust-embedded
inara has quit [*.net *.split]
mrkajetanp has quit [*.net *.split]
dkm has quit [*.net *.split]
vancz has quit [*.net *.split]
dkm_ has joined #rust-embedded
vancz has joined #rust-embedded
inara has joined #rust-embedded
mrkajetanp has joined #rust-embedded
DepthDeluxe has joined #rust-embedded
dcz has joined #rust-embedded
dcz_ has quit [Ping timeout: 265 seconds]
dkm_ is now known as dkm
<re_irc>
<@ildar:matrix.org> greetings! a newbie question here...
<re_irc>
<@ildar:matrix.org> is there no easier way to read GPIO then `replace`-ing the cell back and forth?
<re_irc>
<@grantm11235:matrix.org> Can you replace the `RefCell<Option<Pin<Input<Floating>>>>` with just `Pin<Input<Floating>>` or `&Pin<Input<Floating>>`?
<re_irc>
<@ildar:matrix.org> hmm. I tried `&` and it brings a lot of problems with the lifetime
<re_irc>
<@ildar:matrix.org> RefCell allows me to use its contents (pin) while having multiple immutable refs to the outer struct.
<re_irc>
<@ildar:matrix.org> so the question is: how good GPIO APIs with RefCell pattern? It is promoted in the Book but in practice I need to `replace()` it back and forth
DepthDeluxe has quit [Ping timeout: 268 seconds]
<re_irc>
<@grantm11235:matrix.org> I'm not sure why you would need a RefCell for a GPIO input, you can read the state with an immutable reference
<re_irc>
<@ildar:matrix.org> hmm, indeed
<re_irc>
<@ildar:matrix.org> ok, I'll think about it
<re_irc>
<@ildar:matrix.org> thanks
<re_irc>
<@grantm11235:matrix.org> It would make more sense for a GPIO output because that requires a mutable reference in order to use it.
gsalazar_ has joined #rust-embedded
gsalazar_ is now known as gsalazar
hifi has quit [Remote host closed the connection]
hifi has joined #rust-embedded
<Lumpio->
ildar: Why replace when you have borrow_mut?
<Lumpio->
Or even better if only that method needs access to it, arrange it so that others don't have any access ( ot even shared references)
<Lumpio->
not*
<re_irc>
<@therealprof:matrix.org> The idea of replace is to move the pin from a global context to a local context to avoid having to disable interrupts all the time.
<re_irc>
<@therealprof:matrix.org> As in: do it once, not go back and forth. π
<re_irc>
<@therealprof:matrix.org> Also the `borrow_mut` makes it somewhat convoluted to avoid having to `unwrap`.
<re_irc>
<@pmnxis:matrix.org> Special adapter for paper dispenser machine (such as a dollar).
<re_irc>
<@pmnxis:matrix.org> I am using two types of the machine.
<re_irc>
<@pmnxis:matrix.org> One is prallel GPIO communication model with 12V.
<re_irc>
<@pmnxis:matrix.org> And another is serial (RS232) communication model with 24V.
<re_irc>
<@pmnxis:matrix.org> But my previous product is designed to use serial(rs232) 24V model.
<re_irc>
<@pmnxis:matrix.org> But by some reason, I need to use parallel-12v model. So making adapter for 24v-rs232 to 12v-parallel with rust as practice
<Lumpio->
Oh like a paper money dispenser, alright
<re_irc>
<@mathias_koch:matrix.org> jamesmunns: Any chance you could give https://github.com/jamesmunns/bbqueue/pull/90 a look some time? I would love to do a round of releases, but can't with git patches in my dep tree
fabic has joined #rust-embedded
<re_irc>
<@jamesmunns:matrix.org> MathiasKoch: ACK, I'll get this merged and released tonight.
<re_irc>
<@mathias_koch:matrix.org> Awesome! Thank you very much! :)
DepthDeluxe has joined #rust-embedded
DepthDeluxe has quit [Ping timeout: 268 seconds]
DepthDeluxe has joined #rust-embedded
fabic has quit [Ping timeout: 268 seconds]
<re_irc>
<@roedimqf:ruhr-uni-bochum.de> korken89:
DepthDeluxe has quit [Ping timeout: 268 seconds]
<re_irc>
<@jamesmunns:matrix.org> MathiasKoch: released v0.5.0!
<re_irc>
<@mathias_koch:matrix.org> Yaayy! ππ Thank you very much jamesmunns
<re_irc>
<@jamesmunns:matrix.org> I did make a couple changes beyond the PR, namely:
<re_irc>
<@mathias_koch:matrix.org> No issues here π
<re_irc>
<@mathias_koch:matrix.org> Thanks for a great library π
edm has quit []
edm has joined #rust-embedded
dreamcat4 has quit []
dreamcat4 has joined #rust-embedded
darknighte has quit []
darknighte has joined #rust-embedded
GenTooMan has quit [Ping timeout: 260 seconds]
dcz has quit [Ping timeout: 268 seconds]
<re_irc>
<@osannolik:matrix.org> Beginner question here! What is the best way to allow changing an output pin to an input dito (and the reverse) using the embedded-hal crates? For example, using stm32l0xx-hal, I run into issues due to e.g. into_floating_input() consumes the variable holding the pin. It becomes difficult to keep it in another struct. I managed to hack together something that kind of works by wrapping it in an enum, but it's..
<re_irc>
<@osannolik:matrix.org> I see, thank you. I ran into the same issue a couple of years ago and made a PR to embedded-hal for a Tristate trait adding Floating as a pin state. As of then I have not been doing much rust, but since not much happened to the PR I assumed there already was a simple solution...
<re_irc>
<@xiretza:xiretza.xyz> which HAL are you using?
SanchayanMaity has quit []
SanchayanMaity has joined #rust-embedded
<re_irc>
<@osannolik:matrix.org> I'm using stm32l0xx-hal right now.