Portado para MBED OS 6

Dependents:   Navitec-Firmware

Revision:
6:3fdb7f0f121a
Parent:
5:58c5158b5120
--- a/DigiLoggerMbedSerial.cpp	Mon Jun 01 18:59:28 2015 +0200
+++ b/DigiLoggerMbedSerial.cpp	Sun Apr 04 14:38:12 2021 +0000
@@ -14,10 +14,10 @@
 
 using namespace DigiLog;
 
-Serial *DigiLoggerMbedSerial::_log_serial;
-
+//Serial *DigiLoggerMbedSerial::_log_serial;
+BufferedSerial *DigiLoggerMbedSerial::_log_serial;
 /* Class constructor when using a serial port as logging channel */
-DigiLoggerMbedSerial::DigiLoggerMbedSerial(Serial * log_serial, LogLevel log_level)
+DigiLoggerMbedSerial::DigiLoggerMbedSerial(BufferedSerial * log_serial, LogLevel log_level)
 {
     _log_serial = log_serial;
 
@@ -39,8 +39,10 @@
         return;
     }
 
-    _log_serial->printf("%s", buffer);
-    fflush(*_log_serial);
+    //_log_serial->printf("%s", buffer);
+    //fflush(*_log_serial);
+    _log_serial->write(&buffer, sizeof(buffer));
+    _log_serial->sync();
 }