Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test disp.lvgl #961

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
25 changes: 25 additions & 0 deletions tests/disp/lvgl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
cmake_minimum_required(VERSION 3.28)
project(lvgl_port_gl C)

set(CMAKE_C_STANDARD 99)

add_subdirectory(lvgl)

add_executable(lvgl_port_gl
porting/lv_port_disp.c
porting/lv_port_fs.c
porting/lv_port_indev.c
main.c
/workspace/share/main.S)

set_source_files_properties(foo.cpp PROPERTIES COMPILE_FLAGS "-T /workspace/share/t1.ld")

#find_package(glfw3 3.4.0 EXACT REQUIRED PATHS /opt/homebrew/Cellar/glfw/3.4/lib/cmake/glfw3)
#find_package(OpenGL REQUIRED)

target_link_libraries(lvgl_port_gl PRIVATE lvgl)
#target_link_libraries(lvgl_port_gl PRIVATE glfw3)
#target_link_libraries(lvgl_port_gl PRIVATE OpenGL::GL)

#target_include_directories(lvgl_port_gl PRIVATE /opt/homebrew/Cellar/glfw/3.4/include)
#target_link_libraries(lvgl_port_gl PRIVATE /opt/homebrew/Cellar/glfw/3.4/lib/libglfw.dylib)
38 changes: 38 additions & 0 deletions tests/disp/lvgl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# disp.lvgl

This is an example of running lvgl on T1.

## Build & Run instructions

```
# Create a directory for compiling
cd /workspace/examples/disp.lvgl # Should be the directory where this README lives
mkdir build && cd build

# Generate build files using cmake
cmake .. \
-DLV_CONF_BUILD_DISABLE_DEMOS=TRUE \
-DLV_CONF_BUILD_DISABLE_EXAMPLES=TRUE \
-DLV_CONF_BUILD_DISABLE_THORVG_INTERNAL=TRUE \
-DT1_PLATFORM=TRUE \
-DCMAKE_TOOLCHAIN_FILE=../toolchain.cmake

# Build using make
make -j$(nproc)

# Since T1's elf need a special entry point, manually link a new elf here.
# (This should be done in cmake, though I haven't invest in time to figure it out)
t1-cc -T /workspace/share/t1.ld /workspace/share/main.S \
../main.c \
-DLV_CONF_INCLUDE_SIMPLE -DLV_LVGL_H_INCLUDE_SIMPLE \
-isystem /workspace/examples/disp.lvgl/lvgl \
-isystem /workspace/examples/disp.lvgl/build/lvgl \
CMakeFiles/lvgl_port_gl.dir/porting/lv_port_disp.c.obj \
CMakeFiles/lvgl_port_gl.dir/porting/lv_port_fs.c.obj \
CMakeFiles/lvgl_port_gl.dir/porting/lv_port_indev.c.obj \
lvgl/lib/liblvgl.a \
-o lvgl.elf

# Run the elf binary through emulator
t1rocketemu-verilated-simulator +t1_elf_file=lvgl.elf
```
Loading