support serialEvent()
This commit is contained in:
1 parent
1977aea69e
commit
e6c4b0ff7e
3 files changed
+9
No files matched your search
@@ -80,5 +80,6 @@ class HardwareSerial : public Stream
|
||||
};
|
||||
|
||||
extern void serialEventRun(void) __attribute__((weak));
|
||||
extern void serialEvent() __attribute__((weak));
|
||||
|
||||
#endif
|
||||
@@ -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;
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in new issue
Block a user