diff --git a/tests/disp_dev/main.c b/tests/disp_dev/main.c index b903af65f5..351181344b 100644 --- a/tests/disp_dev/main.c +++ b/tests/disp_dev/main.c @@ -60,16 +60,20 @@ int main(void) expect(max_height == 240); #endif + disp_dev_area_t area; for (uint16_t y = 0; y < max_height; ++y) { - disp_dev_map(disp_dev->dev, 0, max_width - 1, y, y, display_buffer); + area.x1 = 0; + area.x2 = max_width - 1; + area.y1 = y; + area.y2 = y; + disp_dev_map(disp_dev->dev, &area, display_buffer); } - disp_dev_map( - disp_dev->dev, - ((max_width - RIOT_LOGO_WIDTH) >> 1), ((max_width + RIOT_LOGO_WIDTH) >> 1) - 1, - ((max_height - RIOT_LOGO_HEIGHT) >> 1), ((max_height + RIOT_LOGO_HEIGHT) >> 1) - 1, - (const uint16_t *)picture - ); + area.x1 = ((max_width - RIOT_LOGO_WIDTH) >> 1); + area.x2 = ((max_width + RIOT_LOGO_WIDTH) >> 1); + area.y1 = ((max_height - RIOT_LOGO_HEIGHT) >> 1); + area.y2 = ((max_height + RIOT_LOGO_HEIGHT) >> 1); + disp_dev_map(disp_dev->dev, &area, (const uint16_t *)picture); puts("SUCCESS"); diff --git a/tests/pkg_qr-code-generator/main.c b/tests/pkg_qr-code-generator/main.c index f387dbdbea..a885098635 100644 --- a/tests/pkg_qr-code-generator/main.c +++ b/tests/pkg_qr-code-generator/main.c @@ -79,8 +79,12 @@ int main(void) const uint8_t h_offset = (disp_dev_height(disp_dev->dev) - (size * scale)) / 2; /* Clear the screen */ + disp_dev_area_t area; for (uint16_t y = 0; y < disp_dev_height(disp_dev->dev); y ++) { - disp_dev_map(disp_dev->dev, 0, disp_dev_width(disp_dev->dev) - 1, y, y, display_buffer); + area.x1 = 0; + area.x2 = disp_dev_width(disp_dev->dev) - 1; + area.y1 = area.y2 = y; + disp_dev_map(disp_dev->dev, &area, display_buffer); } /* Prepare a subset of the display buffer for white tiles */ @@ -95,10 +99,11 @@ int main(void) for (int x = 0; x < size; x++) { #ifdef MODULE_DISP_DEV if (qrcodegen_getModule(qr0, x, y)) { - disp_dev_map(disp_dev->dev, - w_offset + (x * scale), w_offset + ((x + 1)* scale) - 1, - h_offset + (y * scale), h_offset + ((y + 1)* scale) - 1, - display_buffer); + area.x1 = w_offset + (x * scale); + area.x2 = w_offset + ((x + 1)* scale) - 1; + area.y1 = h_offset + (y * scale); + area.y2 = h_offset + ((y + 1)* scale) - 1; + disp_dev_map(disp_dev->dev, &area, display_buffer); } #endif printf("%s", qrcodegen_getModule(qr0, x, y) ? "██" : " ");