当前位置:网站首页>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
即可运行
边栏推荐
- FP6378AS5CTR SOT-23-5 高效1MHz2A同步降压调节器
- 老板加薪!看我做的WPF Loading!!!
- Azure IoT 合作伙伴技术赋能工作坊:IoT Dev Hack
- 请查收 2022华为开发者大赛备赛攻略
- MySQL 原理与优化:Update 优化
- 10 advanced functions of scala
- 数字藏品平台系统开发实战
- 12海里、24海里、200海里的意义及名称
- [Data warehouse design] Why should enterprise data warehouses be layered?(six benefits)
- QOS function introduction
猜你喜欢
随机推荐
奢侈品鉴定机构小程序开发制作功能介绍
Basic use of Go Context
Oracle数据库备份dmp文件太大,有什么办法可以在备份的时候拆分成多个dmp吗?
机器学习总结(一)
pytest框架优化
物资采购小程序开发制作功能介绍
Flask框架——MongoEngine使用MongoDB数据库
解题-->在线OJ(十九)
Boss raises salary!Look at my WPF Loading!!!
"NIO Cup" 2022 Nioke Summer Multi-School Training Camp 7
自定义picker滚动选择器样式
PAT甲级 1014 排队等候(队列大模拟+格式化时间)
redhat替换yum源时redhat.repo无法删除或无法禁用的问题解决方法
基于 Azuki 系列:NFT估值分析框架“DRIC”
Introduction to the functional logic of metaForce Fosage 2.0 system development
容器化 | 在 S3 实现定时备份
请查收 2022华为开发者大赛备赛攻略
CSP-J1 CSP-S1 初赛 第1轮(2022.08.09)
程序员=加班??——掌握时间才能掌握人生
MySQL Principle and Optimization: Update Optimization