smartpanle / QMSD-ESP32-BSP

qmsd-esp32-bsp includes screen drivers, touch functionality, and UI framework, making it convenient for users to develop applications on the panlee development board.
MIT License
14 stars 5 forks source link

Running LVGL on a separate esp32S3 core #5

Open Hooba97 opened 2 months ago

Hooba97 commented 2 months ago

I am creating a UI using squareline(lvgl)

ZX7D00CE01S-8048 has an esp32 s3 with 2 cores

I am relatively new to esp-idf and my main code might get extensive

I am running Wifi,MQTT, an ADC , PWM full gpio And other tasks

I saw somewhere that it'd be better to run the UI on a separate core as lvgl task handle is sensitive

Since QMSD_ESP32_BSP has lvgl driver embedded I am not sure how to run the UI on a separate core using RTOS

Please advise

EeeeBin commented 2 months ago
  1. LVGL runs in a separate thread. For more details, refer to qmsd_gui_lvgl_v8.c.

  2. If you need to interact with other peripherals through the UI, there are a couple of ways to do this:

    • (1) Execute LVGL-related code only within LVGL’s callback functions. In these callbacks, query the peripheral's status and update the display accordingly. The callbacks can be tied to lv_timer timers. Be sure to ensure that the peripheral’s APIs are thread-safe.
    • (2) If you need to call LVGL-related code from other threads, you must surround the code with qmsd_gui_lock and qmsd_gui_unlock to ensure thread safety for LVGL operations.