mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2025-12-13 05:53:06 +01:00
add some memory diagnostics
This commit is contained in:
@@ -15,6 +15,7 @@ class SerialWriter : public GwBufferWriter{
|
||||
};
|
||||
GwSerial::GwSerial(GwLog *logger, uart_port_t num, int id,bool allowRead)
|
||||
{
|
||||
LOG_DEBUG(GwLog::DEBUG,"creating GwSerial %p port %d",this,(int)num);
|
||||
this->id=id;
|
||||
this->logger = logger;
|
||||
this->num = num;
|
||||
@@ -79,6 +80,7 @@ void GwSerial::sendToClients(const char *buf,int sourceId){
|
||||
}
|
||||
void GwSerial::loop(bool handleRead){
|
||||
write();
|
||||
if (! isInitialized()) return;
|
||||
if (! handleRead) return;
|
||||
char buffer[10];
|
||||
int rt=uart_read_bytes(num,(uint8_t *)(&buffer),10,0);
|
||||
@@ -87,6 +89,7 @@ void GwSerial::loop(bool handleRead){
|
||||
}
|
||||
}
|
||||
bool GwSerial::readMessages(GwBufferWriter *writer){
|
||||
if (! isInitialized()) return false;
|
||||
if (! allowRead) return false;
|
||||
return readBuffer->fetchMessage(writer,'\n',true) == GwBuffer::OK;
|
||||
}
|
||||
Reference in New Issue
Block a user