Skip to content

Commit af1c777

Browse files
committed
Reverted change for weak loop() binding.
Added Arduino compatible serialEventRun according to review comment (instead).
1 parent 1652e10 commit af1c777

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

Diff for: cores/esp32/HardwareSerial.h

+2
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ class HardwareSerial: public Stream
9797
uart_t* _uart;
9898
};
9999

100+
extern void serialEventRun(void) __attribute__((weak));
101+
100102
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL)
101103
extern HardwareSerial Serial;
102104
extern HardwareSerial Serial1;

Diff for: cores/esp32/main.cpp

+2-6
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,15 @@ TaskHandle_t loopTaskHandle = NULL;
99

1010
bool loopTaskWDTEnabled;
1111

12-
extern "C" void esp_loop(void) __attribute__((weak));
13-
extern "C" void esp_loop(void) {
14-
loop();
15-
}
16-
1712
void loopTask(void *pvParameters)
1813
{
1914
setup();
2015
for(;;) {
2116
if(loopTaskWDTEnabled){
2217
esp_task_wdt_reset();
2318
}
24-
esp_loop();
19+
loop();
20+
if (serialEventRun) serialEventRun();
2521
}
2622
}
2723

0 commit comments

Comments
 (0)