From 95b68797ff9008a286e4e38ebdaedc39202d5521 Mon Sep 17 00:00:00 2001 From: Marcus Comstedt Date: Fri, 21 May 2021 13:59:58 +0200 Subject: [PATCH] Fix key polling code in test_display_on_resolution The old code would switch to the next picture after 10 ms is no key was pressed, which looked very bad. --- sample/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sample/main.c b/sample/main.c index 6c5e76e..a734a69 100644 --- a/sample/main.c +++ b/sample/main.c @@ -727,9 +727,8 @@ void test_display_on_resolution(int fd, uint32_t width, uint32_t height) if (++index >= num_bmp) index = 0; - if (kbhit() == 0) { + while (kbhit() == 0) { usleep(1000*10); // sleep for 10 ms - continue; } c = getchar();