From 4e5cbdaa7f4ae6d4f76a378e010d8979da9532bf Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Tue, 3 Jul 2018 20:41:03 +0200 Subject: [PATCH] Add declarations for all Serial, SPI and Wire buses --- cores/esp32/HardwareSerial.cpp | 2 ++ cores/esp32/HardwareSerial.h | 2 ++ libraries/SPI/src/SPI.cpp | 1 + libraries/SPI/src/SPI.h | 1 + libraries/Wire/src/Wire.cpp | 1 + libraries/Wire/src/Wire.h | 1 + 6 files changed, 8 insertions(+) diff --git a/cores/esp32/HardwareSerial.cpp b/cores/esp32/HardwareSerial.cpp index 1f1a5290..e46c7a02 100644 --- a/cores/esp32/HardwareSerial.cpp +++ b/cores/esp32/HardwareSerial.cpp @@ -7,6 +7,8 @@ #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL) HardwareSerial Serial(0); +HardwareSerial Serial1(1); +HardwareSerial Serial2(2); #endif HardwareSerial::HardwareSerial(int uart_nr) : _uart_nr(uart_nr), _uart(NULL) {} diff --git a/cores/esp32/HardwareSerial.h b/cores/esp32/HardwareSerial.h index c0e00ec2..f1e04e90 100644 --- a/cores/esp32/HardwareSerial.h +++ b/cores/esp32/HardwareSerial.h @@ -79,6 +79,8 @@ protected: #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL) extern HardwareSerial Serial; +extern HardwareSerial Serial1; +extern HardwareSerial Serial2; #endif #endif diff --git a/libraries/SPI/src/SPI.cpp b/libraries/SPI/src/SPI.cpp index 863c43ad..8815bd5b 100644 --- a/libraries/SPI/src/SPI.cpp +++ b/libraries/SPI/src/SPI.cpp @@ -288,3 +288,4 @@ void SPIClass::writePattern_(uint8_t * data, uint8_t size, uint8_t repeat) } SPIClass SPI(VSPI); +SPIClass SPI1(HSPI); diff --git a/libraries/SPI/src/SPI.h b/libraries/SPI/src/SPI.h index 783a0a39..b84b4212 100644 --- a/libraries/SPI/src/SPI.h +++ b/libraries/SPI/src/SPI.h @@ -83,5 +83,6 @@ public: }; extern SPIClass SPI; +extern SPIClass SPI1; #endif diff --git a/libraries/Wire/src/Wire.cpp b/libraries/Wire/src/Wire.cpp index d3197e95..7109835d 100644 --- a/libraries/Wire/src/Wire.cpp +++ b/libraries/Wire/src/Wire.cpp @@ -364,3 +364,4 @@ void TwoWire::dumpI2C() } TwoWire Wire = TwoWire(0); +TwoWire Wire1 = TwoWire(1); diff --git a/libraries/Wire/src/Wire.h b/libraries/Wire/src/Wire.h index cdf50fd5..755c8150 100644 --- a/libraries/Wire/src/Wire.h +++ b/libraries/Wire/src/Wire.h @@ -134,6 +134,7 @@ public: }; extern TwoWire Wire; +extern TwoWire Wire1; /*