Skip to content

Commit

Permalink
allwinner: Update pull-up/down registers using OR logic (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
TzeWey committed Oct 26, 2022
1 parent 712a469 commit 79c7463
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions allwinner/gpio.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ func (p *Pin) In(pull gpio.Pull, edge gpio.Edge) error {
drvGPIO.gpioMemory.groups[p.group].pull[off] &^= 3 << shift
switch pull {
case gpio.PullDown:
drvGPIO.gpioMemory.groups[p.group].pull[off] = 2 << shift
drvGPIO.gpioMemory.groups[p.group].pull[off] |= 2 << shift
case gpio.PullUp:
drvGPIO.gpioMemory.groups[p.group].pull[off] = 1 << shift
drvGPIO.gpioMemory.groups[p.group].pull[off] |= 1 << shift
default:
}
}
Expand Down
4 changes: 2 additions & 2 deletions allwinner/gpio_pl.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ func (p *PinPL) In(pull gpio.Pull, edge gpio.Edge) error {
drvGPIOPL.gpioMemoryPL.pull[off] &^= 3 << shift
switch pull {
case gpio.PullDown:
drvGPIOPL.gpioMemoryPL.pull[off] = 2 << shift
drvGPIOPL.gpioMemoryPL.pull[off] |= 2 << shift
case gpio.PullUp:
drvGPIOPL.gpioMemoryPL.pull[off] = 1 << shift
drvGPIOPL.gpioMemoryPL.pull[off] |= 1 << shift
default:
}
}
Expand Down

0 comments on commit 79c7463

Please sign in to comment.