Harmonize definition ins core (#628)

This commit is contained in:
Olivier
2016-11-05 09:50:18 +01:00
committed by Embedded Innovation
parent e77f3c06cd
commit c6ff9122b4
7 changed files with 27 additions and 30 deletions
+4 -4
View File
@@ -160,7 +160,7 @@ uint16_t hwFreeMem() {
#ifdef MY_DEBUG
void hwDebugPrint(const char *fmt, ... ) {
if (MY_SERIALDEVICE) {
char fmtBuffer[MY_DEBUG_BUFFER_SIZE];
char fmtBuffer[MY_SERIAL_OUTPUT_SIZE];
#ifdef MY_GATEWAY_FEATURE
// prepend debug message to be handled correctly by controller (C_INTERNAL, I_LOG_MESSAGE)
snprintf(fmtBuffer, sizeof(fmtBuffer), PSTR("0;255;%d;0;%d;"), C_INTERNAL, I_LOG_MESSAGE);
@@ -170,9 +170,9 @@ void hwDebugPrint(const char *fmt, ... ) {
va_start (args, fmt );
#ifdef MY_GATEWAY_FEATURE
// Truncate message if this is gateway node
vsnprintf(fmtBuffer, 60, fmt, args);
fmtBuffer[59] = '\n';
fmtBuffer[60] = '\0';
vsnprintf(fmtBuffer, sizeof(fmtBuffer), fmt, args);
fmtBuffer[sizeof(fmtBuffer) - 2] = '\n';
fmtBuffer[sizeof(fmtBuffer) - 1] = '\0';
#else
vsnprintf(fmtBuffer, sizeof(fmtBuffer), fmt, args);
#endif