This sample runs the stress demo that comes with LVGL: one round of objects of every kind created, animated and deleted while others are still animating. It ends after the round, with the most memory LVGL had in use.
pbl samples samples/third_party/lvgl/stress
every board
#include <stdio.h>
#include <pbl/kernel/delay.h>
#include <demos/lv_demos.h>
#include <pbl_lvgl.h>
int main(void) {
lv_mem_monitor_t mem;
int ret;
ret = pbl_lvgl_init();
if (ret != 0) {
fprintf(stderr, "lvgl: init failed (%d)\n", ret);
return ret;
}
printf("lvgl: stress on %dx%d\n",
(int)lv_display_get_horizontal_resolution(pbl_lvgl_get_display()),
(int)lv_display_get_vertical_resolution(pbl_lvgl_get_display()));
/* The demos come with LVGL, each enabled by its CONFIG_LV_USE_DEMO_* option. */
lv_demo_stress();
/*
* One round creates and deletes every kind of object, with their animations. The demo is
* between two rounds until its first step runs.
*/
while (lv_demo_stress_finished()) {
pbl_sleep_ms(lv_timer_handler());
}
while (!lv_demo_stress_finished()) {
pbl_sleep_ms(lv_timer_handler());
}
lv_mem_monitor(&mem);
printf("lvgl: one round, at most %u bytes of memory used\n", (unsigned int)mem.max_used);
printf("Sample done\n");
return 0;
}
lvgl: stress on \d+x\d+
lvgl: one round, at most \d+ bytes of memory used
Sample done
Generated from PebbleOS 4bbc630fa. This page is maintained in the pebbleos repository: docs/samples/third_party/lvgl/stress.md.