<eddie1o[m]>
My question is: when I have more than one button with `.listen(Event::RisingEdge)` how can I distinguish which one has been pressed? The example I linked only checks for `.is_interrupt_set()` which in my case will return true for both of my buttons. Or maybe is it better to spawn embassy tasks for each button and just `.wait_for_falling_edge()` in them?
<Ralph[m]>
eddie1o[m]: as far as i understood the latter is the preferred method with `async`
<eddie1o[m]>
Makes sense, thanks. It just felt a bit weird to spawn tasks for each end every button
<danielb[m]>
since there is a single interrupt handler, you'll need to go through your watched pins and read each one of them
<danielb[m]>
* interrupt handler (because the hardware only gives us one), you'll
<danielb[m]>
you can also select between your buttons in a single task, you don't need to spawn separate tasks for this
sroemer has joined #rust-embedded
sroemer has quit [Changing host]
sroemer has joined #rust-embedded
ska has joined #rust-embedded
<eddie1o[m]>
Okay, so the problem was that I thought that .is_interrupt_set() will return true for every pin I set .listen(Event::RisingEdge) to. But it returns true only for the interrupt source pin. Many thanks for all of you!
<mrpashapg[m]>
<diondokter[m]> Yeah, that's handled in the w25 crate....
<mrpashapg[m]>
I'll definitely read into it. Previously I had used another library that depended on embedded-storage - it was a high-level library, and I assumed embedded-storage mandated that an entire sector must be securely prepared before writing, performing erase operations prior to writes. Because of this, I didn't delve deeper into embedded-storage and was looking for alternative approaches.
<mrpashapg[m]>
Thanks for your explanation. And thank you for your work - now I don't need to implement low-level drivers in my project or handle these issues manually. I can focus on wear-leveling logic instead XD
<mrpashapg[m]>
Would you consider this a viable solution that could benefit others working with severely constrained memory (in the kilobyte range), providing them with the most optimized and efficient approach available?
<diondokter[m]>
Sounds like it's got different tradeoffs compared to the existing crates. So yeah, maybe
<mrpashapg[m]>
diondokter[m]: I really appreciate the time you've taken
norineko has quit [Remote host closed the connection]
norineko has joined #rust-embedded
norineko has quit [Remote host closed the connection]