Skip to content

Commit 4e5cbda

Browse files
committed
Add declarations for all Serial, SPI and Wire buses
1 parent 12ca9e8 commit 4e5cbda

File tree

6 files changed

+8
-0
lines changed

6 files changed

+8
-0
lines changed

Diff for: cores/esp32/HardwareSerial.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL)
99
HardwareSerial Serial(0);
10+
HardwareSerial Serial1(1);
11+
HardwareSerial Serial2(2);
1012
#endif
1113

1214
HardwareSerial::HardwareSerial(int uart_nr) : _uart_nr(uart_nr), _uart(NULL) {}

Diff for: cores/esp32/HardwareSerial.h

+2
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ class HardwareSerial: public Stream
7979

8080
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL)
8181
extern HardwareSerial Serial;
82+
extern HardwareSerial Serial1;
83+
extern HardwareSerial Serial2;
8284
#endif
8385

8486
#endif

Diff for: libraries/SPI/src/SPI.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -288,3 +288,4 @@ void SPIClass::writePattern_(uint8_t * data, uint8_t size, uint8_t repeat)
288288
}
289289

290290
SPIClass SPI(VSPI);
291+
SPIClass SPI1(HSPI);

Diff for: libraries/SPI/src/SPI.h

+1
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,6 @@ class SPIClass
8383
};
8484

8585
extern SPIClass SPI;
86+
extern SPIClass SPI1;
8687

8788
#endif

Diff for: libraries/Wire/src/Wire.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -364,3 +364,4 @@ void TwoWire::dumpI2C()
364364
}
365365

366366
TwoWire Wire = TwoWire(0);
367+
TwoWire Wire1 = TwoWire(1);

Diff for: libraries/Wire/src/Wire.h

+1
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ class TwoWire: public Stream
134134
};
135135

136136
extern TwoWire Wire;
137+
extern TwoWire Wire1;
137138

138139

139140
/*

0 commit comments

Comments
 (0)