mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-20 04:19:04 +00:00
machine: rename PinInputPullUp/PinInputPullDown
Some targets used capital PullUp/PullDown, while the documented standard is Pullup/Pulldown. This commit fixes this mismatch, while preserving compatibility with aliases that are marked deprecated.
This commit is contained in:
committed by
Ron Evans
parent
6e6666519c
commit
bc946f346d
@@ -42,13 +42,19 @@ const deviceName = nxp.Device
|
||||
|
||||
const (
|
||||
PinInput PinMode = iota
|
||||
PinInputPullUp
|
||||
PinInputPullDown
|
||||
PinInputPullup
|
||||
PinInputPulldown
|
||||
PinOutput
|
||||
PinOutputOpenDrain
|
||||
PinDisable
|
||||
)
|
||||
|
||||
// Deprecated: use PinInputPullup and PinInputPulldown instead.
|
||||
const (
|
||||
PinInputPullUp = PinInputPullup
|
||||
PinInputPullDown = PinInputPulldown
|
||||
)
|
||||
|
||||
const (
|
||||
PA00 Pin = iota
|
||||
PA01
|
||||
@@ -223,11 +229,11 @@ func (p Pin) Configure(config PinConfig) {
|
||||
gpio.PDDR.ClearBits(1 << pos)
|
||||
pcr.Set((1 << nxp.PORT_PCR0_MUX_Pos))
|
||||
|
||||
case PinInputPullUp:
|
||||
case PinInputPullup:
|
||||
gpio.PDDR.ClearBits(1 << pos)
|
||||
pcr.Set((1 << nxp.PORT_PCR0_MUX_Pos) | nxp.PORT_PCR0_PE | nxp.PORT_PCR0_PS)
|
||||
|
||||
case PinInputPullDown:
|
||||
case PinInputPulldown:
|
||||
gpio.PDDR.ClearBits(1 << pos)
|
||||
pcr.Set((1 << nxp.PORT_PCR0_MUX_Pos) | nxp.PORT_PCR0_PE)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user