pebble
  • Tutorials
  • Get the SDK
  • Guides
  • Documentation
  • PebbleOS
  • Mobile App
  • Examples
  • Index 01
  • Community
  • Blog
  • More
Privacy
Cookies
Publish

PebbleOS

  • Overview
  • Start here
    • Getting started guide
    • Playground
  • Development
    • The pbl CLI
    • Build system
    • Samples
      • Kernel
      • Subsystems
      • Drivers
      • Third-party
      • Rust
      • Benchmarks
    • Emulator and simulator
    • Testing
    • Debugging
    • Conventions
  • System
    • Architecture overview
    • Kernel
    • Subsystems
    • Drivers
    • Services
    • Libraries
    • Third-party
    • Application SDK
  • Hardware
    • Boards
    • Programmers
  • Community
    • Contribution Guidelines
  • Reference
    • Reference
    • Kconfig options

LVGL: Stress

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.

Run:

pbl samples samples/third_party/lvgl/stress

Boards:

every board

Sources

src/main.c
#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;
}

Output

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.

Overview

  • Sources
  • Output