1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

tests: adapt to new disp_dev area coordinates

This commit is contained in:
Alexandre Abadie 2022-04-12 14:33:58 +02:00
parent 757894e395
commit a16449f301
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
2 changed files with 21 additions and 12 deletions

View File

@ -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");

View File

@ -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) ? "██" : " ");