From 4b2f9af90ff3294ac2e4073c8356c22fb47f3306 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Wed, 19 May 2021 10:01:03 +0200 Subject: [PATCH] tests/disp_dev: improve screen cleanup speed --- tests/disp_dev/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/disp_dev/main.c b/tests/disp_dev/main.c index ab9e49f7cd..de40b10098 100644 --- a/tests/disp_dev/main.c +++ b/tests/disp_dev/main.c @@ -30,6 +30,9 @@ #include "ili9341.h" #endif +#define DISPLAY_BUFFER_MAX_SIZE (320) +static uint16_t display_buffer[DISPLAY_BUFFER_MAX_SIZE] = { 0 }; + int main(void) { /* Use the first screen */ @@ -52,11 +55,8 @@ int main(void) expect(max_height == 240); #endif - uint16_t color = 0; for (uint16_t y = 0; y < max_height; ++y) { - for (uint16_t x = 0; x < max_width; ++x) { - disp_dev_map(disp_dev->dev, x, x, y, y, &color); - } + disp_dev_map(disp_dev->dev, 0, max_width - 1, y, y, display_buffer); } disp_dev_map(disp_dev->dev, 95, 222, 85, 153, (const uint16_t *)picture);