Make debug prints portable (#929)

This commit is contained in:
Olivier
2017-09-17 20:54:20 +02:00
committed by Henrik Ekblad
parent 9e5a1e32cb
commit 0ed558f1d0
18 changed files with 173 additions and 124 deletions
+3 -1
View File
@@ -317,7 +317,7 @@ void hwDebugPrint(const char *fmt, ... )
char fmtBuffer[MY_SERIAL_OUTPUT_SIZE];
#ifdef MY_GATEWAY_SERIAL
// prepend debug message to be handled correctly by controller (C_INTERNAL, I_LOG_MESSAGE)
snprintf_P(fmtBuffer, sizeof(fmtBuffer), PSTR("0;255;%d;0;%d;%lu "),
snprintf_P(fmtBuffer, sizeof(fmtBuffer), PSTR("0;255;%" PRIu8 ";0;%" PRIu8 ";%" PRIu32 " "),
C_INTERNAL, I_LOG_MESSAGE, hwMillis());
MY_SERIALDEVICE.print(fmtBuffer);
#else
@@ -336,5 +336,7 @@ void hwDebugPrint(const char *fmt, ... )
va_end (args);
MY_SERIALDEVICE.print(fmtBuffer);
MY_SERIALDEVICE.flush();
#else
(void)fmt;
#endif
}