Skip to content

Commit 9fb57e2

Browse files
committed
fix pullups not available on fe310
1 parent 3681452 commit 9fb57e2

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

internal/legacy/pinhal_baremetal.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ func configurePinOut(p PinOutput) {
99
}
1010

1111
func configurePinInputPulldown(p PinInput) {
12-
configurePin(p, machine.PinInputPulldown)
12+
configurePin(p, pulldown) // some chips do not have pull down, in which case pulldown==machine.PinInput.
1313
}
1414

1515
func configurePinInput(p PinInput) {
1616
configurePin(p, machine.PinInput)
1717
}
1818

1919
func configurePinInputPullup(p PinInput) {
20-
configurePin(p, machine.PinInputPullup)
20+
configurePin(p, pullup) // some chips do not have pull up, in which case pullup==machine.PinInput.
2121
}
2222

2323
func pinIsNoPin(a any) bool {

internal/legacy/pinhal_nopulls.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//go:build baremetal && fe310
2+
3+
package legacy
4+
5+
import "machine"
6+
7+
const (
8+
pulldown = machine.PinInput
9+
pullup = machine.PinInput
10+
)

internal/legacy/pinhal_pulls.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//go:build baremetal && !fe310
2+
3+
package legacy
4+
5+
import "machine"
6+
7+
const (
8+
pulldown = machine.PinInputPulldown
9+
pullup = machine.PinInputPullup
10+
)

0 commit comments

Comments
 (0)