移植littlevGL版本为7.0 基于linux fb运行
从littlevGL下载基于linux fb运行的littlevGL源码
https://github.com/lvgl/lv_port_linux_frame_buffer
使用cmake构建makefile 安装cmake
apt-get install cmake
在littlevGL目录下编写cmake配置文件CMakeLists.txt
cmake_minimum_required(VERSION 3.5)
project(Ui C)
#set(CMAKE_C_STANDARD 11)
SET(CROSS_COMPILE 1)
set(CMAKE_SYSTEM_NAME Linux)
#设置编译器 用buildroot里面的
set(CMAKE_C_COMPILER "/home/ljh/f1c100s/buildroot-2017.08/output/host/bin/arm-linux-gcc")
SET(TOOLCHAIN_DIR "/usr/bin/")
#SET(CMAKE_FIND_ROOT_PATH "/usr/arm-linux-gnueabi" "/usr/arm-linux-gnueabi/lib" "/usr/arm-linux-gnueabi/include")
#include_directories(/home/biglion/project/buildroot/rootfs/include)
#link_directories(/home/biglion/project/buildroot/rootfs/lib)
link_directories(/home/ljh/f1c100s/buildroot-2017.08/rootfs/lib)
#引入所有编译用到的源码目录
include_directories(
/home/ljh/f1c100s/buildroot-2017.08/rootfs/include
lv_drivers
lv_examples
lvgl
lv_drivers/display
lv_drivers/indev
lv_examples/assets
lv_examples/src/lv_demo_benchmark
lv_examples/src/lv_demo_keypad_encoder
lv_examples/src/lv_demo_printer
lv_examples/src/lv_demo_stress
lv_examples/src/lv_demo_widgets
lv_examples/src/lv_ex_get_started
lv_examples/src/lv_ex_style
lvgl/porting
lvgl/src/lv_core
lvgl/src/lv_draw
lvgl/src/lv_font
lvgl/src/lv_gpu
lvgl/src/lv_hal
lvgl/src/lv_misc
lvgl/src/lv_themes
lvgl/src/lv_widgets
lvgl/tests/lv_test_core
lvgl/tests/lv_test_objx
./
)
#通过源码目录 引入所有源文件 形成文件变量
aux_source_directory(lv_drivers LV_drivers)
aux_source_directory(lv_examples LV_examples)
aux_source_directory(lvgl LVgl)
aux_source_directory(lv_drivers/display DISPLAY)
aux_source_directory(lv_drivers/indev INDEV)
aux_source_directory(lv_examples/assets ASSETS)
aux_source_directory(lv_examples/src/lv_demo_benchmark BENCHMARK)
aux_source_directory(lv_examples/src/lv_demo_keypad_encoder ENCODER)
aux_source_directory(lv_examples/src/lv_demo_printer PRINTER)
aux_source_directory(lv_examples/src/lv_demo_stress STRESS)
aux_source_directory(lv_examples/src/lv_demo_widgets WIDGET)
aux_source_directory(lv_examples/src/lv_ex_get_started STARTED)
aux_source_directory(lv_examples/src/lv_ex_style STYLE)
aux_source_directory(lvgl/porting PORTING)
aux_source_directory(lvgl/src/lv_core CORE)
aux_source_directory(lvgl/src/lv_draw DRAW)
aux_source_directory(lvgl/src/lv_font FONT)
aux_source_directory(lvgl/src/lv_gpu GPU)
aux_source_directory(lvgl/src/lv_hal HAL)
aux_source_directory(lvgl/src/lv_misc MISC)
aux_source_directory(lvgl/src/lv_themes THEMES)
aux_source_directory(lvgl/src/lv_widgets WIDGETS)
aux_source_directory(lvgl/tests/lv_test_core TEST_CORE)
aux_source_directory(lvgl/tests/lv_test_objx TEST_OBJX)
aux_source_directory(lvgl LVgl)
aux_source_directory(./ CUR)
#引入所有要编译的源文件
add_executable(Ui
${LV_drivers}
${LV_examples}
${LVgl}
${DISPLAY}
${ASSETS}
${BENCHMARK}
${ENCODER}
${PRINTER}
${STRESS}
${WIDGET}
${STARTED}
${STYLE}
${PORTING}
${CORE}
${DRAW}
${FONT}
${GPU}
${HAL}
${MISC}
${THEMES}
${WIDGETS}
${TEST_CORE}
${TEST_OBJX}
${CUR}
)
注意:每次修改CmakeLists.txt时 最好删除目录下的CMakeCache.txt和CmakeFiles文件
形成Makefile文件
cmake .
编译
make
得到应用程序Ui
发送文件到f1c100s上执行即可看演示效果
发现左上角有闪动的光标 移除方法:
echo 0 > /sys/class/graphics/fbcon/cursor_blink
echo 0 > /sys/class/vtconsole/vtcon1/bind
离线