Unverified Commit 6a878cde authored by Earle F. Philhower, III's avatar Earle F. Philhower, III Committed by GitHub

Only create SPI/Wire instances if variant defined (#1842)

Fixes #1841
parent cebdb6c9
...@@ -363,5 +363,10 @@ void SPIClassRP2040::setClockDivider(uint8_t uc_div) { ...@@ -363,5 +363,10 @@ void SPIClassRP2040::setClockDivider(uint8_t uc_div) {
#define __SPI1_DEVICE spi1 #define __SPI1_DEVICE spi1
#endif #endif
#ifdef PIN_SPI0_MISO
SPIClassRP2040 SPI(__SPI0_DEVICE, PIN_SPI0_MISO, PIN_SPI0_SS, PIN_SPI0_SCK, PIN_SPI0_MOSI); SPIClassRP2040 SPI(__SPI0_DEVICE, PIN_SPI0_MISO, PIN_SPI0_SS, PIN_SPI0_SCK, PIN_SPI0_MOSI);
#endif
#ifdef PIN_SPI1_MISO
SPIClassRP2040 SPI1(__SPI1_DEVICE, PIN_SPI1_MISO, PIN_SPI1_SS, PIN_SPI1_SCK, PIN_SPI1_MOSI); SPIClassRP2040 SPI1(__SPI1_DEVICE, PIN_SPI1_MISO, PIN_SPI1_SS, PIN_SPI1_SCK, PIN_SPI1_MOSI);
#endif
...@@ -470,5 +470,10 @@ void TwoWire::clearTimeoutFlag() { ...@@ -470,5 +470,10 @@ void TwoWire::clearTimeoutFlag() {
#define __WIRE1_DEVICE i2c1 #define __WIRE1_DEVICE i2c1
#endif #endif
#ifdef PIN_WIRE0_SDA
TwoWire Wire(__WIRE0_DEVICE, PIN_WIRE0_SDA, PIN_WIRE0_SCL); TwoWire Wire(__WIRE0_DEVICE, PIN_WIRE0_SDA, PIN_WIRE0_SCL);
#endif
#ifdef PIN_WIRE1_SDA
TwoWire Wire1(__WIRE1_DEVICE, PIN_WIRE1_SDA, PIN_WIRE1_SCL); TwoWire Wire1(__WIRE1_DEVICE, PIN_WIRE1_SDA, PIN_WIRE1_SCL);
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment