mirror of
https://github.com/kidoman/embd
synced 2025-07-04 20:37:46 +02:00
Force digitalpin direction to be embd.IN when Watching
Only Input pin can generate interrupt.
This commit is contained in:
parent
0e820bad5b
commit
3e9ce063db
1 changed files with 4 additions and 0 deletions
|
@ -127,6 +127,10 @@ func (p *digitalPin) setEdge(edge embd.Edge) error {
|
|||
}
|
||||
|
||||
func (p *digitalPin) Watch(edge embd.Edge, callback embd.IRQEvent) error {
|
||||
if err := p.SetDirection(embd.In); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := p.setEdge(edge); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue