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

tests/drivers/st77xx: add benchmarking

This commit is contained in:
Gunar Schorcht 2023-07-30 16:16:33 +02:00
parent eb9515132c
commit 391f303d41
3 changed files with 14 additions and 4 deletions

View File

@ -23,6 +23,7 @@ endif
DRIVER ?= st7735
USEMODULE += $(DRIVER)
USEMODULE += benchmark
USEMODULE += ztimer
USEMODULE += ztimer_msec

View File

@ -1,5 +1,6 @@
# this file enables modules defined in Kconfig. Do not use this file for
# application configuration. This is only needed during migration.
CONFIG_MODULE_BENCHMARK=y
CONFIG_MODULE_ST77XX=y
CONFIG_MODULE_ZTIMER=y
CONFIG_MODULE_ZTIMER_MSEC=y

View File

@ -23,6 +23,7 @@
#include <stdio.h>
#include "timex.h"
#include "ztimer.h"
#include "benchmark.h"
#include "board.h"
#include "lcd.h"
#include "lcd_internal.h"
@ -92,14 +93,21 @@ int main(void)
lcd_invert_off(&dev);
puts("lcd TFT display normal");
puts("lcd TFT display clear screen");
lcd_fill(&dev, 0, dev.params->lines, 0, dev.params->rgb_channels, 0x0000);
puts("lcd TFT display clear screen with benchmarking");
BENCHMARK_FUNC("fill", 1,
lcd_fill(&dev, 0, dev.params->lines, 0, dev.params->rgb_channels, 0x0000));
#ifndef CONFIG_NO_RIOT_IMAGE
printf("Write pixmap of size %u x %u with benchmarking\n",
RIOT_LOGO_WIDTH, RIOT_LOGO_HEIGHT);
/* Approximate middle of the display */
uint8_t x1 = (dev.params->lines / 2) - (RIOT_LOGO_WIDTH / 2);
uint8_t y1 = (dev.params->rgb_channels / 2) - (RIOT_LOGO_HEIGHT / 2);
lcd_pixmap(&dev, x1, x1 + RIOT_LOGO_WIDTH - 1, y1, y1 + RIOT_LOGO_HEIGHT - 1,
(const uint16_t *)picture);
BENCHMARK_FUNC("fill", 1,
lcd_pixmap(&dev,
x1, x1 + RIOT_LOGO_WIDTH - 1,
y1, y1 + RIOT_LOGO_HEIGHT - 1,
(const uint16_t *)picture));
#endif
while (1) {}