Skip to content

Commit ee1271b

Browse files
authored
Merge pull request #403 from devunwired/esp-log-support
Add ESP_LOG support in platform
2 parents 5cfcc02 + a30629e commit ee1271b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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_log_write(ESP_LOG_INFO, "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)