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:
Ayke van Laethem
2022-09-26 16:58:17 +02:00
committed by Ron Evans
parent 725864d8dc
commit f52ecf3054
2 changed files with 13 additions and 13 deletions
+5 -5
View File
@@ -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