Replace Safe functions with legacy.PinOutput

This commit is contained in:
Yurii Soldak
2025-09-21 10:04:20 +02:00
parent c6d83b783f
commit 453ff96a66
16 changed files with 112 additions and 108 deletions
+9
View File
@@ -0,0 +1,9 @@
//go:build !(baremetal && tinygo)
package legacy
import "tinygo.org/x/drivers"
func PinOutput(pin drivers.PinOutput) drivers.PinOutput {
return pin
}
+16
View File
@@ -0,0 +1,16 @@
//go:build baremetal && tinygo
package legacy
import (
"machine"
"tinygo.org/x/drivers"
)
func PinOutput(pin drivers.PinOutput) drivers.PinOutput {
if p, ok := pin.(machine.Pin); ok {
p.Configure(machine.PinConfig{Mode: machine.PinOutput})
}
return pin
}