Browse Source

Remove limit to debug message length

i18n
Xose Pérez 6 years ago
parent
commit
fce278489e
2 changed files with 6 additions and 7 deletions
  1. +0
    -1
      code/espurna/config/general.h
  2. +6
    -6
      code/espurna/debug.ino

+ 0
- 1
code/espurna/config/general.h View File

@ -90,7 +90,6 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// General debug options and macros // General debug options and macros
#define DEBUG_FORMAT_MAX_LENGTH 80
#define DEBUG_SUPPORT DEBUG_SERIAL_SUPPORT || DEBUG_UDP_SUPPORT || DEBUG_TELNET_SUPPORT #define DEBUG_SUPPORT DEBUG_SERIAL_SUPPORT || DEBUG_UDP_SUPPORT || DEBUG_TELNET_SUPPORT
#if DEBUG_SUPPORT #if DEBUG_SUPPORT


+ 6
- 6
code/espurna/debug.ino View File

@ -55,17 +55,17 @@ void debugSend(const char * format, ...) {
} }
void debugSend_P(PGM_P format, ...) {
void debugSend_P(PGM_P format_P, ...) {
char f[DEBUG_FORMAT_MAX_LENGTH+1];
memcpy_P(f, format, DEBUG_FORMAT_MAX_LENGTH);
char format[strlen_P(format_P)+1];
memcpy_P(format, format_P, sizeof(format));
va_list args; va_list args;
va_start(args, format);
va_start(args, format_P);
char test[1]; char test[1];
int len = ets_vsnprintf(test, 1, f, args) + 1;
int len = ets_vsnprintf(test, 1, format, args) + 1;
char * buffer = new char[len]; char * buffer = new char[len];
ets_vsnprintf(buffer, len, f, args);
ets_vsnprintf(buffer, len, format, args);
va_end(args); va_end(args);
#if DEBUG_SERIAL_SUPPORT #if DEBUG_SERIAL_SUPPORT


Loading…
Cancel
Save