Skip to content

Commit 3dd502a

Browse files
oflebbedeadprogram
authored andcommitted
align api for PortMaskSet, PortMaskClear
1 parent 48242ba commit 3dd502a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/machine/machine_rp2040_gpio.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ const (
8888
PinSPI
8989
)
9090

91-
func (p Pin) PortMaskSet() (*volatile.Register32, uint32) {
92-
return &rp.SIO.GPIO_OUT_SET, 1 << p
91+
func (p Pin) PortMaskSet() (*uint32, uint32) {
92+
return (*uint32)(unsafe.Pointer(&rp.SIO.GPIO_OUT_SET)), 1 << p
9393
}
9494

9595
// set drives the pin high
@@ -98,8 +98,8 @@ func (p Pin) set() {
9898
rp.SIO.GPIO_OUT_SET.Set(mask)
9999
}
100100

101-
func (p Pin) PortMaskClear() (*volatile.Register32, uint32) {
102-
return &rp.SIO.GPIO_OUT_CLR, 1 << p
101+
func (p Pin) PortMaskClear() (*uint32, uint32) {
102+
return (*uint32)(unsafe.Pointer(&rp.SIO.GPIO_OUT_CLR)), 1 << p
103103
}
104104

105105
// clr drives the pin low

0 commit comments

Comments
 (0)