Display test added

master
erikkaashoek 5 years ago
parent e1d19d79c4
commit d87d2a2e07

@ -540,6 +540,7 @@ float get_trace_scale(int t);
float get_trace_refpos(int t);
const char *get_trace_typename(int t);
extern int in_selftest;
extern int display_test(void);
//
// Shell config functions and macros

@ -2386,6 +2386,27 @@ redraw_frame(void)
draw_cal_status();
}
int display_test(void)
{
// return true;
// write and read display, return false on fail.
for (int h = 0; h < LCD_HEIGHT; h++) {
for (int w = 0; w < LCD_WIDTH; w++) {
spi_buffer[w] = ((w*h) & 0xfff);
}
ili9341_bulk(0, h, LCD_WIDTH, 1);
for (int w = 0; w < LCD_WIDTH; w++) {
spi_buffer[w] = 0;
}
ili9341_read_memory(0, h, LCD_WIDTH, 1, LCD_WIDTH, spi_buffer);
for (int volatile w = 0; w < LCD_WIDTH; w++) {
if (spi_buffer[w] != ((w*h) & 0xfff))
return false;
}
}
return true;
}
//#define _USE_WATERFALL_PALETTE
#ifdef _USE_WATERFALL_PALETTE
#include "waterfall.c"

@ -3219,6 +3219,15 @@ void self_test(int test)
if (setting.test_argument > 0)
test_step=setting.test_argument-1;
do {
if (test_step == 0) {
if (!display_test()) {
test_step = TEST_END;
show_test_info = FALSE;
ili9341_set_foreground(LCD_BRIGHT_COLOR_RED);
ili9341_drawstring_7x13("Display read fails", 30, 140);
goto resume2;
}
}
test_prepare(test_step);
test_acquire(test_step); // Acquire test
test_status[test_step] = test_validate(test_step); // Validate test

Loading…
Cancel
Save

Powered by TurnKey Linux.