mirror of
https://github.com/kidoman/embd
synced 2025-07-03 11:57:38 +02:00
gpio: make analog pin support more versatile on the bbb
This commit is contained in:
parent
5a1a40d53b
commit
f7b316332e
2 changed files with 28 additions and 4 deletions
15
utils.go
Normal file
15
utils.go
Normal file
|
@ -0,0 +1,15 @@
|
|||
package embd
|
||||
|
||||
import "path/filepath"
|
||||
|
||||
// Inspiration: https://github.com/mrmorphic/hwio/blob/master/hwio.go#L451
|
||||
func findFirstMatchingFile(glob string) (string, error) {
|
||||
matches, err := filepath.Glob(glob)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if len(matches) >= 1 {
|
||||
return matches[0], nil
|
||||
}
|
||||
return "", nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue