File tree 1 file changed +5
-8
lines changed
1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change 23
23
#endif
24
24
25
25
void serialEvent (void ) __attribute__((weak));
26
- void serialEvent (void ) {}
27
26
28
27
#if SOC_UART_NUM > 1
29
28
void serialEvent1 (void ) __attribute__((weak));
30
- void serialEvent1 (void ) {}
31
29
#endif /* SOC_UART_NUM > 1 */
32
30
33
31
#if SOC_UART_NUM > 2
34
32
void serialEvent2 (void ) __attribute__((weak));
35
- void serialEvent2 (void ) {}
36
33
#endif /* SOC_UART_NUM > 2 */
37
34
38
35
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL)
@@ -51,18 +48,18 @@ HardwareSerial Serial2(2);
51
48
void serialEventRun (void )
52
49
{
53
50
#if HWCDC_SERIAL_IS_DEFINED == 1 // Hardware JTAG CDC Event
54
- if (HWCDCSerial.available ()) HWCDCSerialEvent ();
51
+ if (HWCDCSerialEvent && HWCDCSerial.available ()) HWCDCSerialEvent ();
55
52
#endif
56
53
#if USB_SERIAL_IS_DEFINED == 1 // Native USB CDC Event
57
- if (USBSerial.available ()) USBSerialEvent ();
54
+ if (USBSerialEvent && USBSerial.available ()) USBSerialEvent ();
58
55
#endif
59
56
// UART0 is default serialEvent()
60
- if (Serial.available ()) serialEvent ();
57
+ if (serialEvent && Serial.available ()) serialEvent ();
61
58
#if SOC_UART_NUM > 1
62
- if (Serial1.available ()) serialEvent1 ();
59
+ if (serialEvent1 && Serial1.available ()) serialEvent1 ();
63
60
#endif
64
61
#if SOC_UART_NUM > 2
65
- if (Serial2.available ()) serialEvent2 ();
62
+ if (serialEvent2 && Serial2.available ()) serialEvent2 ();
66
63
#endif
67
64
}
68
65
#endif
You can’t perform that action at this time.
0 commit comments