mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-17 03:03:27 +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
@@ -52,8 +52,8 @@ const (
|
||||
I2C0_SDA_PIN = GPIO20
|
||||
I2C0_SCL_PIN = GPIO21
|
||||
|
||||
I2C1_SDA_PIN = 31 // not pinned out
|
||||
I2C1_SCL_PIN = 31 // not pinned out
|
||||
I2C1_SDA_PIN = NoPin // not pinned out
|
||||
I2C1_SCL_PIN = NoPin // not pinned out
|
||||
)
|
||||
|
||||
// SPI default pins
|
||||
@@ -65,9 +65,9 @@ const (
|
||||
// Default Serial In Bus 1 for SPI communications
|
||||
SPI1_SDI_PIN = GPIO28 // Rx
|
||||
|
||||
SPI0_SCK_PIN = 31 // not pinned out
|
||||
SPI0_SDO_PIN = 31 // not pinned out
|
||||
SPI0_SDI_PIN = 31 // not pinned out
|
||||
SPI0_SCK_PIN = NoPin // not pinned out
|
||||
SPI0_SDO_PIN = NoPin // not pinned out
|
||||
SPI0_SDI_PIN = NoPin // not pinned out
|
||||
)
|
||||
|
||||
// UART pins
|
||||
|
||||
Reference in New Issue
Block a user