Skip to content

Commit c6440c0

Browse files
committed
Add ESP_LOG support.
Update the platform logging to use the ESP_LOGx macros when MO_PLATFORM is set to MO_PLATFORM_ESPIDF.
1 parent 0455ec0 commit c6440c0

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/MicroOcpp/Platform.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ MO_EXTERN_C void mocpp_set_console_out(void (*console_out)(const char *msg));
6969
#endif
7070

7171
#define MO_CONSOLE_PRINTF(X, ...) MO_USE_SERIAL.printf_P(PSTR(X), ##__VA_ARGS__)
72-
#elif MO_PLATFORM == MO_PLATFORM_ESPIDF || MO_PLATFORM == MO_PLATFORM_UNIX
72+
#elif MO_PLATFORM == MO_PLATFORM_ESPIDF
73+
#include "esp_log.h"
74+
75+
#define MO_CONSOLE_PRINTF(X, ...) ESP_LOGI("MicroOcpp", X, ##__VA_ARGS__)
76+
#elif MO_PLATFORM == MO_PLATFORM_UNIX
7377
#include <stdio.h>
7478

7579
#define MO_CONSOLE_PRINTF(X, ...) printf(X, ##__VA_ARGS__)

0 commit comments

Comments
 (0)