From 5017babb307122d8567ca78a5721e96c4d7ff8f2 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Sun, 6 Nov 2016 00:12:04 +0100 Subject: nwztools/plattools: fix black screen issue in dualboot, rework dualboot Sony added extensions to the frambuffer interface. It is important to take them into account since the OF uses them and might leave the framebuffer in an unusual state which would make the dualboot not display anything. Also rework the dualboot code so that it can boot rockbox (not doing anything at the moment), display all tools or boot the OF. Change-Id: Ia0f589c9ec8558f375270841503c0964aff07f0b --- utils/nwztools/plattools/test_display.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'utils/nwztools/plattools/test_display.c') diff --git a/utils/nwztools/plattools/test_display.c b/utils/nwztools/plattools/test_display.c index 1ebf40e813..0a8089eca9 100644 --- a/utils/nwztools/plattools/test_display.c +++ b/utils/nwztools/plattools/test_display.c @@ -25,7 +25,27 @@ int NWZ_TOOL_MAIN(test_display)(int argc, char **argv) { /* clear screen and display welcome message */ nwz_lcdmsg(true, 0, 0, "test_display"); - nwz_lcdmsg(false, 3, 10, "This program will stop in 5 seconds"); - sleep(5); + nwz_lcdmsg(false, 0, 1, "BACK: quit"); + /* wait for key */ + int input_fd = nwz_key_open(); + if(input_fd < 0) + { + sleep(2); + return 1; + } + while(1) + { + /* wait for event */ + int ret = nwz_key_wait_event(input_fd, 1000000); + if(ret != 1) + continue; + struct input_event evt; + if(nwz_key_read_event(input_fd, &evt) != 1) + continue; + /* handle quit */ + if(nwz_key_event_get_keycode(&evt) == NWZ_KEY_BACK && !nwz_key_event_is_press(&evt)) + break; + } + nwz_key_close(input_fd); return 0; } -- cgit v1.2.3