Skip to content

Commit

Permalink
Add test disp.lvgl
Browse files Browse the repository at this point in the history
  • Loading branch information
Swung0x48 committed Jan 26, 2025
1 parent 3170822 commit 31fc780
Show file tree
Hide file tree
Showing 3,382 changed files with 1,377,052 additions and 0 deletions.
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

0 comments on commit 31fc780

Please sign in to comment.