当前位置:网站首页>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 即可运行

边栏推荐
猜你喜欢

APP automation testing with Uiautomator2

E. Cross Swapping(并查集变形/好题)

机器学习总结(一)

Meaning and names of 12 nautical miles, 24 nautical miles and 200 nautical miles

NFT数字藏品——数字藏品发行平台开发

PyTorch multi-machine multi-card training: DDP combat and skills

Yi Gene|In-depth review: epigenetic regulation of m6A RNA methylation in brain development and disease

DB2查询2个时间段之间的所有月份,DB2查询2个时间段之间的所有日期

JS 从零手写实现一个bind方法

JS入门到精通完整版
随机推荐
MySQL批量更新与批量更新多条记录的不同值实现方法
数据类型与整型存储
网络安全(加密技术、数字签名、证书)
MySQL Principle and Optimization: Update Optimization
老板加薪!看我做的WPF Loading!!!
使用 ABAP 正则表达式解析 uuid 的值
基于 Azuki 系列:NFT估值分析框架“DRIC”
How to code like a pro in 2022 and avoid If-Else
异地多活方法论
Introduction to the functional logic of metaForce Fosage 2.0 system development
Yann LeCun转推:参数减少50倍,性能还更好,MetaAI推出Atlas信息检索模型
格式化输出当前时间
Oracle数据库备份dmp文件太大,有什么办法可以在备份的时候拆分成多个dmp吗?
秒杀项目收获
数据在内存中的存储
fatal error C1083 无法打开包括文件'io.h' No such file
Yi Gene|In-depth review: epigenetic regulation of m6A RNA methylation in brain development and disease
TestLink Export Use Case Transformation Tool
10 advanced functions of scala
【语义分割】DeepLab系列