platform: use Static<> init for serial printer, remove carriage return

This commit is contained in:
Torrie Fischer 2023-12-11 08:06:22 +01:00
parent 63a705ddd4
commit 7418172f79

View File

@ -23,13 +23,14 @@ NTPClient timeClient(wifiUdp, "pool.ntp.org", 3600 * -7);
#ifdef PLATFORM_PHOTON
STARTUP(BootOptions::initPins());
#else
#include "inputs/Serial.h"
#ifdef CONFIG_MQTT
#include "platform/arduino/MQTTTelemetry.h"
#endif
void printNewline(Print* logOutput, int logLevel)
{
(void)logLevel; // unused
logOutput->print("\r\n");
logOutput->print("\n");
}
int printEspLog(const char* fmt, va_list args)
{
@ -101,7 +102,7 @@ Platform::preSetup()
Log.begin(LOG_LEVEL_TRACE, Static<MQTTTelemetry>::instance()->logPrinter());
Static<MQTTTelemetry>::instance()->setSequencer(Static<Sequencer>::instance());
#else
Log.begin(LOG_LEVEL_TRACE, &Serial);
Log.begin(LOG_LEVEL_TRACE, Static<SerialInput>::instance()->logPrinter());
#endif
Log.setSuffix(printNewline);
#endif