From 8ca593aee9e07ba6e1aa94089447770906b2314e Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Fri, 13 Mar 2020 11:36:11 +0100 Subject: [PATCH] Fix weaked serialEventRun() not being called Fixes #985 Signed-off-by: Frederic Pillon --- cores/arduino/WSerial.cpp | 2 +- cores/arduino/WSerial.h | 2 +- cores/arduino/main.cpp | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cores/arduino/WSerial.cpp b/cores/arduino/WSerial.cpp index 7fba4df0d1..3d866cae2f 100644 --- a/cores/arduino/WSerial.cpp +++ b/cores/arduino/WSerial.cpp @@ -1,6 +1,6 @@ #include "WSerial.h" -void serialEventRun(void) +WEAK void serialEventRun(void) { #if defined(HAVE_HWSERIAL1) if (serialEvent1 && Serial1.available()) { diff --git a/cores/arduino/WSerial.h b/cores/arduino/WSerial.h index 753a38c25b..ffdc98ad52 100644 --- a/cores/arduino/WSerial.h +++ b/cores/arduino/WSerial.h @@ -165,6 +165,6 @@ extern void serialEvent10(void) __attribute__((weak)); extern void serialEventLP1(void) __attribute__((weak)); #endif /* HAL_UART_MODULE_ENABLED && !HAL_UART_MODULE_ONLY */ -extern void serialEventRun(void) __attribute__((weak)); +extern void serialEventRun(void); #endif /* WIRING_SERIAL_H */ diff --git a/cores/arduino/main.cpp b/cores/arduino/main.cpp index d7a9a51cea..450f01bd33 100644 --- a/cores/arduino/main.cpp +++ b/cores/arduino/main.cpp @@ -62,9 +62,7 @@ int main(void) CoreCallback(); #endif loop(); - if (serialEventRun) { - serialEventRun(); - } + serialEventRun(); } return 0;