mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-16 02:33:28 +00:00
machine: use NoPin constant where appropriate
In some cases, regular integers were used. But we have a constant to explicitly say these pins are undefined: `NoPin`. So use this. A better solution would be to not require these constants, like with the proposal in https://github.com/tinygo-org/tinygo/issues/3152. This change is just a slight improvement over the current state.
This commit is contained in:
committed by
Ron Evans
parent
725864d8dc
commit
f52ecf3054
@@ -18,15 +18,15 @@ const (
|
||||
|
||||
// MDBT50Q-RX dongle does not have pins broken out for the peripherals below,
|
||||
// however the machine_nrf*.go implementations of I2C/SPI/etc expect the pin
|
||||
// constants to be defined, so we are defining them all as 0
|
||||
// constants to be defined, so we are defining them all as NoPin
|
||||
const (
|
||||
UART_TX_PIN = 0
|
||||
UART_RX_PIN = 0
|
||||
SDA_PIN = 0
|
||||
SCL_PIN = 0
|
||||
SPI0_SCK_PIN = 0
|
||||
SPI0_SDO_PIN = 0
|
||||
SPI0_SDI_PIN = 0
|
||||
UART_TX_PIN = NoPin
|
||||
UART_RX_PIN = NoPin
|
||||
SDA_PIN = NoPin
|
||||
SCL_PIN = NoPin
|
||||
SPI0_SCK_PIN = NoPin
|
||||
SPI0_SDO_PIN = NoPin
|
||||
SPI0_SDI_PIN = NoPin
|
||||
)
|
||||
|
||||
// USB CDC identifiers
|
||||
|
||||
Reference in New Issue
Block a user