Q: How to use Wait::wait_for_low and avoid the race condition between interrupt setup and pin triggering?
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Documentazione
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- rust
- Ambito
- embedded-iot
Direzione di ricerca
Start with embedded-hal-async/src/digital.rs at the Wait trait and compare the esp-hal GPIO implementation linked in the report. Determine whether the trait needs usage guidance or an API change to make interrupt setup safe before triggering activity, then document or specify the intended sequence and its completion criteria.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi folks,
I am trying to detect a brief pulse using embedded-hal-async GPIO Wait trait. The methods like wait_for_low are perfect for that in general (https://github.com/rust-embedded/embedded-hal/blob/master/embedded-hal-async/src/digital.rs#L34)
However most of the implementations I have seen configure the interrupt within the wait_for_low method which means it must first be polled at least once (but sometimes more) before the interrupt is set up properly. See for example how the esp waits for the setup to be possible here https://github.com/esp-rs/esp-hal/blob/87d501766f178a2dd812c382ca257d268ee266ad/esp-hal/src/gpio/mod.rs#L2242
Now, I have a device where the pulse can disappear on its own and I need to detect it reliably. I have custom code that first sets up the interrupt and only then triggers the behavior. This works, but I would like to rewrite my custom code to adhere to the embedded-hal-async traits.
Do you have any idea about how to use the wait_for_low in this way? First set-up the interrupts, then do something outside to trigger the activity and then wait for the interrupt to happen?
The code I have right know looks roughly like this:
let w = WaitForPin::listen(gpio, pin, LOW);
device.start()
w.await;
TLDR: How to use Wait::wait_for_low and avoid the race condition between interrupt setup and pin triggering?
- Lingua principale
- Rust
- Stelle
- 2.7k
- Fork
- 283
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rust-embedded/embedded-hal
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
rust-embedded/embedded-hal#742 · 1 commento ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
rust-embedded/embedded-hal#747 · 5 commenti · 1 reazione ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
rust-embedded/embedded-hal#746 · 2 commenti · 1 reazione ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
rust-embedded/embedded-hal#745 · 1 reazione ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 55/100
rust-embedded/embedded-hal#744 · 1 commento ·
Tutte le issue di rust-embedded/embedded-hal
Issue simili
-
install.ps1: Windows PowerShell 5.1 aborts after a successful cosign verification (NativeCommandError on 'Verified OK')Forse già presa @sly321-pixel l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
ai_p2
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
ClickHouse/ClickHouse#125522 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: OpenRouter streaming chunks report the requested router name instead of the model OpenRouter servedForse già presa @Mrun25 l’ha presa oggi. Apertabug llm translation
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
BerriAI/litellm#46095 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
cline/mcp-marketplace#2942 ·