Fix badram error display (issue #7)

This commit is contained in:
Martin Whitaker 2021-07-18 19:26:23 +01:00
parent 6a0c7943d9
commit a4bbabeeb4
2 changed files with 7 additions and 8 deletions

View File

@ -196,8 +196,11 @@ void badram_display(void)
}
check_input();
scroll();
clear_message_area();
display_pinned_message(0, 0, "BadRAM Patterns");
display_pinned_message(1, 0, "---------------");
scroll();
display_scrolled_message(0, "badram=");
int col = 7;
for (int i = 0; i < num_patterns; i++) {
@ -205,12 +208,12 @@ void badram_display(void)
display_scrolled_message(col, ",");
col++;
}
int text_width = 2 * (TESTWORD_DIGITS + 3);
int text_width = 2 * (TESTWORD_DIGITS + 2) + 1;
if (col > (SCREEN_WIDTH - text_width)) {
scroll();
col = 7;
}
display_scrolled_message(col, "0x0*x,0x0*x",
display_scrolled_message(col, "0x%0*x,0x%0*x",
TESTWORD_DIGITS, pattern[i].addr,
TESTWORD_DIGITS, pattern[i].mask);
col += text_width;

View File

@ -152,6 +152,7 @@ static void common_err(error_type_t type, uintptr_t addr, testword_t good, testw
bool new_header = (error_count == 0) || (error_mode != last_error_mode);
if (new_header) {
clear_message_area();
badram_init();
}
last_error_mode = error_mode;
@ -284,11 +285,6 @@ static void common_err(error_type_t type, uintptr_t addr, testword_t good, testw
break;
case ERROR_MODE_BADRAM:
if (new_header) {
display_pinned_message(0, 0, "BadRAM Patterns");
display_pinned_message(0, 1, "---------------");
badram_init();
}
if (new_badram) {
badram_display();
}