Skip to content

Commit 054c1a9

Browse files
committed
Should fix compilation error
1 parent 7d84946 commit 054c1a9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ HardwareSerial hwSerial2(2);
33

44
bool ok = true;
55

6-
static void IRAM_ATTR onSerialRX(char c, void* user_arg){
7-
if(*((bool*)user_arg))
6+
static void IRAM_ATTR onSerialRX(uint8_t c, void* user_arg){
87
hwSerial.print(c);
8+
((HardwareSerial*)user_arg)->print(c);
99
}
1010

1111
void setup()
1212
{
1313
hwSerial.begin(115200);
1414
hwSerial2.begin(115200);
15-
hwSerial2.setRXInterrupt(onSerialRX, (void*)&ok);
15+
hwSerial2.setRXInterrupt(onSerialRX, (void*)&hwSerial2);
1616

1717
}
1818

0 commit comments

Comments
 (0)