Skip to content

esp-arduino-libs/esp-brookesia-simulator_vscode

Repository files navigation

ESP-Brookesia PC VSCode Simulator

Build Test Application

Table of Contents

Overview

The esp-brookesia-simulator_vscode is a VSCode project that can run LVGL and ESP-Brookesia on a PC, simulating the system UI of ESP-Brookesia, which facilitates users in debugging styles and apps.

The esp-brookesia-simulator_vscode is a port and modification based on lv_port_pc_vscode to support compiling C++ files.

Note

It has been tested that esp-brookesia-simulator_vscode can run on Linux, MacOS, Windows, and Windows WSL platforms.

Installing Dependencies

Windows

It is recommended that users install gcc, gdb, cmake, make, and sdl2 through MSYS2. Below are the installation steps for a 64-bit Windows system:

  1. Download (Official Link / Mirror Link) and install MSYS2.

  2. Open the MSYS2 MINGW64 terminal and execute the following commands:

pacman -Syu
pacman -S --needed mingw-w64-x86_64-toolchain mingw-w64-x86_64-SDL2 mingw-w64-x86_64-cmake
  1. Add the path C:\<install_path>\msys64\mingw64\bin to the system environment variable PATH (where <install_path> is the installation path of the software).

Linux

Users can directly install gcc, gdb, cmake, make, and sdl2 through the terminal:

sudo apt-get update && sudo apt-get install -y gcc gdb cmake make build-essential libsdl2-dev

Usage

  1. Clone the project and related submodules:
git clone --recursive https://github.com/esp-arduino-libs/esp-brookesia-simulator_vscode
  1. Double-click to open the VSCode workspace file simulator.code-workspace to open the project.

Warning

Please use the workspace file to open the project, as it contains all the configurations for compiling and debugging. Otherwise, you will not be able to compile and debug directly using the F5 key.

  1. Press F5 to build and debug, at which point the system UI of ESP-Brookesia should appear in a new window. Meanwhile, users can access all debugging features of VSCode through GDB.

  2. Adjust project configuration

    • Modify the definition in the CMakeLists.txt file to adjust the display window resolution:
    set(DISP_DEF "-DDISP_HOR_RES=1024 -DDISP_VER_RES=600")  # Resolution of the display

Note

A global definition SIMULATOR=1 has been added to CMakeLists.txt for temporary modifications between the simulator and device code.

  1. Add custom stylesheets and apps

    • By default, the project will compile .c and .cpp files under the components/esp-brookesia-app directory and include this directory as a header file directory. Users can place custom apps in this directory.
    • By default, the project will compile .c and .cpp files under the components/esp-brookesia-stylesheet directory and include this directory as a header file directory. Users can place custom stylesheets in this directory.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published