Make debug prints portable (#929)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* The MySensors Arduino library handles the wireless radio link and protocol
|
||||
* between your home built sensors/actuators and HA controller of choice.
|
||||
* The sensors forms a self healing radio network with optional repeaters. Each
|
||||
@@ -173,8 +173,8 @@ 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 "), C_INTERNAL, I_LOG_MESSAGE,
|
||||
hwMillis());
|
||||
snprintf_P(fmtBuffer, sizeof(fmtBuffer), PSTR("0;255;%" PRIu8 ";0;%" PRIu8 ";%" PRIu32 " "),
|
||||
C_INTERNAL, I_LOG_MESSAGE, hwMillis());
|
||||
MY_SERIALDEVICE.print(fmtBuffer);
|
||||
#else
|
||||
// prepend timestamp
|
||||
@@ -194,5 +194,7 @@ void hwDebugPrint(const char *fmt, ...)
|
||||
// Disable flush since current STM32duino implementation performs a reset
|
||||
// instead of an actual flush
|
||||
//MY_SERIALDEVICE.flush();
|
||||
#else
|
||||
(void)fmt;
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user