Refactored LAN final automate (Ethernet2 lib update required)

This commit is contained in:
2020-10-05 03:50:23 +03:00
parent 38cd7baf58
commit 13efb609d3
26 changed files with 27074 additions and 26300 deletions

View File

@@ -2,6 +2,7 @@
#include <Arduino.h>
#ifdef SYSLOG_ENABLE
extern bool syslogInitialized;
Streamlog::Streamlog (HardwareSerial * _serialPort, int _severity , Syslog * _syslog )
{
serialPort=_serialPort;
@@ -54,6 +55,8 @@ void Streamlog::flush(void)
size_t Streamlog::write(uint8_t ch)
{
#ifdef SYSLOG_ENABLE
if (syslogInitialized)
{
if (ch=='\n')
{
logBuffer[logBufferPos]=0;
@@ -64,6 +67,7 @@ size_t Streamlog::write(uint8_t ch)
{
if (logBufferPos<LOGBUFFER_SIZE-1 && (ch!='\r')) logBuffer[logBufferPos++]=ch;
}
}
#endif
if (serialPort) return serialPort->write(ch);