support serialEvent()

This commit is contained in:
hathach committed 2018-07-12 16:51:28 +07:00
1 parent 1977aea69e
commit e6c4b0ff7e
3 files changed
+9

No files matched your search

+1
View File
@@ -80,5 +80,6 @@ class HardwareSerial : public Stream
};
extern void serialEventRun(void) __attribute__((weak));
extern void serialEvent() __attribute__((weak));
#endif
+6
View File
@@ -21,6 +21,12 @@
#include "Arduino.h"
#include "wiring_private.h"
void serialEventRun(void)
{
if (serialEvent && Serial.available() ) serialEvent();
}
Uart::Uart(NRF_UART_Type *_nrfUart, IRQn_Type _IRQn, uint8_t _pinRX, uint8_t _pinTX)
{
nrfUart = _nrfUart;
+2
View File
@@ -61,6 +61,8 @@ static void loop_task(void* arg)
{
loop();
if (serialEvent && serialEventRun) serialEventRun();
#if CFG_DEBUG >= 2 && DBG_MEM_INFO
static uint32_t meminfo_ms = 0;
if (meminfo_ms + DBG_MEM_INFO_INTERVAL < millis())