8000 Changed serials to Serial and Serial2 · timkoers/arduino-esp32@e3298ea · GitHub
[go: up one dir, main page]

Skip to content

Commit e3298ea

Browse files
committed
Changed serials to Seria 8000 l and Serial2
1 parent 6d7e8eb commit e3298ea

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

libraries/ESP32/examples/Serial/Interrupt/Interrupt.ino

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
HardwareSerial hwSerial(0);
2-
HardwareSerial hwSerial2(2);
1+
// Serial, Serial1 and Serial2 are all of the type HardwareSerial.
32

43
static void IRAM_ATTR onSerialRX(uint8_t c, void* user_arg){
5-
hwSerial.print(c);
4+
Serial.print(c);
65

76
// Cast the user_arg containing a void* to the Serial device, to HardwareSerial* to be used
87
HardwareSerial* serial = (HardwareSerial*)user_arg;
@@ -11,12 +10,12 @@ static void IRAM_ATTR onSerialRX(uint8_t c, void* user_arg){
1110

1211
void setup()
1312
{
14-
hwSerial.begin(115200);
15-
hwSerial2.begin(115200);
13+
Serial.begin(115200);
14+
Serial2.begin(115200);
1615

1716
// The user_arg is expected to be a void pointer (void*),
18-
// so take the reference of hwSerial2, and cast the HardwareSerial* to a void*
19-
hwSerial2.setRxInterrupt(onSerialRX, (void*)&hwSerial2);
17+
// so take the reference of Serial2, and cast the HardwareSerial* to a void*
18+
Serial2.setRxInterrupt(onSerialRX, (void*)&Serial2);
2019
}
2120

2221
void loop()

0 commit comments

Comments
 (0)
0