Fix linefeed issues in crash dump output

pull/6257/head
Senthil Ramakrishnan 2018-03-05 15:26:01 -06:00
parent a6e27b1b86
commit 06f5fbc75d
1 changed files with 6 additions and 10 deletions

View File

@ -194,17 +194,13 @@ void fault_print_str(char *fmtstr, uint32_t *values)
char hex_str[9]={0};
while(fmtstr[i] != '\0') {
if(fmtstr[i] == '\n' || fmtstr[i] == '\r') {
serial_putc(&stdio_uart, '\r');
} else {
if(fmtstr[i]=='%') {
hex_to_str(values[vidx++],hex_str);
for(idx=7; idx>=0; idx--) {
serial_putc(&stdio_uart, hex_str[idx]);
}
} else {
serial_putc(&stdio_uart, fmtstr[i]);
if(fmtstr[i]=='%') {
hex_to_str(values[vidx++],hex_str);
for(idx=7; idx>=0; idx--) {
serial_putc(&stdio_uart, hex_str[idx]);
}
} else {
serial_putc(&stdio_uart, fmtstr[i]);
}
i++;
}