@@ -46,17 +46,7 @@ enum SerLoggingLevel {
4646
4747#if defined(__MBED__) && !defined(BUILD_FOR_PICO_CMAKE) && !defined(ARDUINO_ARCH_MBED)
4848#define LOGGING_USES_MBED
49- #elif !defined(BUILD_FOR_PICO_CMAKE)
50- #include < Arduino.h>
51- #endif
52-
53- #ifdef IO_LOGGING_DEBUG
54-
55-
56- /* * This uint16_t stores the enabled logging levels, don't use directly */
57- extern unsigned int enabledLevels;
58-
59- #ifdef LOGGING_USES_MBED
49+ #include < mbed.h>
6050
6151#include " PrintCompat.h"
6252#include < FileHandle.h>
@@ -87,10 +77,14 @@ unsigned long millis();
8777#define F (x ) x
8878#define IOLOG_MBED_PORT_IF_NEEDED (tx, rx ) BufferedSerial serPort (tx, rx);MBedLogger LoggingPort (serPort);
8979#define IOLOG_START_SERIAL serPort.set_baud(115200 );
80+ unsigned long millis ();
81+ unsigned long micros ();
9082#elif defined(BUILD_FOR_PICO_CMAKE)
9183#include " PrintCompat.h"
92- #include < cstring>
84+ #include < string.h>
85+ #include < ctype.h>
9386#include < pico/time.h>
87+ #include < hardware/uart.h>
9488#ifdef BUILD_PICO_FORCE_UART
9589class PrintfLogger : public Print {
9690private:
@@ -123,8 +117,9 @@ class PrintfLogger : public Print {
123117};
124118#define IOLOG_START_SERIAL stdio_init_all ();
125119#endif
120+ unsigned long millis ();
121+ unsigned long micros ();
126122extern PrintfLogger LoggingPort;
127- unsigned long millis (); // available from task manager
128123#define F (x ) x
129124#define IOLOG_MBED_PORT_IF_NEEDED (tx, rx )
130125#else
@@ -138,6 +133,12 @@ unsigned long millis(); // available from task manager
138133#define IOLOG_MBED_PORT_IF_NEEDED (tx, rx )
139134#endif
140135
136+ #ifdef IO_LOGGING_DEBUG
137+
138+
139+ /* * This uint16_t stores the enabled logging levels, don't use directly */
140+ extern unsigned int enabledLevels;
141+
141142const char * prettyLevel (SerLoggingLevel level);
142143#define logTimeAndLevel (title, lvl ) LoggingPort.print(millis());LoggingPort.print(' -' );LoggingPort.print(prettyLevel(lvl));LoggingPort.print(' :' );LoggingPort.print(title)
143144
@@ -216,9 +217,6 @@ inline void serdebugHexDump(const char *title, const void* data, size_t len) { s
216217
217218#define startTaskManagerLogDelegate ()
218219
219- #define IOLOG_START_SERIAL
220- #define IOLOG_MBED_PORT_IF_NEEDED (tx, rx )
221-
222220#define serEnableLevel (l, a )
223221#define serLevelEnabled (l ) false
224222#endif // IO_LOGGING_DEBUG
0 commit comments