BugFix v trace_dump - spravne pouziti flashString
This commit is contained in:
parent
031da04f36
commit
76d19c8ccd
@ -229,14 +229,18 @@ void trace_dump(uint8_t severity, const char *prefix, uint8_t *address, size_t s
|
||||
print(severity, buffer, idx);
|
||||
}
|
||||
|
||||
// TODO: POZOR!!! tady si nejsem jisty, zda je spravne pouziti __FlashStringHelperu v snprintf_P !!!!
|
||||
void trace_dump(uint8_t severity, const __FlashStringHelper *prefix, uint8_t *address, size_t size)
|
||||
{
|
||||
char buffer[MAX_LINE_LEN + 1 + 3];
|
||||
int idx = 0;
|
||||
|
||||
if (prefix)
|
||||
idx = snprintf_P(buffer, MAX_LINE_LEN, PSTR("%s"), prefix);
|
||||
{
|
||||
char dummy[64];
|
||||
|
||||
strcpy_P(dummy, (const char *)prefix);
|
||||
idx = snprintf_P(buffer, MAX_LINE_LEN, PSTR("%s"), dummy);
|
||||
}
|
||||
|
||||
while ((idx < MAX_LINE_LEN) && size)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user