Add missing undefined symbols to be sure to use mine
Dependents: DS130x_I2CApp MCP41xxxApp FM24Vxx_I2CApp MCP320xApp ... more
Diff: Debug.cpp
- Revision:
- 7:e10debbe8dad
- Parent:
- 6:14a596126adf
- Child:
- 9:a11adabe9ded
--- a/Debug.cpp Thu Dec 09 09:28:06 2010 +0000 +++ b/Debug.cpp Fri Dec 10 08:05:46 2010 +0000 @@ -3,7 +3,7 @@ #ifdef __DEBUG -#define __LINE_LENGTH__ 91 +#define __LINE_LENGTH__ 93 void DebugHelper::Debug(const char* p_format, ...) { va_list argp; @@ -21,11 +21,12 @@ // Display header printf(" HEX | 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F : 0 1 2 3 4 5 6 7 8 9 A B C D E F \r\n"); printf("-----|+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-:--+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\r\n"); - // 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + // 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901 2 // 0 1 2 3 4 5 6 7 8 9 // Address offset padding - char line[__LINE_LENGTH__]; + char line[__LINE_LENGTH__ + 1]; memset(line, 0x20, __LINE_LENGTH__); + line[__LINE_LENGTH__] = 0x00; // NULL character sprintf(line, "%04x |", (unsigned short)startAddress); line[6] = 0x20; // Remove NULL character added by sprintf int idx = 0; @@ -51,8 +52,8 @@ } // Display the line line[56] = ':'; - line[__LINE_LENGTH__ - 2] = 0x0d; - line[__LINE_LENGTH__ - 1] = 0x0a; + line[__LINE_LENGTH__ - 1] = 0x0d; + line[__LINE_LENGTH__] = 0x0a; printf(line); if (currentIdx < endOfDump) { // Prepare next line, one line = 16 digits startAddress += 16;