当前位置:网站首页>Allwinner V853 development board transplants LVGL-based 2048 games
Allwinner V853 development board transplants LVGL-based 2048 games
2022-08-10 15:33:00 【51CTO】
项目源码获取: V853 Tina_LVGL Download
LVGL 开发实战
移植基于 LVGL 的 2048 小游戏
This section will start with an already written one lvgl
小游戏 2048
Describe how it will have been written lvgl
The program is ported to the development board.
这里使用的 2048
Mini-games are provided by Baiwen.com,开源地址: lv_lib_100ask
Prepare scaffolding
在这之前,Let's prepare the basics first LVGL 脚手架.可以直接从 lv_g2d_test
Copy and modify it.
First we copy the source code,在 platform/thirdparty/gui/lvgl-8
源码文件夹里,把 红色箭头 所指的 lv_g2d_test
The source code is copied to as a template Pointed by the yellow arrow lv_2048
文件夹里.
如下图所示,and clean up res
资源文件夹,
同样的,Make a copy of the index file,找到 openwrt/package/thirdparty/gui/lvgl-8
并把 lv_g2d_test
复制一份重命名为 lv_2048
作为我们 2048
The index used by the minigame.
Quick access to scaffolding: lv_g2d_test.file
并编辑 Makefile
,修改文件名称,把 lv_g2d_test
Modified here lv_2048
After the scaffolding is completed,可以 make menuconfig
Check to see if it appears lv_2048
这个选项,选中它.
修改源码
The second step is to modify the source code.Edited copied before main.c
文件,把不需要的 lv_g2d_test
的部分删去.Keep the most basic parts.
Next is the connection lv_lib_100ask
与 2048
小游戏,我们先下载 lv_lib_100ask
的源码,放置到 platform/thirdparty/gui/lvgl-8/lv_2048
的 src
文件夹里.并按照 lv_lib_100ask
的说明,复制一份 lv_lib_100ask_conf_template.h
到 src
目录,并改名为 lv_lib_100ask_conf.h
编辑 lv_lib_100ask_conf.h
,Enables references to the entire library,并配置启用 LV_USE_100ASK_2048
.为了简洁,Unnecessary configuration items are removed here.
再编辑 platform/thirdparty/gui/lvgl-8/lv_2048/src/lv_lib_100ask/lv_lib_100ask.h
中的版本号,修改为 (8,1,0)
之后在 main.c
里修改,对接 lv_100ask_2048_simple_test
,具体如下.
(1)头文件加入 lv_lib_100ask/lv_lib_100ask.h
(2)在 main
Add an interface call to the function
完整的 main.c
如下
然后就是 Makefile
修改,增加一个 lv_lib_100ask
的 SRC 引用.
顺便也把 BIN
改为 lv_2048
,完整的 Makefile
如下
Butt touch
做了以上操作,You may find that there is no response to touch,This is because touch bound event
The event number is incorrect,The default binding is event3
And look up Startup log
可知,The touch screen of the development board is docked event0
At this time, you need to modify the binding event
事件号,其配置文件在 lv_drv_conf.h
内:
这里将 event3
改为 event0
即可
Except this way of course,In addition, you can also use commands to generate soft linkstouchscreen
,will be directly used touchscreen
is the touch node,方便调试:
测试编译
修改好了,I hope to compile this package separately for testing without compiling the complete one SDK.可以这样做:
(1)确保已经 source build/envsetup.sh
并已经 lunch
(2)Execute commands in any folder mmo lv_2048 -B
其中 mmo
的意思是 单独编译一个 openWrt
软件包,后面的 lv_2048
是软件包名.-B
Parameters come first clean
再编译,Without this parameter, it is compiled directly.
测试运行
编译打包后,use on the development board lv_2048
即可运行
边栏推荐
- Yann LeCun转推:参数减少50倍,性能还更好,MetaAI推出Atlas信息检索模型
- QOS function introduction
- Basic use of Go Context
- Pagoda panel open Redis to specify the network machine
- 蓝帽杯半决赛火炬木wp
- Digital Collection Platform System Development Practice
- Systemui status bar to add a new icon
- systemui shield notification bar
- 网络初识(二)
- Introduction to program debugging and its use
猜你喜欢
随机推荐
NFT digital collection development issue - digital collection platform
JS 从零手写实现一个bind方法
XML基本学习
Oracle数据库备份dmp文件太大,有什么办法可以在备份的时候拆分成多个dmp吗?
[Semantic Segmentation] DeepLab Series
pytest框架优化
Meaning and names of 12 nautical miles, 24 nautical miles and 200 nautical miles
Introduction to program debugging and its use
机器学习总结(一)
Azure IoT 合作伙伴技术赋能工作坊:IoT Dev Hack
软件测试用例篇
Introduction to the functional logic of metaForce Fosage 2.0 system development
QOS功能介绍
Yann LeCun转推:参数减少50倍,性能还更好,MetaAI推出Atlas信息检索模型
【芯片】人人皆可免费造芯?谷歌开源芯片计划已释放90nm、130nm和180nm工艺设计套件
MySQL命令行导出导入数据库
容器化 | 在 S3 实现定时备份
【语义分割】DeepLab系列
华为云DevCloud获信通院首批云原生技术架构成熟度评估的最高级认证
$‘\r‘: command not found